From e5776dd9106eb739787cc0f4c3a3f496a42c50f2 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 7 Jul 2025 18:10:01 +0800 Subject: [PATCH] =?UTF-8?q?i=E5=9B=BD=E7=BD=91=EF=BC=9A=E4=B8=80=E5=91=A8?= =?UTF-8?q?=E8=8F=9C=E8=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/zhhq/domain/WeekRecipeDetailVO.java | 9 ++++++--- .../core/zhhq/mapper/ZhhqCookRecipeMapper.java | 3 +++ .../service/impl/ZhhqCookRecipeServiceImpl.java | 6 ++++++ .../mapper/zhhq/ZhhqCookRecipeMapper.xml | 15 +++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDetailVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDetailVO.java index 0f27566..db084b7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDetailVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDetailVO.java @@ -22,6 +22,9 @@ public class WeekRecipeDetailVO { @ApiModelProperty(value = "餐次(早中晚)") private int mealType; + @ApiModelProperty(value = "菜品id") + private Long dishesId; + @ApiModelProperty(value = "菜品名称") private String cookName; @@ -65,7 +68,7 @@ public class WeekRecipeDetailVO { return FileUrlUtil.getFileUrl(this.imgUrl); } - public String getCookPic() { - return Base64Util.convertImgToBase64(this.getImgUrl()); - } +// public String getCookPic() { +// return Base64Util.convertImgToBase64(this.getImgUrl()); +// } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqCookRecipeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqCookRecipeMapper.java index 98b455b..55dce12 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqCookRecipeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqCookRecipeMapper.java @@ -1,6 +1,7 @@ package com.bonus.canteen.core.zhhq.mapper; import com.bonus.canteen.core.zhhq.domain.WeekRecipeDetailVO; +import com.bonus.canteen.core.zhhq.domain.WeekRecipeIngredientVO; import org.apache.ibatis.annotations.Param; import java.time.LocalDate; import java.util.List; @@ -16,4 +17,6 @@ public interface ZhhqCookRecipeMapper { public List selectWeekRecipeList(); public List selectWeekRecipeDetail(@Param("weekDates") List weekDates, @Param("recipeIds") List recipeIds); + + public List getCookMaterialById(Long dishesId); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/impl/ZhhqCookRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/impl/ZhhqCookRecipeServiceImpl.java index fb27def..be82131 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/impl/ZhhqCookRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/impl/ZhhqCookRecipeServiceImpl.java @@ -5,6 +5,7 @@ import com.bonus.canteen.core.basic.mapper.BasicCanteenMapper; import com.bonus.canteen.core.common.utils.DateUtil; import com.bonus.canteen.core.zhhq.domain.WeekRecipeDTO; import com.bonus.canteen.core.zhhq.domain.WeekRecipeDetailVO; +import com.bonus.canteen.core.zhhq.domain.WeekRecipeIngredientVO; import com.bonus.canteen.core.zhhq.domain.WeekRecipeVO; import com.bonus.canteen.core.zhhq.mapper.ZhhqCookRecipeMapper; import com.bonus.canteen.core.zhhq.service.IZhhqCookRecipeService; @@ -46,6 +47,11 @@ public class ZhhqCookRecipeServiceImpl implements IZhhqCookRecipeService { //查询一周菜谱详情 List recipeIds = zhhqCookRecipeMapper.selectWeekRecipeList(); List recipeDetails = zhhqCookRecipeMapper.selectWeekRecipeDetail(weekDates, recipeIds); + for (WeekRecipeDetailVO detailVO : recipeDetails) { + Long dishesId = detailVO.getDishesId(); + List cookMaterials = zhhqCookRecipeMapper.getCookMaterialById(dishesId); + detailVO.setIngredients(cookMaterials); + } //组装原料及营养信息 weekRecipeVO.setRecipeDetails(recipeDetails); return weekRecipeVO; diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqCookRecipeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqCookRecipeMapper.xml index 78f73e6..542d7bf 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqCookRecipeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqCookRecipeMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -72,5 +73,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by md.dishes_id asc + +