From 344d300193091267d734803aac6b45a6ec2230ae Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 29 Nov 2021 16:41:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/HighOrderController.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 27fca4dd..2edbec9b 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -253,9 +253,24 @@ public class HighOrderController { if (highDiscountUserRel != null) { highOrder.setMemDiscountName(highDiscountUserRel.getHighDiscount().getDiscountName()); - // + // 交易优惠券使用范围 if (highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type1.getType())) { - + // 暂无限制 + } else if (highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type2.getType())) { + // 1:卡卷 2:金币充值 3:团油【加油站】 4: KFC 5:电影票 6:话费充值 + if (!highOrder.getHighChildOrderList().get(0).getGoodsType().equals(1)) { + log.error("HighOrderController --> addOrder() error!", "此优惠券只能购买卡券商品使用"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "此优惠券只能购买卡券商品使用"); + } + } else if (highDiscountUserRel.getHighDiscount().getUseScope().equals(DiscountUseScope.type3.getType())) { + // 1:卡卷 2:金币充值 3:团油【加油站】 4: KFC 5:电影票 6:话费充值 + if (!highOrder.getHighChildOrderList().get(0).getGoodsType().equals(6)) { + log.error("HighOrderController --> addOrder() error!", "此优惠券只能充值话费中使用"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "此优惠券只能充值话费中使用"); + } + } else { + log.error("HighOrderController --> addOrder() error!", "暂时无法使用此优惠券"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, "暂时无法使用此优惠券"); } // 卡卷类型 1:满减 2:抵扣 3:折扣