就餐模式获取修改
This commit is contained in:
@@ -37,6 +37,10 @@ public class ShopUtils {
|
|||||||
|
|
||||||
boolean isOpenTakeout = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.TAKE_OUT.getValue());
|
boolean isOpenTakeout = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.TAKE_OUT.getValue());
|
||||||
boolean isOpenDineIn = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.DINE_IN.getValue());
|
boolean isOpenDineIn = shopInfo.getEatModel().contains(ShopInfoEatModelEnum.DINE_IN.getValue());
|
||||||
|
if (!isOpenDineIn && !isOpenTakeout) {
|
||||||
|
throw new MsgException("此店铺未开通任何就餐模式");
|
||||||
|
}
|
||||||
|
|
||||||
tableId = isOpenDineIn ? tableId : null;
|
tableId = isOpenDineIn ? tableId : null;
|
||||||
String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
||||||
|
|
||||||
@@ -44,18 +48,17 @@ public class ShopUtils {
|
|||||||
throw new MsgException("当前店铺未开启此就餐模式");
|
throw new MsgException("当前店铺未开启此就餐模式");
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isTakeout = ShopInfoEatModelEnum.TAKE_OUT.getValue().equals(eatModel);
|
|
||||||
// 是否是快餐版/先付费
|
// 是否是快餐版/先付费
|
||||||
boolean isMunchies = StrUtil.isNotBlank(shopInfo.getRegisterType()) &&
|
boolean isMunchies = StrUtil.isNotBlank(shopInfo.getRegisterType()) &&
|
||||||
ShopInfoRegisterlEnum.MUNCHIES.getValue().equals(shopInfo.getRegisterType());
|
ShopInfoRegisterlEnum.MUNCHIES.getValue().equals(shopInfo.getRegisterType());
|
||||||
|
|
||||||
boolean isDineInAfter = !isMunchies && !isTakeout;
|
boolean isTakeout = isOpenTakeout && ShopInfoEatModelEnum.TAKE_OUT.getValue().equals(eatModel);
|
||||||
boolean isDineInBefore = isMunchies && !isTakeout;
|
boolean isDineInAfter = isOpenDineIn && !isMunchies && !isTakeout;
|
||||||
|
boolean isDineInBefore = isOpenDineIn && isMunchies && !isTakeout;
|
||||||
|
|
||||||
|
|
||||||
return new ShopEatTypeInfoDTO(isTakeout, isMunchies, isDineInAfter, isDineInBefore, shopInfo, isTakeout ? OrderUseTypeEnum.TAKEOUT.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);
|
isDineInBefore ? OrderUseTypeEnum.DINE_IN_BEFORE.getValue() : isDineInAfter ? OrderUseTypeEnum.DINE_IN_AFTER.getValue() : null, isOpenTakeout, isOpenDineIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShopEatTypeInfoDTO getEatModel(String tableId, Object shopId) {
|
public ShopEatTypeInfoDTO getEatModel(String tableId, Object shopId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user