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); //修改耗材数据