fix: 转桌并桌实现

This commit is contained in:
张松
2024-12-10 17:44:51 +08:00
parent 8772d97709
commit 904357aea9

View File

@@ -2693,6 +2693,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
tbCashierCart.setNumber(BigDecimal.valueOf(choseCountDTO.getNum()));
tbCashierCart.setTotalNumber(BigDecimal.valueOf(choseCountDTO.getNum()));
tbCashierCart.setUseType(choseCountDTO.getUseType());
tbCashierCart.setPlatformType("pc");
tbCashierCartMapper.insert(tbCashierCart);
} else {
tbCashierCart.setMemberPrice(shopInfo.getTableFee());
@@ -3429,9 +3430,11 @@ public class TbShopTableServiceImpl implements TbShopTableService {
mpOrderDetailService.removeByCartIds(cartIds);
// 删除原有台桌detail和order信息
if (switchTableDTO.isFull() || switchTableDTO.getCartIds().size() == totalSize) {
if (orderId != null && (switchTableDTO.isFull() || switchTableDTO.getCartIds().size() == totalSize)) {
mpOrderInfoService.removeById(orderId);
}else {
}
if (!switchTableDTO.isFull() && switchTableDTO.getCartIds().size() != totalSize){
// 重新创建订单数据
CreateOrderDTO createOrderDTO = new CreateOrderDTO();
createOrderDTO.setMasterId(switchTableDTO.getMasterId());