i国网-一周菜谱
This commit is contained in:
parent
496d8761cc
commit
111dcfa568
|
|
@ -0,0 +1,38 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
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 = "菜单日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate menuDate;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
@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<WeekRecipeIngredientVO> ingredients;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
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<WeekRecipeDetailVO> recipeDetails;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.bonus.canteen.core.zhhq.mapper;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.bonus.canteen.core.zhhq.service.impl;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.zhhq.domain.WeekRecipeDTO;
|
||||||
|
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 ZhhqCookRecipeMapper zhhqCookRecipeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WeekRecipeVO getWeekRecipeDetailList(WeekRecipeDTO dto) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.canteen.core.zhhq.mapper.ZhhqCookRecipeMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue