| @@ -116,18 +116,22 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| if(record.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | if(record.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | ||||
| record.getType().equals(EnumCouponType.CARD_MULTIMCH.getCode())) { | record.getType().equals(EnumCouponType.CARD_MULTIMCH.getCode())) { | ||||
| Integer subsidyType = record.getSubsidyType(); | Integer subsidyType = record.getSubsidyType(); | ||||
| Integer subsidyNum = record.getSubsidyNum(); | |||||
| if(subsidyType == null) { | if(subsidyType == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写补贴类型"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写补贴类型"); | ||||
| } | } | ||||
| if(subsidyNum == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写补贴金额"); | |||||
| } | |||||
| if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_COUPON.getCode())) { | if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_COUPON.getCode())) { | ||||
| // 微信 立减 | // 微信 立减 | ||||
| if(record.getSubsidyNum() > record.getSalePrice()) { | |||||
| if(subsidyNum > record.getSalePrice()) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); | ||||
| } | } | ||||
| } else if(subsidyType.equals(EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode())) { | } else if(subsidyType.equals(EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode())) { | ||||
| // 线下补贴 | // 线下补贴 | ||||
| int subsidy_num = record.getPrice() - record.getSalePrice(); | int subsidy_num = record.getPrice() - record.getSalePrice(); | ||||
| if(record.getSubsidyNum() > subsidy_num) { | |||||
| if(subsidyNum > subsidy_num) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); | ||||
| } | } | ||||
| } else if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) { | } else if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) { | ||||