票据打印简化

This commit is contained in:
SongZhang 2024-09-28 10:45:42 +08:00
parent 083f7fedcb
commit c763257ea0
1 changed files with 8 additions and 3 deletions

View File

@ -1089,6 +1089,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
// 当前下单次数
int placeNum = getCurrentPlaceNum(shopEatTypeInfoDTO);
List<TbOrderDetail> orderDetails = new ArrayList<>();
List<TbOrderDetail> addOrderDetails = new ArrayList<>();
BigDecimal mealAmount = null;
Integer mealNum = null;
@ -1113,6 +1115,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (orderDetail == null) {
orderDetail = new TbOrderDetail();
hasNewInfo = true;
addOrderDetails.add(orderDetail);
}
if (Objects.nonNull(productSku)) {
@ -1229,10 +1232,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
// 删除已经移除购物车的订单 修改并保存数据
if (!orderDetails.isEmpty()) {
mpOrderDetailService.saveOrUpdateBatch(orderDetails);
if (shopEatTypeInfoDTO.isDineInAfter()) {
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), false, orderDetails.toArray(new TbOrderDetail[0]));
}
}
if (!addOrderDetails.isEmpty() && shopEatTypeInfoDTO.isDineInAfter()) {
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), false, addOrderDetails.toArray(new TbOrderDetail[0]));
}
if (!removeOrderDetailIds.isEmpty()) {
// 退单票
orderDetailMapper.deleteBatchIds(removeOrderDetailIds);