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