From ee7f74d1734f2e8632193b0e1386f53b3c09d564 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 8 Jan 2019 21:33:41 +0800 Subject: [PATCH] =?UTF-8?q?[=E8=A1=A5=E8=B4=B4=E5=BC=82=E5=B8=B8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B][=E4=BF=AE=E6=94=B9]:=E9=80=9A=E7=94=A8=E5=88=B8?= =?UTF-8?q?=E5=8F=8A=E5=82=A8=E5=80=BC=E5=8D=A1=E8=A1=A5=E8=B4=B4=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxCouponServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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())) {