From ce4b2b4401572ed6cfda5c41b09b1b43c92004a4 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Sun, 29 Sep 2024 14:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=B1=E9=A4=90=E6=A8=A1=E5=BC=8F=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/util/ShopUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/ShopUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/ShopUtils.java index 8393e17..f445c46 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/util/ShopUtils.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/ShopUtils.java @@ -27,7 +27,6 @@ public class ShopUtils { * @return 就餐类型信息 */ public ShopEatTypeInfoDTO checkEatModel(String tableId, Object shopId) { - String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue(); TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper() .eq(TbShopInfo::getId, shopId) @@ -36,13 +35,15 @@ public class ShopUtils { throw new MsgException("店铺信息不存在"); } + boolean isOpenTakeout = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.TAKE_OUT.getValue()); + boolean isOpenDineIn = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.DINE_IN.getValue()); + tableId = isOpenDineIn ? tableId : null; + String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue(); + if (!shopInfo.getEatModel().contains(eatModel)) { throw new MsgException("当前店铺未开启此就餐模式"); } - boolean isOpenTakeout = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.TAKE_OUT.getValue()); - boolean isOpenDineIn = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.DINE_IN.getValue()); - boolean isTakeout = ShopInfoEatModelEnum.TAKE_OUT.getValue().equals(eatModel); // 是否是快餐版/先付费 boolean isMunchies = StrUtil.isNotBlank(shopInfo.getRegisterType()) &&