diff --git a/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java index 84db70eda..5dfaefbe6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java @@ -85,6 +85,7 @@ public class PushLimitServiceImpl implements PushLimitService { // 2. check time boolean isInDate = DateUtils.isInDate(curDate, pushLimit.getTimeStart(), pushLimit.getTimeEnd()); if (!isInDate) { + logger.error("短信已达到每天上限"); throw new MallinkException(ErrorCode.COUPON_SEND_NOT_INRANG); } // TODO 3. check phone had up to limit @@ -107,14 +108,18 @@ public class PushLimitServiceImpl implements PushLimitService { params.put("cUserId", cUserId); int countForUser = wxCouponActionLogMapper.getCountByUser(params); if (countForUser >= pushLimit.getCouponAmount()) { - throw new MallinkException(ErrorCode.COUPON_SEND_UP_TO_COUPONLIMIT); + String errMsg = "每人每天领券已达到疲劳度上限: " + pushLimit.getCouponAmount(); + logger.error(errMsg); + throw new MallinkException(ErrorCode.COUPON_SEND_UP_TO_COUPONLIMIT.getCode(), errMsg); } // 4. check 每人多少天内不会重复收到一张券 params.put("couponId", couponId); params.put("dayNum", pushLimit.getCouponDay()); int countForUserCoupon = wxCouponActionLogMapper.getCountByUserAndCoupon(params); - if (countForUserCoupon >= pushLimit.getCouponDay()) { - throw new MallinkException(ErrorCode.COUPON_SEND_UP_TO_COUPONLIMIT); + if (countForUserCoupon >= 1) { + String errMsg = "每人" + pushLimit.getCouponDay() + "天领一张券已到疲劳度上限"; + logger.error(errMsg); + throw new MallinkException(ErrorCode.COUPON_SEND_UP_TO_COUPONLIMIT.getCode(), errMsg); } return true; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index 07d565691..5a70ffcbc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -435,6 +435,14 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { if (payList.size() > 0) { payOrder = payList.get(0); } + if (payOrder == null) { + logger.error("找不到payOrder信息"); + throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); + } + if (payOrder.getPrepayId() == null) { + logger.error("payOrder信息中,prepay_id为空"); + throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); + } WxMaService wxMaService = MaUtil.getWeappService(appInfo); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java index aa496ae17..fa3c6d76a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java @@ -107,6 +107,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { List wxCouponSends = wxCouponSendMapper.findList(wxCouponSendQuery); for (WxCouponSend send : wxCouponSends) { boolean checkLimit = false; + // 检查疲劳度 try { checkLimit = pushLimitService.checkCoupon(tenantId, cUserId, send.getCouponId()); } catch (MallinkException e) {