1.台桌列表支持精确搜索
2.台桌选择人数校验最大人数
This commit is contained in:
@@ -36,4 +36,7 @@ public class TbShopTableQueryCriteria{
|
||||
|
||||
@Query
|
||||
private Integer areaId;
|
||||
}
|
||||
|
||||
@Query
|
||||
private Long qrcode;
|
||||
}
|
||||
|
||||
@@ -1594,6 +1594,15 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
|
||||
@Override
|
||||
public Object choseCount(ChoseCountDTO choseCountDTO) {
|
||||
TbShopTable shopTable = mpShopTableService.lambdaQuery().eq(TbShopTable::getQrcode, choseCountDTO.getTableId()).one();
|
||||
if (shopTable == null) {
|
||||
throw new BadRequestException("台桌不存在");
|
||||
}
|
||||
|
||||
if (shopTable.getMaxCapacity() < choseCountDTO.getNum()) {
|
||||
throw new BadRequestException("当前台桌最大人数为: " + shopTable.getMaxCapacity());
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<TbCashierCart> query = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, choseCountDTO.getShopId())
|
||||
.eq(TbCashierCart::getMasterId, choseCountDTO.getMasterId())
|
||||
|
||||
Reference in New Issue
Block a user