diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/domain/MenuRecipe.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/domain/MenuRecipe.java index 82e3c57..35a0783 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/domain/MenuRecipe.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/domain/MenuRecipe.java @@ -47,8 +47,8 @@ public class MenuRecipe { private Long stallId; // @ApiModelProperty("适用人员范围") // private Long effId; -// @ApiModelProperty("删除标识") -// private Integer delFlag; + @ApiModelProperty("删除标识") + private Integer delFlag; @ApiModelProperty("乐观锁") private Integer revision; @ApiModelProperty("创建人") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java index c7e4988..73d1bea 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuAppRecipeMapper.java @@ -1,8 +1,14 @@ package com.bonus.canteen.core.menu.mapper; +import java.time.LocalDate; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.bonus.canteen.core.menu.domain.MenuAppRecipe; +import com.bonus.canteen.core.menu.domain.MenuRecipe; +import com.bonus.canteen.core.menu.vo.AppletReserveRecipeVO; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * 移动端菜谱绑定关系Mapper接口 @@ -58,4 +64,9 @@ public interface MenuAppRecipeMapper { * @return 结果 */ public int deleteMenuAppRecipeByIds(Long[] ids); + + List selectReserveRecipe(@Param("applyDate") LocalDate applyDate, @Param("recipeId") Long recipeId); + + @Select({"select stall_id from menu_recipe ${ew.customSqlSegment}"}) + Long selectStallIdByWrappers(@Param("ew") Wrapper wrapper); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuAppRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuAppRecipeServiceImpl.java index 4450fd3..c9c1caf 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuAppRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/MenuAppRecipeServiceImpl.java @@ -121,14 +121,14 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService { @Override public List getReserveRecipeDetailList(AppletReserveRecipeDTO content) { this.generateRecipe(content.getRecipeId(), content.getApplyDate()); - List resultList = this.baseMapper.selectReserveRecipe(content.getApplyDate(), content.getRecipeId()); + List resultList = menuAppRecipeMapper.selectReserveRecipe(content.getApplyDate(), content.getRecipeId()); if (ObjectUtil.isEmpty(resultList)) { return resultList; } else { resultList.sort(Collections.reverseOrder((s1, s2) -> { return s2.getMealtimeType() - s1.getMealtimeType(); })); - Long stallId = this.baseMapper.selectStallIdByWrappers(Wrappers.lambdaQuery(MenuRecipe.class).eq(MenuRecipe::getRecipeId, content.getRecipeId()).eq(MenuRecipe::getDelFlag, DelFlagEnum.DEL_FALSE.key())); + Long stallId = menuAppRecipeMapper.selectStallIdByWrappers(Wrappers.lambdaQuery(MenuRecipe.class).eq(MenuRecipe::getRecipeId, content.getRecipeId()).eq(MenuRecipe::getDelFlag, DelFlagEnum.DEL_FALSE.key())); AllocStall allocStall = new AllocStall(); //TODO 查询档口 List mealTimeList = allocStall.getAllocStallMealtimeList(); @@ -147,9 +147,9 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService { log.info("未获取到餐次"); return Lists.newArrayList(); } else { - List finalMealTimeList = mealTimeList; + List finalMealTimeList = mealTimeList; resultList = resultList.stream().filter((time) -> { - return finalMealTimeList.stream().map(AllocMealtimeStateModel::getMealtimeType).collect(Collectors.toList()).contains(time.getMealtimeType()); + return finalMealTimeList.stream().map(AllocStallMealtime::getMealtimeType).collect(Collectors.toList()).contains(time.getMealtimeType()); }).collect(Collectors.toList()); resultList.forEach((time) -> { List typeList = time.getTypeList(); @@ -176,30 +176,6 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService { if (ObjectUtil.isEmpty(dishesIdSet)) { return resultList; } else { -// List dishNutritionParamList = this.menuDishesMapper.selectNutrition(dishesIdSet); -// HealthDishRecommendScoreVO dishesRecommendScore = this.nutritionApi.getDishesRecommendScore(content.getCustId(), dishNutritionParamList); -// if (dishesRecommendScore.getRecommendFlag()) { -// resultList.forEach((time) -> { -// List typeList = time.getTypeList(); -// if (ObjectUtil.isNotEmpty(typeList)) { -// typeList.forEach((type) -> { -// List dishesList = type.getDishesList(); -// if (ObjectUtil.isNotEmpty(dishesList)) { -// dishesList.forEach((dishes) -> { -// Integer initialScore = (Integer) dishesRecommendScore.getDishRecommendMap().get(((AppletCurrentDishesDetailVO) dishes.getDishesDetailList().get(0)).getDishesId()); -// if (ObjectUtil.isNotNull(initialScore)) { -// dishes.setInitialScore(initialScore); -// } -// -// }); -// } -// -// }); -// } -// -// }); -// } - Iterator var10 = resultList.iterator(); while (true) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml index 7e3d925..5eea4de 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuAppRecipeMapper.xml @@ -87,4 +87,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + \ No newline at end of file