feat: 添加购物车简化修改
This commit is contained in:
@@ -399,6 +399,24 @@ public class OrderService {
|
|||||||
|
|
||||||
TbCashierCart cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO);
|
TbCashierCart cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO);
|
||||||
if (type.equals("edit") && cashierCart!= null) {
|
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 = new TbCashierCart();
|
||||||
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
|
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||||
if (product != null) {
|
if (product != null) {
|
||||||
@@ -456,24 +474,7 @@ public class OrderService {
|
|||||||
}
|
}
|
||||||
list.add(cashierCart);
|
list.add(cashierCart);
|
||||||
mpCashierCartMapper.insert(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);
|
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cashierCart), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user