From 3829685b58f0aec0db70aec4ad371dc09bad987c Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Thu, 29 Aug 2024 14:24:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=20?= =?UTF-8?q?=E5=8F=B0=E6=A1=8C=E7=8A=B6=E6=80=81=E5=90=8C=E6=97=B6=E6=A0=A1?= =?UTF-8?q?=E9=AA=8Cdetail=E5=92=8C=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/dao/TbCashierCartMapper.java | 3 +++ .../system/cashierservice/service/ShopInfoService.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java index acc9612..bf2fb70 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java @@ -75,4 +75,7 @@ public interface TbCashierCartMapper { @Select("select count(*) from tb_cashier_cart where shop_id=#{shopId} and `status`='create' and table_id=#{qrcode} and order_id is not null") int countTable(@Param("qrcode") String qrcode, @Param("shopId") Integer shopId); + + @Select("select count(*) from tb_order_detail where shop_id=#{shopId} and `status`='create' and table_id=#{qrcode} and order_id is not null") + int countTableByDetail(@Param("qrcode") String qrcode, @Param("shopId") Integer shopId); } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java index c831e1f..e0edb0e 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopInfoService.java @@ -70,7 +70,9 @@ public class ShopInfoService { if (StrUtil.isBlank(tbShopTableVO.getQrcode())) { tbShopTableVO.setStatus("closed"); - }else if (tbCashierCartMapper.countTable(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1) { + }else if (tbCashierCartMapper.countTable(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1 || + tbCashierCartMapper.countTableByDetail(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1 + ) { tbShopTableVO.setStatus("idle"); mpShopTableMapper.update(null, new LambdaUpdateWrapper() .eq(TbShopTable::getQrcode, tbShopTableVO.getQrcode())