From aee40bef3065cbb511389337d87f0ade6add712c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Wed, 4 Dec 2024 13:51:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=82=B9=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/service/CartService.java | 18 ++++++++++++++++-- 1 file changed, 16 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 68d7a3a..f74223a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -285,13 +285,27 @@ public class CartService { /** * 重置购物车套餐商品信息 */ - private void resetGroupProductCart(List productIds,TbCashierCart cashierCart) { + private void resetGroupProductCart(List productIds, TbCashierCart cashierCart) { if (StrUtil.isBlank(cashierCart.getProductId())) { return; } TbProduct product = productMapper.selectById(Integer.valueOf(cashierCart.getProductId())); + resetCartInfo(productIds, product, cashierCart); + } + + /** + * 重置购物车套餐商品信息 + */ + private void resetGroupProductCart(List productIds, TbProduct product, TbCashierCart cashierCart) { + if (StrUtil.isBlank(cashierCart.getProductId())) { + return; + } + resetCartInfo(productIds, product, cashierCart); + } + + private void resetCartInfo(List productIds, TbProduct product, TbCashierCart cashierCart) { boolean isChoseGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 1; boolean isFixGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 0; if (isChoseGroup && productIds != null && !productIds.isEmpty()) { @@ -702,7 +716,7 @@ public class CartService { cashierCart.setIsVip((byte) 0); cashierCart.resetTotalAmount(); cashierCart.setPlatformType(PlatformTypeEnum.MINI_APP.getValue()); - resetGroupProductCart(groupProductIds, cashierCart); + resetGroupProductCart(groupProductIds, product, cashierCart); mpCashierCartMapper.insert(cashierCart); //修改耗材数据