转桌 台桌状态
This commit is contained in:
@@ -582,24 +582,21 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
||||
updateTargetOrder.setPlaceNum(targetOrder.getPlaceNum() + 1);
|
||||
orderInfoService.updateById(updateTargetOrder);
|
||||
}
|
||||
OrderDetail orderDetailUp = new OrderDetail();
|
||||
orderDetailUp.setOrderId(targetOrder.getId());
|
||||
orderDetailUp.setPlaceNum(targetOrder.getPlaceNum());
|
||||
if (CollUtil.isEmpty(param.getDetailIds())) {
|
||||
long count = orderDetailService.queryChain().eq(OrderDetail::getOrderId, sourceOrder.getId()).count();
|
||||
long count = orderDetailService.count(new QueryWrapper().eq(OrderDetail::getOrderId, sourceOrder.getId()));
|
||||
if (count < 1) {
|
||||
throw new CzgException("转台失败,该订单无可转商品");
|
||||
}
|
||||
orderDetailService.updateChain()
|
||||
.eq(OrderDetail::getOrderId, sourceOrder.getId())
|
||||
.set(OrderDetail::getPlaceNum, targetOrder.getPlaceNum())
|
||||
.set(OrderDetail::getOrderId, targetOrder.getId())
|
||||
.update();
|
||||
orderDetailService.update(orderDetailUp,new QueryWrapper().eq(OrderDetail::getOrderId, sourceOrder.getId()));
|
||||
} else {
|
||||
orderDetailService.updateChain()
|
||||
.eq(OrderDetail::getOrderId, sourceOrder.getId())
|
||||
.in(OrderDetail::getId, param.getDetailIds())
|
||||
.set(OrderDetail::getPlaceNum, targetOrder.getPlaceNum())
|
||||
.set(OrderDetail::getOrderId, targetOrder.getId())
|
||||
.update();
|
||||
orderDetailService.update(orderDetailUp,
|
||||
new QueryWrapper().eq(OrderDetail::getOrderId, sourceOrder.getId()).in(OrderDetail::getId, param.getDetailIds()));
|
||||
}
|
||||
shopTableService.updateStatus(sourceOrder.getShopId(), null, sourceOrder.getTableCode(), ShopTableStatusEnum.IDLE.getValue());
|
||||
shopTableService.updateStatus(sourceOrder.getShopId(), null, targetOrder.getTableCode(), ShopTableStatusEnum.UNSETTLED.getValue());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user