From 5bd7a3cc424b9b72d93622a1ad001eda78829c13 Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 29 Apr 2019 17:35:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=96=B2=E5=8A=B3=E5=BA=A6][=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D]:=E7=96=B2=E5=8A=B3=E5=BA=A6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E4=B8=8D=E6=A3=80=E6=9F=A5=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=86=85=E5=90=8C=E4=B8=80=E5=BC=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PushLimitServiceImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 7718be070..0536af391 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/PushLimitServiceImpl.java @@ -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;