|
@@ -320,7 +320,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
if (StringUtil.isNotEmpty(goodsIds[n])) {
|
|
|
MtCouponGoods mtCouponGoods = new MtCouponGoods();
|
|
|
mtCouponGoods.setCouponId(couponInfo.getId());
|
|
|
- mtCouponGoods.setGoodsId(Integer.parseInt(goodsIds[n]));
|
|
|
+ mtCouponGoods.setGoodsId(Long.valueOf(goodsIds[n]));
|
|
|
mtCouponGoods.setStatus(StatusEnum.ENABLED.getKey());
|
|
|
mtCouponGoods.setCreateTime(new Date());
|
|
|
mtCouponGoods.setUpdateTime(new Date());
|
|
@@ -345,7 +345,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
userCoupon.setCouponId(couponInfo.getId());
|
|
|
userCoupon.setGroupId(mtCoupon.getGroupId());
|
|
|
userCoupon.setMobile("");
|
|
|
- userCoupon.setUserId(0);
|
|
|
+ userCoupon.setUserId(0L);
|
|
|
userCoupon.setStatus(UserCouponStatusEnum.UNSEND.getKey());
|
|
|
userCoupon.setCreateTime(new Date());
|
|
|
userCoupon.setUpdateTime(new Date());
|
|
@@ -381,7 +381,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
|
|
|
userCoupon.setAmount(couponInfo.getAmount());
|
|
|
userCoupon.setBalance(couponInfo.getAmount());
|
|
|
- userCoupon.setStoreId(0);
|
|
|
+ userCoupon.setStoreId(0L);
|
|
|
userCoupon.setOperator(reqCouponDto.getOperator());
|
|
|
userCoupon.setImage(couponInfo.getImage());
|
|
|
|
|
@@ -408,7 +408,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public MtCoupon queryCouponById(Integer id) {
|
|
|
+ public MtCoupon queryCouponById(Long id) {
|
|
|
return mtCouponMapper.selectById(id);
|
|
|
}
|
|
|
|
|
@@ -424,7 +424,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
@OperationServiceLog(description = "删除卡券")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void deleteCoupon(Long id, String operator) throws BusinessCheckException {
|
|
|
- MtCoupon couponInfo = queryCouponById(id.intValue());
|
|
|
+ MtCoupon couponInfo = queryCouponById(id);
|
|
|
if (null == couponInfo) {
|
|
|
throw new BusinessCheckException("卡券不存在");
|
|
|
}
|
|
@@ -449,10 +449,10 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
Integer pageSize = couponListParam.getPageSize() == null ? Constants.PAGE_SIZE : couponListParam.getPageSize();
|
|
|
String status = couponListParam.getStatus() == null ? StatusEnum.ENABLED.getKey() : couponListParam.getStatus();
|
|
|
String type = couponListParam.getType() == null ? "" : couponListParam.getType();
|
|
|
- Integer userId = couponListParam.getUserId() == null ? 0 : couponListParam.getUserId();
|
|
|
+ Long userId = couponListParam.getUserId() == null ? 0 : couponListParam.getUserId();
|
|
|
Integer needPoint = couponListParam.getNeedPoint() == null ? 0 : couponListParam.getNeedPoint();
|
|
|
String sendWay = couponListParam.getSendWay() == null ? "front" : couponListParam.getSendWay();
|
|
|
- Integer merchantId = couponListParam.getMerchantId() == null ? 0 : couponListParam.getMerchantId();
|
|
|
+ Long merchantId = couponListParam.getMerchantId() == null ? 0 : couponListParam.getMerchantId();
|
|
|
|
|
|
Page<MtCoupon> pageHelper = PageHelper.startPage(pageNumber, pageSize);
|
|
|
LambdaQueryWrapper<MtCoupon> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
@@ -578,8 +578,8 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
* @param groupId 查询参数
|
|
|
* @return
|
|
|
* */
|
|
|
- public List<MtCoupon> queryCouponListByGroupId(Integer groupId) {
|
|
|
- return mtCouponMapper.queryByGroupId(groupId.intValue());
|
|
|
+ public List<MtCoupon> queryCouponListByGroupId(Long groupId) {
|
|
|
+ return mtCouponMapper.queryByGroupId(groupId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -597,7 +597,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@OperationServiceLog(description = "发放卡券")
|
|
|
- public void sendCoupon(Integer couponId, Integer userId, Integer num, Boolean sendMessage, String uuid, String operator) throws BusinessCheckException {
|
|
|
+ public void sendCoupon(Long couponId, Long userId, Integer num, Boolean sendMessage, String uuid, String operator) throws BusinessCheckException {
|
|
|
MtCoupon couponInfo = queryCouponById(couponId);
|
|
|
MtUser userInfo = memberService.queryMemberById(userId);
|
|
|
|
|
@@ -751,14 +751,14 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@OperationServiceLog(description = "发放卡券")
|
|
|
- public Boolean batchSendCoupon(Integer couponId, List<Integer> userIds, Integer num, String uuid, String operator) throws BusinessCheckException {
|
|
|
+ public Boolean batchSendCoupon(Long couponId, List<Long> userIds, Integer num, String uuid, String operator) throws BusinessCheckException {
|
|
|
if (userIds == null || userIds.size() < 1) {
|
|
|
throw new BusinessCheckException("发放对象异常,卡券发放失败");
|
|
|
}
|
|
|
// 发放人数大于10就不发送消息了
|
|
|
Boolean sendMsg = userIds.size() >= 10 ? false : true;
|
|
|
if (userIds != null && userIds.size() > 0) {
|
|
|
- for (Integer userId : userIds) {
|
|
|
+ for (Long userId : userIds) {
|
|
|
sendCoupon(couponId, userId, num, sendMsg, uuid, operator);
|
|
|
}
|
|
|
}
|
|
@@ -877,12 +877,12 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
// 判断适用会员等级
|
|
|
if (userCoupon.getUserId() != null && userCoupon.getUserId() > 0 && StringUtil.isNotEmpty(couponInfo.getGradeIds())) {
|
|
|
MtUser mtUser = memberService.queryMemberById(userCoupon.getUserId());
|
|
|
- if (StringUtil.isEmpty(mtUser.getGradeId())) {
|
|
|
+ if (Objects.isNull(mtUser.getGradeId())) {
|
|
|
MtUserGrade defaultGrade = userGradeService.getInitUserGrade(mtUser.getMerchantId());
|
|
|
if (defaultGrade != null) {
|
|
|
- mtUser.setGradeId(defaultGrade.getId().toString());
|
|
|
+ mtUser.setGradeId(defaultGrade.getId());
|
|
|
} else {
|
|
|
- mtUser.setGradeId("0");
|
|
|
+ mtUser.setGradeId(0L);
|
|
|
}
|
|
|
}
|
|
|
String[] gradeIds = couponInfo.getGradeIds().split(",");
|
|
@@ -995,7 +995,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
*/
|
|
|
@Override
|
|
|
@OperationServiceLog(description = "删除会员卡券")
|
|
|
- public void deleteUserCoupon(Integer id, String operator) throws BusinessCheckException {
|
|
|
+ public void deleteUserCoupon(Long id, String operator) throws BusinessCheckException {
|
|
|
MtUserCoupon userCoupon = mtUserCouponMapper.selectById(id);
|
|
|
if (null == userCoupon) {
|
|
|
return;
|
|
@@ -1031,7 +1031,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@OperationServiceLog(description = "撤销卡券核销")
|
|
|
- public void rollbackUserCoupon(Integer id, Integer userCouponId,String operator) throws BusinessCheckException {
|
|
|
+ public void rollbackUserCoupon(Long id, Integer userCouponId,String operator) throws BusinessCheckException {
|
|
|
MtConfirmLog mtConfirmLog = mtConfirmLogMapper.selectById(id);
|
|
|
MtUserCoupon userCoupon = mtUserCouponMapper.selectById(userCouponId);
|
|
|
|
|
@@ -1101,7 +1101,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
* @return
|
|
|
* */
|
|
|
@Override
|
|
|
- public MtUserCoupon queryUserCouponById(Integer userCouponId) {
|
|
|
+ public MtUserCoupon queryUserCouponById(Long userCouponId) {
|
|
|
return mtUserCouponMapper.selectById(userCouponId);
|
|
|
}
|
|
|
|
|
@@ -1122,14 +1122,14 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
|
|
|
Integer total = paginationResponse.size();
|
|
|
|
|
|
- List<Integer> coupondIdList = mtUserCouponMapper.getCouponIdsByUuid(uuid);
|
|
|
- List<Integer> couponIds = new ArrayList<>();
|
|
|
- couponIds.add(0);
|
|
|
+ List<Long> coupondIdList = mtUserCouponMapper.getCouponIdsByUuid(uuid);
|
|
|
+ List<Long> couponIds = new ArrayList<>();
|
|
|
+ couponIds.add(0L);
|
|
|
|
|
|
Date nowDate = new Date();
|
|
|
|
|
|
for (int i = 0; i < coupondIdList.size(); i++) {
|
|
|
- Integer couponId = coupondIdList.get(i);
|
|
|
+ Long couponId = coupondIdList.get(i);
|
|
|
MtCoupon couponInfo = queryCouponById(couponId);
|
|
|
if (couponInfo.getStatus().equals(StatusEnum.ENABLED.getKey()) && couponInfo.getEndTime().after(nowDate)) {
|
|
|
couponIds.add(couponId);
|
|
@@ -1226,7 +1226,7 @@ public class CouponServiceImpl extends ServiceImpl<MtCouponMapper, MtCoupon> imp
|
|
|
* */
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean removeCoupon(Integer userCouponId, Integer userId) throws BusinessCheckException {
|
|
|
+ public boolean removeCoupon(Integer userCouponId, Long userId) throws BusinessCheckException {
|
|
|
MtUserCoupon userCoupon = mtUserCouponMapper.selectById(userCouponId);
|
|
|
if (null == userCoupon) {
|
|
|
throw new BusinessCheckException("删除失败:该卡券不存在!");
|