diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqCookRecipeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqCookRecipeController.java deleted file mode 100644 index 715a3bb..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/controller/ZhhqCookRecipeController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.bonus.canteen.core.zhhq.controller; - -import com.bonus.canteen.core.zhhq.domain.WeekRecipeDTO; -import com.bonus.canteen.core.zhhq.service.IZhhqCookRecipeService; -import com.bonus.common.core.web.controller.BaseController; -import com.bonus.common.core.web.domain.AjaxResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import javax.validation.Valid; - -/** - * 菜品计划信息Controller - * - * @author xsheng - * @date 2025-05-25 - */ -@Api(tags = "菜谱h5接口") -@RestController -@RequestMapping("/zhhq_cook_recipe") -@Slf4j -public class ZhhqCookRecipeController extends BaseController { - @Autowired - private IZhhqCookRecipeService zhhqCookRecipeService; - - @ApiOperation("获取一周菜谱详情") - @PostMapping({"/getWeekRecipe"}) - public AjaxResult getWeekRecipeDetailList(@RequestBody @Valid WeekRecipeDTO dto) { - try { - return AjaxResult.success(this.zhhqCookRecipeService.getWeekRecipeDetailList(dto)); - } catch (Exception e) { - log.error(e.toString(), e); - return AjaxResult.error(null); - } - } -} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDTO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDTO.java deleted file mode 100644 index 75c17fc..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.bonus.canteen.core.zhhq.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.time.LocalDate; - -@Data -public class WeekRecipeDTO { - @ApiModelProperty(value = "食堂id") - private Long canteenId; - - @ApiModelProperty(value = "菜单日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate menuDate; -} 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 deleted file mode 100644 index adfd6f3..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeDetailVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.bonus.canteen.core.zhhq.domain; - - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.util.Base64; -import java.util.List; - -@Data -public class WeekRecipeDetailVO { - @ApiModelProperty(value = "菜单日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate menuDate; - - private Long recipeId; - - @ApiModelProperty(value = "餐次(早中晚)") - private int mealType; - - @ApiModelProperty(value = "菜品名称") - private String cookName; - - @ApiModelProperty(value = "分类名称") - private String typeName; - - @ApiModelProperty(value = "是否新品, 1是 2否") - private int newType; - - @ApiModelProperty(value = "是否外卖, 1是 2否") - private int outType; - - @ApiModelProperty(value = "是否时令推荐, 1是 2否") - private int recommendType; - - @ApiModelProperty(value = "热量(千卡/100g)") - private BigDecimal calories; - - @ApiModelProperty(value = "蛋白质(g/100g)") - private BigDecimal protein; - - @ApiModelProperty(value = "脂肪(g/100g)") - private BigDecimal fat; - - @ApiModelProperty(value = "碳水化合物(g/100g)") - private BigDecimal carbohydrate; - - @ApiModelProperty(value = "菜肴单价") - private BigDecimal price; - - @ApiModelProperty(value = "图片") - private Base64 cookPic; - - @ApiModelProperty(value = "配料") - private List ingredients; - -} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeIngredientVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeIngredientVO.java deleted file mode 100644 index 5d55fdd..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeIngredientVO.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.bonus.canteen.core.zhhq.domain; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.math.BigDecimal; - -@Data -public class WeekRecipeIngredientVO { - @ApiModelProperty(value = "食材名称") - private String materialName; - - @ApiModelProperty(value = "食材重量") - private BigDecimal weight; - - @ApiModelProperty(value = "热量(千卡/100g)") - private BigDecimal calories; - - @ApiModelProperty(value = "蛋白质(g/100g)") - private BigDecimal protein; - - @ApiModelProperty(value = "脂肪(g/100g)") - private BigDecimal fat; - - @ApiModelProperty(value = "碳水化合物(g/100g)") - private BigDecimal carbohydrate; -} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeVO.java deleted file mode 100644 index 5ad6a8a..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/domain/WeekRecipeVO.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.bonus.canteen.core.zhhq.domain; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import java.time.LocalDate; -import java.util.List; - -@Data -public class WeekRecipeVO { - @ApiModelProperty(value = "菜谱名称") - private String recipeName; - - @ApiModelProperty(value = "菜谱年份") - private int recipeYear; - - @ApiModelProperty(value = "开始日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate startDate; - - @ApiModelProperty(value = "结束日期") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate endDate; - - @ApiModelProperty(value = "食堂名称") - private String canteenName; - - @ApiModelProperty(value = "菜谱详情") - private List recipeDetails; -} 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 deleted file mode 100644 index 98b455b..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/mapper/ZhhqCookRecipeMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.bonus.canteen.core.zhhq.mapper; - -import com.bonus.canteen.core.zhhq.domain.WeekRecipeDetailVO; -import org.apache.ibatis.annotations.Param; -import java.time.LocalDate; -import java.util.List; -import java.util.Set; - -/** - * 菜品计划信息Mapper接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface ZhhqCookRecipeMapper { - public List selectWeekRecipeList(); - - public List selectWeekRecipeDetail(@Param("weekDates") List weekDates, @Param("recipeIds") List recipeIds); -} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/IZhhqCookRecipeService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/IZhhqCookRecipeService.java deleted file mode 100644 index a84dc48..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/IZhhqCookRecipeService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.bonus.canteen.core.zhhq.service; - -import com.bonus.canteen.core.zhhq.domain.WeekRecipeDTO; -import com.bonus.canteen.core.zhhq.domain.WeekRecipeVO; -import java.time.LocalDate; -import java.util.List; - -/** - * 菜品计划信息Service接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface IZhhqCookRecipeService { - public WeekRecipeVO getWeekRecipeDetailList(WeekRecipeDTO dto); -} 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 deleted file mode 100644 index d1468dd..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/zhhq/service/impl/ZhhqCookRecipeServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.bonus.canteen.core.zhhq.service.impl; - -import com.bonus.canteen.core.basic.domain.BasicCanteen; -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.WeekRecipeVO; -import com.bonus.canteen.core.zhhq.mapper.ZhhqCookRecipeMapper; -import com.bonus.canteen.core.zhhq.service.IZhhqCookRecipeService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import java.time.LocalDate; -import java.time.LocalTime; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 菜品计划信息Service业务层处理 - * - * @author xsheng - * @date 2025-05-25 - */ -@Service -@Slf4j -public class ZhhqCookRecipeServiceImpl implements IZhhqCookRecipeService { - @Autowired - private BasicCanteenMapper basicCanteenMapper; - @Autowired - private ZhhqCookRecipeMapper zhhqCookRecipeMapper; - - @Override - public WeekRecipeVO getWeekRecipeDetailList(WeekRecipeDTO dto) { - WeekRecipeVO weekRecipeVO = new WeekRecipeVO(); - weekRecipeVO.setRecipeName("周菜谱"); - BasicCanteen basicCanteen = basicCanteenMapper.selectBasicCanteenByCanteenId(dto.getCanteenId()); - weekRecipeVO.setCanteenName(basicCanteen.getCanteenName()); - List weekDates = DateUtil.getWeekDates(dto.getMenuDate()); - weekRecipeVO.setRecipeYear(dto.getMenuDate().getYear()); - weekRecipeVO.setStartDate(weekDates.get(0)); - weekRecipeVO.setEndDate(weekDates.get(weekDates.lastIndexOf(weekDates))); - //查询一周菜谱详情 - List recipeIds = zhhqCookRecipeMapper.selectWeekRecipeList(); - List recipeDetails = zhhqCookRecipeMapper.selectWeekRecipeDetail(weekDates, recipeIds); - //组装原料及营养信息 - 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 deleted file mode 100644 index ef8a7e3..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/zhhq/ZhhqCookRecipeMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - -