diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookRecipeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookRecipeController.java index e733f88..6ac5c24 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookRecipeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/controller/CookRecipeController.java @@ -84,6 +84,13 @@ public class CookRecipeController extends BaseController { return success(list); } + @PostMapping({"/getRecipeDetail"}) + @ApiOperation("获取菜谱计划-菜谱详情") + public AjaxResult getRecipeDetail(@RequestBody CookRecipeDetailDTO dto) { + List list = cookRecipeService.getRecipeDetail(dto); + return success(list); + } + /** * 新增菜品计划信息 */ diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java index d550f75..47cf687 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java @@ -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 selectRecipeDetailList(@Param("recipeId") Long recipeId, @Param("applyDate") LocalDate applyDate); + List getRecipeDetail(@Param("params") CookRecipeDetailDTO dto); + /** * 新增菜品计划信息 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookRecipeService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookRecipeService.java index 00e097d..2cab815 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookRecipeService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/ICookRecipeService.java @@ -31,6 +31,8 @@ public interface ICookRecipeService { public List getRecipeDetailByDate(CookRecipeDetailDTO dto); + public List getRecipeDetail(CookRecipeDetailDTO dto); + /** * 新增菜品计划信息 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java index 6c46696..7fe8186 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java @@ -78,11 +78,15 @@ public class CookRecipeServiceImpl implements ICookRecipeService { @Override public List getRecipeDetailByDate(CookRecipeDetailDTO dto) { - //this.generateRecipe(dto.getRecipeId(), dto.getApplyDate()); List menuRecipeDetails = cookRecipeMapper.selectRecipeDetailList(dto.getRecipeId(), dto.getApplyDate()); return menuRecipeDetails.stream().sorted(Comparator.comparing(CookRecipeDetailVO::getMealtimeType)).collect(Collectors.toList()); } + @Override + public List getRecipeDetail(CookRecipeDetailDTO dto) { + return cookRecipeMapper.getRecipeDetail(dto); + } + /** * 新增菜品计划信息 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml index 9112238..1ae33f9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml @@ -88,6 +88,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and crd.apply_date = #{applyDate} order by crdd.dishes_id + +