diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java index fcc4cf9..04810f2 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java @@ -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);