订单创建失败不打印菜品票
This commit is contained in:
parent
7379b1d85d
commit
90505fd354
|
|
@ -1038,6 +1038,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbOrderInfo createOrder(CreateOrderDTO createOrderDTO, boolean addMaterId, boolean isPrint) {
|
||||
createOrderDTO.setTableId(OrderUseTypeEnum.TAKEOUT.getValue().equals(createOrderDTO.getUseType()) ? null : createOrderDTO.getTableId());
|
||||
return Utils.runFunAndCheckKey(() -> {
|
||||
|
|
@ -1264,18 +1265,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
mpOrderDetailService.saveOrUpdateBatch(orderDetails);
|
||||
}
|
||||
|
||||
if (!addOrderDetails.isEmpty() && shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), false, addOrderDetails.toArray(new TbOrderDetail[0]));
|
||||
}
|
||||
|
||||
if (!removeOrderDetailIds.isEmpty()) {
|
||||
// 退单票
|
||||
orderDetailMapper.deleteBatchIds(removeOrderDetailIds);
|
||||
if (shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), true, removeOrderDetailList.toArray(new TbOrderDetail[0]));
|
||||
}
|
||||
}
|
||||
|
||||
// 更新购物车记录的orderId
|
||||
for (TbCashierCart cashierCart : cashierCarts) {
|
||||
if (!"-999".equals(cashierCart.getProductId())) {
|
||||
|
|
@ -1302,6 +1291,19 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
cashierCartMapper.updateById(cashierCart);
|
||||
}
|
||||
|
||||
// 菜品票
|
||||
if (!addOrderDetails.isEmpty() && shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), false, addOrderDetails.toArray(new TbOrderDetail[0]));
|
||||
}
|
||||
|
||||
if (!removeOrderDetailIds.isEmpty()) {
|
||||
// 退单票
|
||||
orderDetailMapper.deleteBatchIds(removeOrderDetailIds);
|
||||
if (shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
rabbitMsgUtils.printDishesTicket(orderInfo.getId(), true, removeOrderDetailList.toArray(new TbOrderDetail[0]));
|
||||
}
|
||||
}
|
||||
|
||||
if (isFirst) {
|
||||
// 后付费,不增加当前台桌取餐号
|
||||
if (!shopEatTypeInfoDTO.isTakeout()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue