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}