From 9acc81b51f3962f11ee366cd9f557d270370b5c1 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 28 May 2025 15:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=8F=9C=E8=B0=B1=E8=AE=A1?= =?UTF-8?q?=E5=88=92-=E8=8F=9C=E8=B0=B1=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cook/controller/CookRecipeController.java | 7 ++++ .../core/cook/mapper/CookRecipeMapper.java | 3 ++ .../core/cook/service/ICookRecipeService.java | 2 + .../service/impl/CookRecipeServiceImpl.java | 6 ++- .../mapper/cook/CookRecipeMapper.xml | 37 +++++++++++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) 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 + +