fix: 支持套餐商品点餐
This commit is contained in:
@@ -285,13 +285,27 @@ public class CartService {
|
|||||||
/**
|
/**
|
||||||
* 重置购物车套餐商品信息
|
* 重置购物车套餐商品信息
|
||||||
*/
|
*/
|
||||||
private void resetGroupProductCart(List<Integer> productIds,TbCashierCart cashierCart) {
|
private void resetGroupProductCart(List<Integer> productIds, TbCashierCart cashierCart) {
|
||||||
if (StrUtil.isBlank(cashierCart.getProductId())) {
|
if (StrUtil.isBlank(cashierCart.getProductId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TbProduct product = productMapper.selectById(Integer.valueOf(cashierCart.getProductId()));
|
TbProduct product = productMapper.selectById(Integer.valueOf(cashierCart.getProductId()));
|
||||||
|
|
||||||
|
resetCartInfo(productIds, product, cashierCart);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置购物车套餐商品信息
|
||||||
|
*/
|
||||||
|
private void resetGroupProductCart(List<Integer> productIds, TbProduct product, TbCashierCart cashierCart) {
|
||||||
|
if (StrUtil.isBlank(cashierCart.getProductId())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resetCartInfo(productIds, product, cashierCart);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetCartInfo(List<Integer> productIds, TbProduct product, TbCashierCart cashierCart) {
|
||||||
boolean isChoseGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 1;
|
boolean isChoseGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 1;
|
||||||
boolean isFixGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 0;
|
boolean isFixGroup = TableConstant.Product.Type.PACKAGE.equalsVals(product.getType()) && product.getGroupType() == 0;
|
||||||
if (isChoseGroup && productIds != null && !productIds.isEmpty()) {
|
if (isChoseGroup && productIds != null && !productIds.isEmpty()) {
|
||||||
@@ -702,7 +716,7 @@ public class CartService {
|
|||||||
cashierCart.setIsVip((byte) 0);
|
cashierCart.setIsVip((byte) 0);
|
||||||
cashierCart.resetTotalAmount();
|
cashierCart.resetTotalAmount();
|
||||||
cashierCart.setPlatformType(PlatformTypeEnum.MINI_APP.getValue());
|
cashierCart.setPlatformType(PlatformTypeEnum.MINI_APP.getValue());
|
||||||
resetGroupProductCart(groupProductIds, cashierCart);
|
resetGroupProductCart(groupProductIds, product, cashierCart);
|
||||||
mpCashierCartMapper.insert(cashierCart);
|
mpCashierCartMapper.insert(cashierCart);
|
||||||
|
|
||||||
//修改耗材数据
|
//修改耗材数据
|
||||||
|
|||||||
Reference in New Issue
Block a user