校验店铺全局餐位费
This commit is contained in:
@@ -47,7 +47,35 @@ 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());
|
||||
isMunchies ? OrderUseTypeEnum.DINE_IN_BEFORE.getValue() : OrderUseTypeEnum.DINE_IN_AFTER.getValue(), isOpenTakeout, isOpenDineIn);
|
||||
}
|
||||
|
||||
public ShopEatTypeInfoDTO getEatModel(String tableId, Object shopId) {
|
||||
String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
||||
|
||||
TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper<TbShopInfo>()
|
||||
.eq(TbShopInfo::getId, shopId)
|
||||
.eq(TbShopInfo::getStatus, 1));
|
||||
if (shopInfo == null) {
|
||||
throw new MsgException("店铺信息不存在");
|
||||
}
|
||||
|
||||
boolean isTakeout = ShopInfoEatModelEnum.TAKE_OUT.getValue().equals(eatModel);
|
||||
// 是否是快餐版/先付费
|
||||
boolean isMunchies = StrUtil.isNotBlank(shopInfo.getRegisterType()) &&
|
||||
ShopInfoRegisterlEnum.MUNCHIES.getValue().equals(shopInfo.getRegisterType());
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user