From d22a4bb9f591128e74bca4b4b47a311f42c70f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Fri, 15 Nov 2024 14:04:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=A2=E5=8D=95=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=8A=98=E6=89=A3=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/CartService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java index c35cce4..ecfdf07 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -1189,7 +1189,7 @@ public class CartService { tbActivateOutRecord.setRefNum(0); outRecords.add(tbActivateOutRecord); - couponVo.setCurrentDiscountAmount(couponVo.getCurrentDiscountAmount().add(couponVo.getCurrentDiscountAmount())); + couponVo.setCurrentDiscountAmount(couponVo.getCurrentDiscountAmount().add(discountAmount)); // 优惠券未消耗完毕 if (balanceCart != null && getCanUseCoupon(couponMap, balanceCart.getProductId()) != null) { discountAmount = reduceProCoupon(couponMap, balanceCart, usedCouponMap, discountAmount, balanceCartList, outRecords, memberId); @@ -1404,7 +1404,10 @@ public class CartService { couponInfo.setProductCouponMap(BeanUtil.copyProperties(couponInfo.getProductCouponMap(), HashMap.class)); HashMap map = new HashMap<>(); map.put("outRecordList", couponInfo.getOutRecordList()); - map.put("couponInfo", couponInfo.getProductCouponMap().values().addAll(couponInfo.getFullReductionCouponMap().values())); + ArrayList list = new ArrayList<>(); + list.addAll(couponInfo.getProductCouponMap().values()); + list.addAll(couponInfo.getFullReductionCouponMap().values()); + map.put("couponInfo", list); orderInfo.setCouponInfoList(JSONObject.toJSONString(map)); }