转桌 全部商品

This commit is contained in:
2026-03-26 10:14:15 +08:00
parent e8731e1d4d
commit 82e40dc82a
2 changed files with 11 additions and 1 deletions

View File

@@ -29,4 +29,9 @@ public class MergeOrderDTO implements Serializable {
* 转台详情Id * 转台详情Id
*/ */
private List<Long> detailIds; private List<Long> detailIds;
/**
* 是否全部商品转台 0:否 1:是
*/
private Integer allMerge;
} }

View File

@@ -553,6 +553,9 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
if (param.getTargetOrderId() == null && StrUtil.isBlank(param.getTargetTableCode())) { if (param.getTargetOrderId() == null && StrUtil.isBlank(param.getTargetTableCode())) {
throw new CzgException("转台失败,请选择目标台桌后转台"); throw new CzgException("转台失败,请选择目标台桌后转台");
} }
if(param.getAllMerge()==null){
param.setAllMerge(0);
}
OrderInfo sourceOrder = orderInfoService.getById(param.getSourceOrderId()); OrderInfo sourceOrder = orderInfoService.getById(param.getSourceOrderId());
if (sourceOrder == null || !sourceOrder.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) { if (sourceOrder == null || !sourceOrder.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
throw new CzgException("转台失败,无可转订单"); throw new CzgException("转台失败,无可转订单");
@@ -595,7 +598,9 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
orderDetailService.update(orderDetailUp, orderDetailService.update(orderDetailUp,
new QueryWrapper().eq(OrderDetail::getOrderId, sourceOrder.getId()).in(OrderDetail::getId, param.getDetailIds())); new QueryWrapper().eq(OrderDetail::getOrderId, sourceOrder.getId()).in(OrderDetail::getId, param.getDetailIds()));
} }
if(param.getAllMerge()==1){
shopTableService.updateStatus(sourceOrder.getShopId(), null, sourceOrder.getTableCode(), ShopTableStatusEnum.IDLE.getValue()); shopTableService.updateStatus(sourceOrder.getShopId(), null, sourceOrder.getTableCode(), ShopTableStatusEnum.IDLE.getValue());
}
shopTableService.updateStatus(sourceOrder.getShopId(), null, targetOrder.getTableCode(), ShopTableStatusEnum.UNSETTLED.getValue()); shopTableService.updateStatus(sourceOrder.getShopId(), null, targetOrder.getTableCode(), ShopTableStatusEnum.UNSETTLED.getValue());
return CzgResult.success(); return CzgResult.success();
} }