From de47b50dfddc1fc6b410d553013a436ea1803a0f Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 5 Jul 2019 18:34:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B8=A0=E9=81=93=E5=8D=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxCouponController.java | 12 ++++++++---- .../main/resources/mapper/WxCouponChannelMapper.xml | 8 +++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 4b8a1f401..d3213fa93 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -176,17 +176,21 @@ public class WxCouponController extends BaseController { WxCoupon coupon = wxCouponService.findById(wxCoupon); if(coupon!=null){ - if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ - return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); - } if((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) && wxCoupon.getInventory().equals(coupon.getInventory())) || (wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getInventory().equals(coupon.getInventory()) && - wxCoupon.getValidDays().equals(coupon.getValidDays())) + wxCoupon.getValidDays().equals(coupon.getValidDays())) ){ return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR); } + + if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ + return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); + } + if(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getValidDays().intValue() <= coupon.getValidDays().intValue()){ + return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); + } } //启动审批流 diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 061234a24..76cbbc554 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -24,7 +24,13 @@ - where cc.status = 0 + where 1=1 + + and cc.status = #{status} + + + and cc.status = 0 + and cc.`id` = #{id}