客座费支持删除清空
This commit is contained in:
@@ -848,8 +848,14 @@ public class CartService {
|
|||||||
});
|
});
|
||||||
boolean hasNewInfo = false;
|
boolean hasNewInfo = false;
|
||||||
|
|
||||||
|
// 外带模式去除餐位费
|
||||||
|
TbCashierCart seatCartInfo = null;
|
||||||
//校验 库存 耗材
|
//校验 库存 耗材
|
||||||
for (TbCashierCart cart : cashierCartList) {
|
for (TbCashierCart cart : cashierCartList) {
|
||||||
|
if (shopEatTypeInfoDTO.isTakeout() && "-999".equals(cart.getProductId())) {
|
||||||
|
seatCartInfo = cart;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// 设置用餐类型
|
// 设置用餐类型
|
||||||
cart.setUseType(shopEatTypeInfoDTO.getUseType());
|
cart.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||||
// 设置打包费
|
// 设置打包费
|
||||||
@@ -927,7 +933,6 @@ public class CartService {
|
|||||||
} else {
|
} else {
|
||||||
tbProduct = null;
|
tbProduct = null;
|
||||||
saleAmount = saleAmount.add(shopEatTypeInfoDTO.getShopInfo().getTableFee());
|
saleAmount = saleAmount.add(shopEatTypeInfoDTO.getShopInfo().getTableFee());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
totalAmount = totalAmount.add(cart.getTotalAmount());
|
totalAmount = totalAmount.add(cart.getTotalAmount());
|
||||||
@@ -981,7 +986,6 @@ public class CartService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//生成订单
|
//生成订单
|
||||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
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<>();
|
List<TbActivateOutRecord> outRecords = new ArrayList<>();
|
||||||
for (TbCashierCart cashierCart : cashierCartList) {
|
for (TbCashierCart cashierCart : cashierCartList) {
|
||||||
if (cashierCart.getIsVip().equals((byte) 1)) {
|
if (cashierCart.getIsVip().equals((byte) 1)) {
|
||||||
@@ -1154,6 +1161,11 @@ public class CartService {
|
|||||||
mpCashierCartMapper.updateById(cashierCart);
|
mpCashierCartMapper.updateById(cashierCart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除旧的餐位费信息
|
||||||
|
if (shopEatTypeInfoDTO.isTakeout() && seatCartInfo != null) {
|
||||||
|
cashierCartMapper.deleteByPrimaryKey(seatCartInfo.getId());
|
||||||
|
}
|
||||||
|
|
||||||
if (!CollectionUtils.isEmpty(outRecords)) outRecordMapper.insertBatch(outRecords);
|
if (!CollectionUtils.isEmpty(outRecords)) outRecordMapper.insertBatch(outRecords);
|
||||||
|
|
||||||
// 打印票据
|
// 打印票据
|
||||||
|
|||||||
Reference in New Issue
Block a user