|
|
|
@@ -101,20 +101,27 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
record.setValidDays(null); |
|
|
|
} |
|
|
|
} |
|
|
|
if(record.getSubsidyType().equals(EnumCouponSubsidyType.WECHAT_COUPON.getCode())) { |
|
|
|
// 微信 立减 |
|
|
|
if(record.getSubsidyNum() > record.getSalePrice()) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于售价"); |
|
|
|
if(record.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || |
|
|
|
record.getType().equals(EnumCouponType.CARD_MULTIMCH.getCode())) { |
|
|
|
Integer subsidyType = record.getSubsidyType(); |
|
|
|
if(subsidyType == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "请填写补贴类型"); |
|
|
|
} |
|
|
|
} else if(record.getSubsidyType().equals(EnumCouponSubsidyType.OFFLINE_SUBSIDY.getCode())) { |
|
|
|
// 线下补贴 |
|
|
|
int subsidy_num = record.getPrice() - record.getSalePrice(); |
|
|
|
if(record.getSubsidyNum() > subsidy_num) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); |
|
|
|
} |
|
|
|
} else if(record.getSubsidyType().equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) { |
|
|
|
// TODO 微信转账到银行卡 |
|
|
|
if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_COUPON.getCode())) { |
|
|
|
// 微信 立减 |
|
|
|
if(record.getSubsidyNum() > 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) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "补贴额大于面额与售价的差值"); |
|
|
|
} |
|
|
|
} else if(subsidyType.equals(EnumCouponSubsidyType.WECHAT_MCHPAY.getCode())) { |
|
|
|
// TODO 微信转账到银行卡 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|