fix: 转桌并桌实现
This commit is contained in:
@@ -3342,7 +3342,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Object switchTable(SwitchTableDTO switchTableDTO) {
|
||||
// 查询当前台桌信息
|
||||
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(switchTableDTO.getShopId(), switchTableDTO.getCurrentTableId(), switchTableDTO.getUseType());
|
||||
@@ -3385,7 +3385,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
TbCashierCart targetSeatFee = null;
|
||||
Integer targetOrderId = null;
|
||||
for (TbCashierCart targetCart : targetCarts) {
|
||||
if (TableConstant.CART_SEAT_ID.equals(targetCart.getId().toString())) {
|
||||
if (TableConstant.CART_SEAT_ID.equals(targetCart.getProductId())) {
|
||||
targetSeatFee = targetCart;
|
||||
}
|
||||
|
||||
@@ -3411,7 +3411,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
orderId = item.getOrderId();
|
||||
}
|
||||
|
||||
if (TableConstant.CART_SEAT_ID.equals(item.getId().toString())) {
|
||||
if (TableConstant.CART_SEAT_ID.equals(item.getProductId().toString())) {
|
||||
currentSeatFee = item;
|
||||
}
|
||||
}
|
||||
@@ -3420,6 +3420,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
targetSeatFee.setNumber(currentSeatFee.getNumber().add(targetSeatFee.getNumber()));
|
||||
targetSeatFee.setTotalNumber(currentSeatFee.getTotalNumber().add(targetSeatFee.getTotalNumber()));
|
||||
targetSeatFee.setTotalAmount(targetSeatFee.getSalePrice().multiply(targetSeatFee.getTotalNumber()));
|
||||
mpCashierCartService.updateById(targetSeatFee);
|
||||
mpCashierCartService.removeById(currentSeatFee.getId());
|
||||
}
|
||||
mpCashierCartService.updateBatchById(updateCartInfos);
|
||||
|
||||
Reference in New Issue
Block a user