test
This commit is contained in:
parent
92a0af2dbc
commit
9c9935b57e
|
|
@ -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("创建人")
|
||||
|
|
|
|||
|
|
@ -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<AppletReserveRecipeVO> selectReserveRecipe(@Param("applyDate") LocalDate applyDate, @Param("recipeId") Long recipeId);
|
||||
|
||||
@Select({"select stall_id from menu_recipe ${ew.customSqlSegment}"})
|
||||
Long selectStallIdByWrappers(@Param("ew") Wrapper<MenuRecipe> wrapper);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,14 +121,14 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService {
|
|||
@Override
|
||||
public List<AppletReserveRecipeVO> getReserveRecipeDetailList(AppletReserveRecipeDTO content) {
|
||||
this.generateRecipe(content.getRecipeId(), content.getApplyDate());
|
||||
List<AppletReserveRecipeVO> resultList = this.baseMapper.selectReserveRecipe(content.getApplyDate(), content.getRecipeId());
|
||||
List<AppletReserveRecipeVO> 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<AllocStallMealtime> mealTimeList = allocStall.getAllocStallMealtimeList();
|
||||
|
|
@ -147,9 +147,9 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService {
|
|||
log.info("未获取到餐次");
|
||||
return Lists.newArrayList();
|
||||
} else {
|
||||
List<AllocMealtimeStateModel> finalMealTimeList = mealTimeList;
|
||||
List<AllocStallMealtime> 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<AppletReserveRecipeTypeVO> typeList = time.getTypeList();
|
||||
|
|
@ -176,30 +176,6 @@ public class MenuAppRecipeServiceImpl implements IMenuAppRecipeService {
|
|||
if (ObjectUtil.isEmpty(dishesIdSet)) {
|
||||
return resultList;
|
||||
} else {
|
||||
// List<DishNutritionParam> dishNutritionParamList = this.menuDishesMapper.selectNutrition(dishesIdSet);
|
||||
// HealthDishRecommendScoreVO dishesRecommendScore = this.nutritionApi.getDishesRecommendScore(content.getCustId(), dishNutritionParamList);
|
||||
// if (dishesRecommendScore.getRecommendFlag()) {
|
||||
// resultList.forEach((time) -> {
|
||||
// List<AppletReserveRecipeTypeVO> typeList = time.getTypeList();
|
||||
// if (ObjectUtil.isNotEmpty(typeList)) {
|
||||
// typeList.forEach((type) -> {
|
||||
// List<AppletReserveRecipeDishesVO> 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) {
|
||||
|
|
|
|||
|
|
@ -87,4 +87,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 获取预定点餐菜谱 -->
|
||||
<select id="selectReserveRecipe" resultType="com.bonus.canteen.core.menu.vo.AppletReserveRecipeVO">
|
||||
select
|
||||
mrd.mealtime_type,
|
||||
-- if(md.meal_type = 2, 2, mdt.type_id) as type_id,
|
||||
-- if(md.meal_type = 2, '套餐', mdt.type_name) as type_name,
|
||||
mdb.base_dishes_id,
|
||||
md.dishes_id,
|
||||
mdb.dishes_name,
|
||||
md.dishes_name as real_dishes_name,
|
||||
md.meal_type as detail_type,
|
||||
md.image_url as dishes_img_url,
|
||||
mrd.detail_id,
|
||||
m.surplus_num,
|
||||
m.restrict_num,
|
||||
m.price as dishes_price,
|
||||
m.sale_price as pref_price,
|
||||
ac.canteen_id,
|
||||
ac.canteen_name,
|
||||
ass.stall_id,
|
||||
ass.stall_name,
|
||||
m.size_type,
|
||||
m.recommend_flag,
|
||||
md.size_json,
|
||||
mdsr.monthly_sales,
|
||||
mdsr.good_probability
|
||||
from
|
||||
menu_recipe_detail mrd
|
||||
inner join menu_recipe_dishes m on mrd.detail_id = m.detail_id
|
||||
inner join menu_dishes md on m.dishes_id = md.dishes_id
|
||||
inner join menu_dishes_type mdt on md.type_id = mdt.type_id
|
||||
inner join menu_recipe mr on mrd.recipe_id = mr.recipe_id
|
||||
inner join menu_app_recipe mar on mr.recipe_id = mar.recipe_id
|
||||
and mar.bind_type = 2
|
||||
left join menu_dishes_sale_record mdsr on md.dishes_id = mdsr.dishes_id
|
||||
and mr.stall_id = mdsr.stall_id
|
||||
and mdsr.sale_month = month(curdate())
|
||||
left join alloc_canteen ac on mr.canteen_id = ac.canteen_id
|
||||
left join alloc_stall ass on mr.stall_id = ass.stall_id
|
||||
left join menu_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
where
|
||||
mrd.apply_date = #{applyDate}
|
||||
and mr.recipe_id = #{recipeId}
|
||||
order by
|
||||
m.sort_num asc
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue