转桌下单次数

This commit is contained in:
2025-03-13 18:14:27 +08:00
parent 23fb8c879d
commit fe16a49a2c

View File

@@ -396,6 +396,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
addDTO.setVipPrice(false); addDTO.setVipPrice(false);
ShopInfo shopInfo = shopInfoService.getById(sourceOrder.getShopId()); ShopInfo shopInfo = shopInfoService.getById(sourceOrder.getShopId());
targetOrder = initOrderInfo(addDTO, shopInfo, null); targetOrder = initOrderInfo(addDTO, shopInfo, null);
} else {
targetOrder.setPlaceNum(targetOrder.getPlaceNum() + 1);
//下单次数+1
updateChain().set(OrderInfo::getPlaceNum, targetOrder.getPlaceNum() + 1).eq(OrderInfo::getId, targetOrder.getId()).update();
} }
if (CollUtil.isEmpty(param.getDetailIds())) { if (CollUtil.isEmpty(param.getDetailIds())) {
long count = orderDetailService.queryChain().eq(OrderDetail::getOrderId, sourceOrder.getId()).count(); long count = orderDetailService.queryChain().eq(OrderDetail::getOrderId, sourceOrder.getId()).count();
@@ -404,12 +408,14 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} }
orderDetailService.updateChain() orderDetailService.updateChain()
.eq(OrderDetail::getOrderId, sourceOrder.getId()) .eq(OrderDetail::getOrderId, sourceOrder.getId())
.set(OrderDetail::getPlaceNum, targetOrder.getPlaceNum())
.set(OrderDetail::getOrderId, targetOrder.getId()) .set(OrderDetail::getOrderId, targetOrder.getId())
.update(); .update();
} else { } else {
orderDetailService.updateChain() orderDetailService.updateChain()
.eq(OrderDetail::getOrderId, sourceOrder.getId()) .eq(OrderDetail::getOrderId, sourceOrder.getId())
.in(OrderDetail::getId, param.getDetailIds()) .in(OrderDetail::getId, param.getDetailIds())
.set(OrderDetail::getPlaceNum, targetOrder.getPlaceNum())
.set(OrderDetail::getOrderId, targetOrder.getId()) .set(OrderDetail::getOrderId, targetOrder.getId())
.update(); .update();
} }
@@ -684,8 +690,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} }
updateChain.update(); updateChain.update();
// if (!"after-pay".equals(orderInfo.getPayMode())) { // if (!"after-pay".equals(orderInfo.getPayMode())) {
//发送打票信息 //发送打票信息
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString()); rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString());
// } // }
} }