就餐模式切换携带tableId
This commit is contained in:
@@ -15,4 +15,5 @@ public class ChoseModelDTO {
|
|||||||
private List<Integer> cartIds;
|
private List<Integer> cartIds;
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String useType;
|
private String useType;
|
||||||
|
private String tableId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1794,10 +1794,13 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object choseModel(ChoseModelDTO choseModelDTO) {
|
public Object choseModel(ChoseModelDTO choseModelDTO) {
|
||||||
|
if (!OrderUseTypeEnum.TAKEOUT.getValue().equals(choseModelDTO.getUseType()) && StrUtil.isBlank(choseModelDTO.getTableId())) {
|
||||||
|
throw new BadRequestException("堂食tableId必须传递");
|
||||||
|
}
|
||||||
cashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
|
cashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
|
||||||
.eq(TbCashierCart::getShopId, choseModelDTO.getShopId())
|
.eq(TbCashierCart::getShopId, choseModelDTO.getShopId())
|
||||||
.in(TbCashierCart::getId, choseModelDTO.getCartIds())
|
.in(TbCashierCart::getId, choseModelDTO.getCartIds())
|
||||||
.set(TbCashierCart::getTableId, null)
|
.set(TbCashierCart::getTableId, OrderUseTypeEnum.TAKEOUT.getValue().equals(choseModelDTO.getUseType()) ? null : choseModelDTO.getTableId())
|
||||||
.set(TbCashierCart::getUseType, choseModelDTO.getUseType()));
|
.set(TbCashierCart::getUseType, choseModelDTO.getUseType()));
|
||||||
|
|
||||||
return orderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
|
return orderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
|
||||||
|
|||||||
Reference in New Issue
Block a user