|
|
|
@@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//启动审批流 |
|
|
|
|