diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index dc17646f0..7bdf6f7d5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -116,18 +116,22 @@ public class WxCouponServiceImpl implements WxCouponService { if(record.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || record.getType().equals(EnumCouponType.CARD_MULTIMCH.getCode())) { Integer subsidyType = record.getSubsidyType(); + Integer subsidyNum = record.getSubsidyNum(); if(subsidyType == null) { 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(record.getSubsidyNum() > record.getSalePrice()) { + if(subsidyNum > record.getSalePrice()) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); } } else if(subsidyType.equals(EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode())) { // 线下补贴 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(), "补贴额大于面额与售价的差值"); } } else if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) {