1.台桌列表支持精确搜索

2.台桌选择人数校验最大人数
This commit is contained in:
SongZhang 2024-09-13 10:24:12 +08:00
parent ff27101e13
commit b1e5ae969b
2 changed files with 13 additions and 1 deletions

View File

@ -36,4 +36,7 @@ public class TbShopTableQueryCriteria{
@Query
private Integer areaId;
}
@Query
private Long qrcode;
}

View File

@ -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())