feat: 添加购物车简化修改

This commit is contained in:
张松
2024-12-06 15:03:16 +08:00
parent d6295f5d62
commit a002a624d6

View File

@@ -399,6 +399,24 @@ public class OrderService {
TbCashierCart cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO);
if (type.equals("edit") && cashierCart!= null) {
cashierCart.setNumber(number);
if (product != null) {
resetGroupProductCart(groupProductIdList, product, cashierCart);
}
cashierCart.setTotalNumber(number);
cashierCart.setIsPrint(isPrint);
cashierCart.setIsPack(isPack);
cashierCart.resetTotalAmount();
cashierCart.setUuid(uuid);
cashierCart.setIsPrint(isPrint);
cashierCart.resetTotalAmount();
cart = cashierCart;
if (product != null) {
resetGroupProductCart(groupProductIdList, product, cashierCart);
}
mpCashierCartMapper.updateById(cashierCart);
}else {
cashierCart = new TbCashierCart();
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
if (product != null) {
@@ -456,24 +474,7 @@ public class OrderService {
}
list.add(cashierCart);
mpCashierCartMapper.insert(cashierCart);
}else {
cashierCart.setNumber(number);
if (product != null) {
resetGroupProductCart(groupProductIdList, product, cashierCart);
}
cashierCart.setTotalNumber(number);
cashierCart.setIsPrint(isPrint);
cashierCart.setIsPack(isPack);
cashierCart.resetTotalAmount();
cashierCart.setUuid(uuid);
cashierCart.setIsPrint(isPrint);
cashierCart.resetTotalAmount();
cart = cashierCart;
if (product != null) {
resetGroupProductCart(groupProductIdList, product, cashierCart);
}
mpCashierCartMapper.updateById(cashierCart);
}
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cashierCart), true);