diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopTableQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopTableQueryCriteria.java index ce7a0f45..2b3de201 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopTableQueryCriteria.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbShopTableQueryCriteria.java @@ -36,4 +36,7 @@ public class TbShopTableQueryCriteria{ @Query private Integer areaId; -} \ No newline at end of file + + @Query + private Long qrcode; +} diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index 883a05f7..b571f2a2 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -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 query = new LambdaQueryWrapper() .eq(TbCashierCart::getShopId, choseCountDTO.getShopId()) .eq(TbCashierCart::getMasterId, choseCountDTO.getMasterId())