|
|
|
@@ -137,13 +137,15 @@ public class PushLimitServiceImpl implements PushLimitService { |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_UP_TO_1DAYLIMIT.getCode(), errMsg); |
|
|
|
} |
|
|
|
// 4. check 每人多少天内不会重复收到一张券 |
|
|
|
params.put("couponId", couponId); |
|
|
|
params.put("dayNum", pushLimit.getCouponDay()-1); |
|
|
|
int countForUserCoupon = wxCouponActionLogMapper.getCountByUserAndCoupon(params); |
|
|
|
if (countForUserCoupon >= 1) { |
|
|
|
String errMsg = "每人" + pushLimit.getCouponDay() + "天领一张券已到疲劳度上限"; |
|
|
|
logger.error(errMsg); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_UP_TO_COUPONLIMIT.getCode(), errMsg); |
|
|
|
if (pushLimit.getCouponDay() > 0) { |
|
|
|
params.put("couponId", couponId); |
|
|
|
params.put("dayNum", pushLimit.getCouponDay()-1); |
|
|
|
int countForUserCoupon = wxCouponActionLogMapper.getCountByUserAndCoupon(params); |
|
|
|
if (countForUserCoupon >= 1) { |
|
|
|
String errMsg = "每人" + pushLimit.getCouponDay() + "天领一张券已到疲劳度上限"; |
|
|
|
logger.error(errMsg); |
|
|
|
throw new MallinkException(ErrorCode.PUSH_LIMIT_UP_TO_COUPONLIMIT.getCode(), errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|