获取菜谱计划-菜谱详情
This commit is contained in:
parent
ace01ae9fd
commit
9acc81b51f
|
|
@ -84,6 +84,13 @@ public class CookRecipeController extends BaseController {
|
|||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping({"/getRecipeDetail"})
|
||||
@ApiOperation("获取菜谱计划-菜谱详情")
|
||||
public AjaxResult getRecipeDetail(@RequestBody CookRecipeDetailDTO dto) {
|
||||
List<CookRecipeDetailVO> list = cookRecipeService.getRecipeDetail(dto);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜品计划信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.time.LocalDate;
|
|||
import java.util.List;
|
||||
import com.bonus.canteen.core.cook.domain.CookRecipe;
|
||||
import com.bonus.canteen.core.cook.dto.CookRecipeDTO;
|
||||
import com.bonus.canteen.core.cook.dto.CookRecipeDetailDTO;
|
||||
import com.bonus.canteen.core.cook.vo.CookRecipeDetailVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -38,6 +39,8 @@ public interface CookRecipeMapper {
|
|||
|
||||
List<CookRecipeDetailVO> selectRecipeDetailList(@Param("recipeId") Long recipeId, @Param("applyDate") LocalDate applyDate);
|
||||
|
||||
List<CookRecipeDetailVO> getRecipeDetail(@Param("params") CookRecipeDetailDTO dto);
|
||||
|
||||
/**
|
||||
* 新增菜品计划信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public interface ICookRecipeService {
|
|||
|
||||
public List<CookRecipeDetailVO> getRecipeDetailByDate(CookRecipeDetailDTO dto);
|
||||
|
||||
public List<CookRecipeDetailVO> getRecipeDetail(CookRecipeDetailDTO dto);
|
||||
|
||||
/**
|
||||
* 新增菜品计划信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -78,11 +78,15 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
|
||||
@Override
|
||||
public List<CookRecipeDetailVO> getRecipeDetailByDate(CookRecipeDetailDTO dto) {
|
||||
//this.generateRecipe(dto.getRecipeId(), dto.getApplyDate());
|
||||
List<CookRecipeDetailVO> menuRecipeDetails = cookRecipeMapper.selectRecipeDetailList(dto.getRecipeId(), dto.getApplyDate());
|
||||
return menuRecipeDetails.stream().sorted(Comparator.comparing(CookRecipeDetailVO::getMealtimeType)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CookRecipeDetailVO> getRecipeDetail(CookRecipeDetailDTO dto) {
|
||||
return cookRecipeMapper.getRecipeDetail(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜品计划信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -89,6 +89,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by crdd.dishes_id
|
||||
</select>
|
||||
|
||||
<select id="getRecipeDetail" resultType="com.bonus.canteen.core.cook.vo.CookRecipeDetailVO">
|
||||
select DISTINCT
|
||||
mrd.mealtime_type,
|
||||
mrd.recipe_detail_id,
|
||||
mdb.base_dishes_id ,
|
||||
md.dishes_id,
|
||||
mdb.dishes_name,
|
||||
mrdd.id,
|
||||
mrdd.price,
|
||||
mrdd.size_type,
|
||||
mrdd.supply_num,
|
||||
mrdd.sale_num,
|
||||
mrdd.remanent_num,
|
||||
mrdd.limit_num,
|
||||
mrdd.sale_price,
|
||||
mrdd.recommend_flag,
|
||||
ac.canteen_name,
|
||||
md.sales_mode,
|
||||
md.unit_price,
|
||||
md.meal_type,
|
||||
md.type_id,
|
||||
mdt.dishes_type_name,
|
||||
md.material_cost
|
||||
from cook_recipe_detail mrd
|
||||
left join cook_recipe_dishes mrdd on mrd.recipe_detail_id = mrdd.recipe_detail_id
|
||||
left join cook_dishes md on mrdd.dishes_id = md.dishes_id
|
||||
left join basic_canteen ac on md.canteen_id = ac.canteen_id
|
||||
left join cook_dishes_base mdb on md.base_dishes_id = mdb.base_dishes_id
|
||||
left join cook_dishes_type mdt on md.type_id = mdt.dishes_type_id
|
||||
where mrd.recipe_id = #{params.recipeId}
|
||||
<if test="params.applyWeek !=null and params.applyWeek != ''">
|
||||
and mrd.apply_week = #{params.applyWeek}
|
||||
</if>
|
||||
and mrd.detail_type = 1
|
||||
order by mrdd.dishes_id
|
||||
</select>
|
||||
|
||||
<select id="selectCookRecipeByRecipeId" parameterType="Long" resultMap="CookRecipeResult">
|
||||
<include refid="selectCookRecipeVo"/>
|
||||
where cr.recipe_id = #{recipeId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue