From b1e5ae969b0bd690669fcac04ca82d383aa71517 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Fri, 13 Sep 2024 10:24:12 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8F=B0=E6=A1=8C=E5=88=97=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=B2=BE=E7=A1=AE=E6=90=9C=E7=B4=A2=202.=E5=8F=B0?= =?UTF-8?q?=E6=A1=8C=E9=80=89=E6=8B=A9=E4=BA=BA=E6=95=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ysk/cashier/dto/shop/TbShopTableQueryCriteria.java | 5 ++++- .../service/impl/shopimpl/TbShopTableServiceImpl.java | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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())