客座费支持删除清空

This commit is contained in:
2024-09-28 15:05:44 +08:00
parent 4eb69eb199
commit 6ba38ae9d7

View File

@@ -848,8 +848,14 @@ public class CartService {
});
boolean hasNewInfo = false;
// 外带模式去除餐位费
TbCashierCart seatCartInfo = null;
//校验 库存 耗材
for (TbCashierCart cart : cashierCartList) {
if (shopEatTypeInfoDTO.isTakeout() && "-999".equals(cart.getProductId())) {
seatCartInfo = cart;
continue;
}
// 设置用餐类型
cart.setUseType(shopEatTypeInfoDTO.getUseType());
// 设置打包费
@@ -927,7 +933,6 @@ public class CartService {
} else {
tbProduct = null;
saleAmount = saleAmount.add(shopEatTypeInfoDTO.getShopInfo().getTableFee());
}
totalAmount = totalAmount.add(cart.getTotalAmount());
@@ -981,7 +986,6 @@ public class CartService {
}
}
//生成订单
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
@@ -1122,6 +1126,9 @@ public class CartService {
}
}
// 去除餐位费信息
cashierCartList = cashierCartList.stream().filter(item -> !"-999".equals(item.getProductId())).collect(Collectors.toList());
List<TbActivateOutRecord> outRecords = new ArrayList<>();
for (TbCashierCart cashierCart : cashierCartList) {
if (cashierCart.getIsVip().equals((byte) 1)) {
@@ -1154,6 +1161,11 @@ public class CartService {
mpCashierCartMapper.updateById(cashierCart);
}
// 删除旧的餐位费信息
if (shopEatTypeInfoDTO.isTakeout() && seatCartInfo != null) {
cashierCartMapper.deleteByPrimaryKey(seatCartInfo.getId());
}
if (!CollectionUtils.isEmpty(outRecords)) outRecordMapper.insertBatch(outRecords);
// 打印票据