From 91d3f254aad1c3e4ae208036008dfbcb991e1b52 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 4 Nov 2022 17:49:41 +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/HighUserDiscountController.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java index 64faa497..a226f837 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java @@ -305,20 +305,19 @@ public class HighUserDiscountController { if (goodsType.getType().equals(OrderChildGoodsTypeEnum.type3.getType())) { // 过滤出加油服务的加油券 - List collect = userDiscountList.stream().filter(o -> o.getHighDiscount().getUseScope().equals(DiscountUseScope.type7.getType())).collect(Collectors.toList()); + List collect = userDiscountList.stream() + .filter(o -> o.getDiscountUseScope().equals(DiscountUseScope.type7.getType()) || o.getDiscountUseScope().equals(DiscountUseScope.type1.getType())) + .collect(Collectors.toList()); for (HighDiscountUserRel userDiscount : collect) { // 满减 - if (userDiscount.getHighDiscount().getDiscountType().equals(1)) { - if (body.getBigDecimal("goodsPrice").compareTo(userDiscount.getHighDiscount().getDiscountCondition()) >= 0) { + if (userDiscount.getDiscountType().equals(1)) { + if (body.getBigDecimal("goodsPrice").compareTo(userDiscount.getDiscountCondition()) >= 0) { list.add(userDiscount); } } - - if (userDiscount.getHighDiscount().getDiscountType().equals(2) - || userDiscount.getHighDiscount().getDiscountType().equals(3)) { + if (userDiscount.getDiscountType().equals(2) || userDiscount.getDiscountType().equals(3)) { list.add(userDiscount); } - } } list.sort(Comparator.comparing(o -> o.getUseEndTime()));