就餐模式获取修改

This commit is contained in:
2024-09-29 13:37:17 +08:00
parent 5229aff1f8
commit 0dbc76c207
2 changed files with 9 additions and 3 deletions

View File

@@ -39,6 +39,10 @@ public class ShopUtils {
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()) &&
@@ -47,8 +51,7 @@ public class ShopUtils {
boolean isDineInAfter = !isMunchies && !isTakeout;
boolean isDineInBefore = isMunchies && !isTakeout;
boolean isOpenTakeout = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.TAKE_OUT.getValue());
boolean isOpenDineIn = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.DINE_IN.getValue());
return new ShopEatTypeInfoDTO(isTakeout, isMunchies, isDineInAfter, isDineInBefore, shopInfo, isTakeout ? OrderUseTypeEnum.TAKEOUT.getValue() :
isMunchies ? OrderUseTypeEnum.DINE_IN_BEFORE.getValue() : OrderUseTypeEnum.DINE_IN_AFTER.getValue(), isOpenTakeout, isOpenDineIn);