菜谱详情
This commit is contained in:
parent
2190167436
commit
dd29e8c6f5
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.core.menu.constant;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class BigDecimalSerializer extends JsonSerializer<BigDecimal> {
|
||||
public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||
if (value != null) {
|
||||
BigDecimal number = value.setScale(2, RoundingMode.HALF_UP);
|
||||
gen.writeNumber(number);
|
||||
} else {
|
||||
gen.writeNumber(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.core.menu.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppletDishesDetailDTO implements Serializable {
|
||||
@ApiModelProperty("菜谱详情id")
|
||||
private Long detailId;
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long baseDishesId;
|
||||
@ApiModelProperty("是否删除(1删除,2未删除)")
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getDetailId() {
|
||||
return this.detailId;
|
||||
}
|
||||
|
||||
public Long getBaseDishesId() {
|
||||
return this.baseDishesId;
|
||||
}
|
||||
|
||||
public Integer getDelFlag() {
|
||||
return this.delFlag;
|
||||
}
|
||||
|
||||
public void setDetailId(final Long detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public void setBaseDishesId(final Long baseDishesId) {
|
||||
this.baseDishesId = baseDishesId;
|
||||
}
|
||||
|
||||
public void setDelFlag(final Integer delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.bonus.core.menu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("菜品食材关联")
|
||||
@TableName("menu_material_dishes")
|
||||
public class MenuMaterialDishes extends Model<MenuMaterialDishes> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long dishesId;
|
||||
@ApiModelProperty("食材id")
|
||||
private Long materialId;
|
||||
@ApiModelProperty("食材重量(g)")
|
||||
private Double weight;
|
||||
@ApiModelProperty("材料类型(1主料,2辅料,3配料)")
|
||||
private Integer materialType;
|
||||
@ApiModelProperty("删除标识")
|
||||
private Integer delFlag;
|
||||
@ApiModelProperty("乐观锁")
|
||||
private Integer revision;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getDishesId() {
|
||||
return this.dishesId;
|
||||
}
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Integer getMaterialType() {
|
||||
return this.materialType;
|
||||
}
|
||||
|
||||
public Integer getDelFlag() {
|
||||
return this.delFlag;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setDishesId(final Long dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public void setMaterialId(final Long materialId) {
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setMaterialType(final Integer materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public void setDelFlag(final Integer delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public void setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.bonus.core.menu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ApiModel("套餐菜品关联")
|
||||
@TableName("menu_package_dishes")
|
||||
public class MenuPackageDishes extends Model<MenuPackageDishes> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId
|
||||
@ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long dishesId;
|
||||
@ApiModelProperty("套餐id")
|
||||
private Long packageId;
|
||||
@ApiModelProperty("菜品占比(0.35)")
|
||||
private BigDecimal proportion;
|
||||
@ApiModelProperty("乐观锁")
|
||||
private Integer revision;
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public Long getDishesId() {
|
||||
return this.dishesId;
|
||||
}
|
||||
|
||||
public Long getPackageId() {
|
||||
return this.packageId;
|
||||
}
|
||||
|
||||
public BigDecimal getProportion() {
|
||||
return this.proportion;
|
||||
}
|
||||
|
||||
public Integer getRevision() {
|
||||
return this.revision;
|
||||
}
|
||||
|
||||
public String getCrby() {
|
||||
return this.crby;
|
||||
}
|
||||
|
||||
public LocalDateTime getCrtime() {
|
||||
return this.crtime;
|
||||
}
|
||||
|
||||
public String getUpby() {
|
||||
return this.upby;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setDishesId(final Long dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public void setPackageId(final Long packageId) {
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public void setProportion(final BigDecimal proportion) {
|
||||
this.proportion = proportion;
|
||||
}
|
||||
|
||||
public void setRevision(final Integer revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public void setCrby(final String crby) {
|
||||
this.crby = crby;
|
||||
}
|
||||
|
||||
public void setCrtime(final LocalDateTime crtime) {
|
||||
this.crtime = crtime;
|
||||
}
|
||||
|
||||
public void setUpby(final String upby) {
|
||||
this.upby = upby;
|
||||
}
|
||||
|
||||
public void setUptime(final LocalDateTime uptime) {
|
||||
this.uptime = uptime;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@ package com.bonus.core.menu.mapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.core.menu.dto.AppletDishesDetailDTO;
|
||||
import com.bonus.core.menu.entity.MenuDishes;
|
||||
import com.bonus.core.menu.model.MenuDishesTypeModel;
|
||||
import com.bonus.core.menu.vo.AppletDishesDetailVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
|
@ -24,8 +26,8 @@ public interface MenuDishesMapper extends BaseMapper<MenuDishes> {
|
|||
//
|
||||
// List<MenuPackageDishesPageVO> selectListByPackageId(@Param("packageId") Long packageId);
|
||||
//
|
||||
// AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dishesDetailDTO);
|
||||
//
|
||||
AppletDishesDetailVO selectDishesDetailByDishesId(AppletDishesDetailDTO dishesDetailDTO);
|
||||
|
||||
// List<IndexDishesListVO> selectIndexRecommendDishesList(MenuDishes dishes);
|
||||
//
|
||||
// @Select({"select dishes_id from menu_dishes ${ew.customSqlSegment}"})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.core.menu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.menu.entity.MenuMaterialDishes;
|
||||
import com.bonus.core.menu.vo.MenuMaterialBasVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MenuMaterialDishesMapper extends BaseMapper<MenuMaterialDishes> {
|
||||
// int insertBatch(@Param("materialList") List<MenuMaterialDishes> materialList);
|
||||
//
|
||||
// List<DishDetails> getDishDetails(Long dishes);
|
||||
|
||||
List<MenuMaterialBasVO> getMenuMaterialById(Long dishesId);
|
||||
|
||||
// List<MenuUpdateDishesModel> selectDishesList(@Param("materialIdList") List<Long> materialIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.core.menu.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.core.menu.entity.MenuPackageDishes;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MenuPackageDishesMapper extends BaseMapper<MenuPackageDishes> {
|
||||
// int insertBatch(@Param("packageDishesList") List<MenuPackageDishes> packageDishesList);
|
||||
//
|
||||
// @Select({"select 1 from menu_package_dishes ${ew.customSqlSegment}"})
|
||||
// Integer selectExistByWrapper(@Param("ew") Wrapper<MenuPackageDishes> wrapper);
|
||||
|
||||
@Select({"select md.dishes_name from menu_package_dishes mpd left join menu_dishes md on mpd.dishes_id = md.dishes_id where mpd.del_flag = 2 and mpd.package_id = #{dishesId}"})
|
||||
List<String> selectDishesName(@Param("dishesId") Long dishesId);
|
||||
|
||||
// List<MenuAppPackageDishesPageVO> selectPackageDishes(@Param("dishesId") Long dishesId);
|
||||
}
|
||||
|
|
@ -3,121 +3,12 @@ package com.bonus.core.menu.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.core.menu.entity.MenuDishes;
|
||||
import com.bonus.core.menu.utils.NutritionEntity;
|
||||
import com.bonus.core.menu.vo.AppletDishesDetailVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface MenuDishesService extends IService<MenuDishes> {
|
||||
// Long addMenuDishes(MenuDishesAddDTO dishesAddDTO, Integer customId);
|
||||
//
|
||||
// Page<MenuDishesPageVO> getMenuDishesPage(String content);
|
||||
//
|
||||
// void editMenuDishes(MenuDishesEditDTO dishesEditDTO);
|
||||
//
|
||||
// void removeByDishesId(Long dishesId);
|
||||
//
|
||||
// void removeBatchByDishesId(List<Long> content);
|
||||
//
|
||||
// AppletDishesDetailVO getDishesDetailByDishesId(String content, Long custId);
|
||||
//
|
||||
// void deployIndexRecommend(IndexRecommendDishesDTO content);
|
||||
//
|
||||
// List<IndexDishesListVO> getIndexRecommendDishesList(IndexDishesListDTO content);
|
||||
//
|
||||
// void addMenuDishesLikeSurvey(List<Long> content);
|
||||
//
|
||||
// List<Long> getMenuDishesLikeSurvey();
|
||||
//
|
||||
// void emptyMenuDishesLikeSurvey();
|
||||
//
|
||||
// List<MenuDishesLikeRankingVO> getMenuDishesLikeRanking();
|
||||
//
|
||||
// List<MenuDishesLikeVO> getMenuDishesLikeList(Long custId);
|
||||
//
|
||||
// void saveMenuDishesLikeSurvey(Long custId, List<MenuDishesLikeSaveDTO> content);
|
||||
//
|
||||
// List<MenuBasicsDishesVO> getAllDishesBasicsInfo();
|
||||
//
|
||||
// MenuDishesLableVO getDishesLabelByCustomId(Integer customId);
|
||||
//
|
||||
// Double getDishesWeightDeviation(Integer customId);
|
||||
//
|
||||
// List<AndroidDishesDetailByDateVO> getDishesDetailByDate(AndroidDishesDetailByDateDTO content);
|
||||
//
|
||||
// void addDishesEvalua(List<AndroidDishesEvaluaAddDTO> content);
|
||||
//
|
||||
// void batchImportDishes(MultipartFile excel);
|
||||
//
|
||||
// void importDishes(List<MenuDishesImportDTO> importDishesList);
|
||||
//
|
||||
// void importDishesFailSave(List<MenuDishesImportFail> dishesImportFailList);
|
||||
//
|
||||
// void menuDishesInit();
|
||||
//
|
||||
// void importDishesImgBatch();
|
||||
//
|
||||
// Page<MenuDishesV2PageVO> getMenuDishesV2Page(MenuDishesV2PageDTO content);
|
||||
//
|
||||
// MenuDishesDetailVO getMenuDishesDetail(Long dishesId);
|
||||
//
|
||||
// AddDishesVo addMenuDishesV2(MenuDishesV2AddDTO content);
|
||||
//
|
||||
// void editMenuDishesV2(MenuDishesV2EditDTO content);
|
||||
//
|
||||
// void removeByDishesIdV2(Long dishesId);
|
||||
//
|
||||
// List<MenuAllTypeDishesVO> getTypeDishesList(MenuTypeDishesDTO content);
|
||||
//
|
||||
// PageVO<MenuAllTypeDishesVO> getTypeDishesListByPage(MenuTypeDishesDTO content);
|
||||
//
|
||||
// MenuDishesByCustomIdVO getMenuDishesDetailByCustomId(MenuDishesByCustomIdDTO menuDishesByCustomIdDTO);
|
||||
//
|
||||
// Integer menuRecipeCount(Integer mealtimeType, Long dishesId, LocalDate nowDate);
|
||||
//
|
||||
// List<MenuDishes> getByNames(Set<String> dishesNames);
|
||||
//
|
||||
// Long thirdSaveDishes(DishSyncDTO dishSyncDTO);
|
||||
//
|
||||
// DishSyncDTO getDishesByInventoryId(String inventoryId);
|
||||
//
|
||||
// void copyMenuDishes(MenuDishesCopyDTO content);
|
||||
//
|
||||
// String getDifCanteenManage();
|
||||
//
|
||||
// void editDifCanteenManage(MenuDifCanteenManageEditDTO content);
|
||||
//
|
||||
// Boolean newImportDishes(List<MenuDishesImportDTO> content);
|
||||
//
|
||||
// DishesImportCheckResult importDishesCheck(MultipartFile excel);
|
||||
//
|
||||
// Integer getDishesMaterialCost(List<MenuMaterialCostDTO> content);
|
||||
//
|
||||
// void autoUpdateDishesMaterialCost();
|
||||
//
|
||||
// List<MenuDishesExportVO> exportMenuDishes(MenuDishesExportDTO content);
|
||||
//
|
||||
// void updateDishesNutrition(List<Long> materialId);
|
||||
//
|
||||
// Map<Long, List<String>> selectDishesLabelByDishesIds(List<Long> dishesIds);
|
||||
//
|
||||
// Map<String, List<String>> selectMaterialByTypeAndDishesIds(List<Long> dishesIds);
|
||||
//
|
||||
AppletDishesDetailVO getDishesDetailByDishesId(String content, Long custId);
|
||||
|
||||
NutritionEntity getNutrientInfo(Map<Long, Double> dishesQuantityMap);
|
||||
//
|
||||
// List<MenuDishes> getMenuDishesList(List<Long> dishesIdList);
|
||||
//
|
||||
// List<NutritionGetDishesVo> nutritionGetDishes(NutritionGetDishesDto nutritionGetDishesDto);
|
||||
//
|
||||
// void updateDishesNutritionByNutritionId(Long nutritionId);
|
||||
//
|
||||
// Boolean uploadBatchDishes(MultipartFile[] files);
|
||||
//
|
||||
// void openLimitCustomId();
|
||||
//
|
||||
// void closeLimitCustomId();
|
||||
//
|
||||
// void replaceMaterialDishes(ReplaceMaterialDto content);
|
||||
//
|
||||
// List<DishesNutritionDto> getDishesNutrition(List<Long> dishesIdList);
|
||||
//
|
||||
// Map<Long, List<String>> selectDishesTasteByDishesIds(List<Long> dishesIds);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,129 @@
|
|||
package com.bonus.core.menu.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.bonus.core.common.utils.SysUtil;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("小程序菜品详情")
|
||||
public class AppletDishesDetailVO {
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long baseDishesId;
|
||||
@ApiModelProperty("类型(1-菜品,2-套餐)")
|
||||
private Integer mealType;
|
||||
@ApiModelProperty("自定义id")
|
||||
private Long customId;
|
||||
@ApiModelProperty("菜品名称")
|
||||
private String dishesName;
|
||||
@ApiModelProperty("菜品别称")
|
||||
private String aliasName;
|
||||
@ApiModelProperty("菜品图片url")
|
||||
private String imageUrl;
|
||||
@ApiModelProperty("菜品简介")
|
||||
private String intro;
|
||||
@ApiModelProperty("菜品详情")
|
||||
private String particulars;
|
||||
@ApiModelProperty("是否收藏(1-收藏,2-未收藏)")
|
||||
private Integer isFavorites;
|
||||
@ApiModelProperty("菜品规格")
|
||||
private List<AppletDishesSizeV2VO> dishesDetailList;
|
||||
List<MenuMaterialBasVO> materialList;
|
||||
@ApiModelProperty("套餐菜品明细")
|
||||
private List<String> packageDishesList;
|
||||
|
||||
public String getImageUrl() {
|
||||
return SysUtil.getCutFileUrl(this.imageUrl);
|
||||
}
|
||||
|
||||
public Long getBaseDishesId() {
|
||||
return this.baseDishesId;
|
||||
}
|
||||
|
||||
public Integer getMealType() {
|
||||
return this.mealType;
|
||||
}
|
||||
|
||||
public Long getCustomId() {
|
||||
return this.customId;
|
||||
}
|
||||
|
||||
public String getDishesName() {
|
||||
return this.dishesName;
|
||||
}
|
||||
|
||||
public String getAliasName() {
|
||||
return this.aliasName;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return this.intro;
|
||||
}
|
||||
|
||||
public String getParticulars() {
|
||||
return this.particulars;
|
||||
}
|
||||
|
||||
public Integer getIsFavorites() {
|
||||
return this.isFavorites;
|
||||
}
|
||||
|
||||
public List<AppletDishesSizeV2VO> getDishesDetailList() {
|
||||
return this.dishesDetailList;
|
||||
}
|
||||
|
||||
public List<MenuMaterialBasVO> getMaterialList() {
|
||||
return this.materialList;
|
||||
}
|
||||
|
||||
public List<String> getPackageDishesList() {
|
||||
return this.packageDishesList;
|
||||
}
|
||||
|
||||
public void setBaseDishesId(final Long baseDishesId) {
|
||||
this.baseDishesId = baseDishesId;
|
||||
}
|
||||
|
||||
public void setMealType(final Integer mealType) {
|
||||
this.mealType = mealType;
|
||||
}
|
||||
|
||||
public void setCustomId(final Long customId) {
|
||||
this.customId = customId;
|
||||
}
|
||||
|
||||
public void setDishesName(final String dishesName) {
|
||||
this.dishesName = dishesName;
|
||||
}
|
||||
|
||||
public void setAliasName(final String aliasName) {
|
||||
this.aliasName = aliasName;
|
||||
}
|
||||
|
||||
public void setImageUrl(final String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public void setIntro(final String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
public void setParticulars(final String particulars) {
|
||||
this.particulars = particulars;
|
||||
}
|
||||
|
||||
public void setIsFavorites(final Integer isFavorites) {
|
||||
this.isFavorites = isFavorites;
|
||||
}
|
||||
|
||||
public void setDishesDetailList(final List<AppletDishesSizeV2VO> dishesDetailList) {
|
||||
this.dishesDetailList = dishesDetailList;
|
||||
}
|
||||
|
||||
public void setMaterialList(final List<MenuMaterialBasVO> materialList) {
|
||||
this.materialList = materialList;
|
||||
}
|
||||
|
||||
public void setPackageDishesList(final List<String> packageDishesList) {
|
||||
this.packageDishesList = packageDishesList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
package com.bonus.core.menu.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.bonus.core.menu.constant.BigDecimalSerializer;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Optional;
|
||||
|
||||
@ApiModel("菜品详情(大小份)")
|
||||
public class AppletDishesSizeV2VO {
|
||||
@ApiModelProperty("菜品id")
|
||||
private Long dishesId;
|
||||
@ApiModelProperty("菜品名称")
|
||||
private String dishesName;
|
||||
@ApiModelProperty("库存数量")
|
||||
private Integer surplusNum;
|
||||
@ApiModelProperty("限购数量")
|
||||
private Integer restrictNum;
|
||||
@ApiModelProperty("菜品价格")
|
||||
private Integer dishesPrice;
|
||||
@ApiModelProperty("优惠价")
|
||||
private Integer prefPrice;
|
||||
@ApiModelProperty("规格类型(1-标准,2-大份,3-小份,4-50g,5-100g)")
|
||||
private Long sizeType;
|
||||
@ApiModelProperty("菜品规格")
|
||||
private String sizeJson;
|
||||
@ApiModelProperty("月销量")
|
||||
private Integer monthlySales;
|
||||
@ApiModelProperty("好评率")
|
||||
private BigDecimal goodProbability;
|
||||
@ApiModelProperty("热量(千卡/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal calories;
|
||||
@ApiModelProperty("蛋白质(g/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal protein;
|
||||
@ApiModelProperty("脂肪(g/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal fat;
|
||||
@ApiModelProperty("碳水化合物(g/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal carbohydrate;
|
||||
@ApiModelProperty("膳食纤维(g/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal dietaryFiber;
|
||||
@ApiModelProperty("胆固醇(mg/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal cholesterol;
|
||||
@ApiModelProperty("钙(mg/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal calcium;
|
||||
@ApiModelProperty("钠(mg/100g)")
|
||||
@JsonSerialize(
|
||||
using = BigDecimalSerializer.class
|
||||
)
|
||||
private BigDecimal sodium;
|
||||
@ApiModelProperty("热量NRV(千卡/100g)")
|
||||
private BigDecimal caloriesNrv;
|
||||
@ApiModelProperty("蛋白质NRV(g/100g)")
|
||||
private BigDecimal proteinNrv;
|
||||
@ApiModelProperty("脂肪NRV(g/100g)")
|
||||
private BigDecimal fatNrv;
|
||||
@ApiModelProperty("碳水化合物NRV(g/100g)")
|
||||
private BigDecimal carbohydrateNrv;
|
||||
@ApiModelProperty("膳食纤维NRV(g/100g)")
|
||||
private BigDecimal dietaryFiberNrv;
|
||||
@ApiModelProperty("胆固醇NRV(mg/100g)")
|
||||
private BigDecimal cholesterolNrv;
|
||||
@ApiModelProperty("钙NRV(mg/100g)")
|
||||
private BigDecimal calciumNrv;
|
||||
@ApiModelProperty("钠NRV(mg/100g)")
|
||||
private BigDecimal sodiumNrv;
|
||||
|
||||
public Integer getMonthlySales() {
|
||||
return (Integer)Optional.ofNullable(this.monthlySales).orElse(0);
|
||||
}
|
||||
|
||||
public BigDecimal getGoodProbability() {
|
||||
return (BigDecimal)Optional.ofNullable(this.goodProbability).orElse(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
public Long getSizeType() {
|
||||
return (Long)Optional.ofNullable(this.sizeType).orElse(1L);
|
||||
}
|
||||
|
||||
public BigDecimal getCaloriesNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.calories).orElse(BigDecimal.ZERO)).multiply(new BigDecimal("4.185")).divide(new BigDecimal("8400"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getProteinNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.protein).orElse(BigDecimal.ZERO)).divide(new BigDecimal("60"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getFatNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.fat).orElse(BigDecimal.ZERO)).divide(new BigDecimal("60"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getCarbohydrateNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.carbohydrate).orElse(BigDecimal.ZERO)).divide(new BigDecimal("300"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getDietaryFiberNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.dietaryFiber).orElse(BigDecimal.ZERO)).divide(new BigDecimal("25"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getCholesterolNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.cholesterol).orElse(BigDecimal.ZERO)).divide(new BigDecimal("300"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getCalciumNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.calcium).orElse(BigDecimal.ZERO)).divide(new BigDecimal("800"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public BigDecimal getSodiumNrv() {
|
||||
return ((BigDecimal)Optional.ofNullable(this.sodium).orElse(BigDecimal.ZERO)).divide(new BigDecimal("2000"), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
public Long getDishesId() {
|
||||
return this.dishesId;
|
||||
}
|
||||
|
||||
public String getDishesName() {
|
||||
return this.dishesName;
|
||||
}
|
||||
|
||||
public Integer getSurplusNum() {
|
||||
return this.surplusNum;
|
||||
}
|
||||
|
||||
public Integer getRestrictNum() {
|
||||
return this.restrictNum;
|
||||
}
|
||||
|
||||
public Integer getDishesPrice() {
|
||||
return this.dishesPrice;
|
||||
}
|
||||
|
||||
public Integer getPrefPrice() {
|
||||
return this.prefPrice;
|
||||
}
|
||||
|
||||
public String getSizeJson() {
|
||||
return this.sizeJson;
|
||||
}
|
||||
|
||||
public BigDecimal getCalories() {
|
||||
return this.calories;
|
||||
}
|
||||
|
||||
public BigDecimal getProtein() {
|
||||
return this.protein;
|
||||
}
|
||||
|
||||
public BigDecimal getFat() {
|
||||
return this.fat;
|
||||
}
|
||||
|
||||
public BigDecimal getCarbohydrate() {
|
||||
return this.carbohydrate;
|
||||
}
|
||||
|
||||
public BigDecimal getDietaryFiber() {
|
||||
return this.dietaryFiber;
|
||||
}
|
||||
|
||||
public BigDecimal getCholesterol() {
|
||||
return this.cholesterol;
|
||||
}
|
||||
|
||||
public BigDecimal getCalcium() {
|
||||
return this.calcium;
|
||||
}
|
||||
|
||||
public BigDecimal getSodium() {
|
||||
return this.sodium;
|
||||
}
|
||||
|
||||
public void setDishesId(final Long dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public void setDishesName(final String dishesName) {
|
||||
this.dishesName = dishesName;
|
||||
}
|
||||
|
||||
public void setSurplusNum(final Integer surplusNum) {
|
||||
this.surplusNum = surplusNum;
|
||||
}
|
||||
|
||||
public void setRestrictNum(final Integer restrictNum) {
|
||||
this.restrictNum = restrictNum;
|
||||
}
|
||||
|
||||
public void setDishesPrice(final Integer dishesPrice) {
|
||||
this.dishesPrice = dishesPrice;
|
||||
}
|
||||
|
||||
public void setPrefPrice(final Integer prefPrice) {
|
||||
this.prefPrice = prefPrice;
|
||||
}
|
||||
|
||||
public void setSizeType(final Long sizeType) {
|
||||
this.sizeType = sizeType;
|
||||
}
|
||||
|
||||
public void setSizeJson(final String sizeJson) {
|
||||
this.sizeJson = sizeJson;
|
||||
}
|
||||
|
||||
public void setMonthlySales(final Integer monthlySales) {
|
||||
this.monthlySales = monthlySales;
|
||||
}
|
||||
|
||||
public void setGoodProbability(final BigDecimal goodProbability) {
|
||||
this.goodProbability = goodProbability;
|
||||
}
|
||||
|
||||
public void setCalories(final BigDecimal calories) {
|
||||
this.calories = calories;
|
||||
}
|
||||
|
||||
public void setProtein(final BigDecimal protein) {
|
||||
this.protein = protein;
|
||||
}
|
||||
|
||||
public void setFat(final BigDecimal fat) {
|
||||
this.fat = fat;
|
||||
}
|
||||
|
||||
public void setCarbohydrate(final BigDecimal carbohydrate) {
|
||||
this.carbohydrate = carbohydrate;
|
||||
}
|
||||
|
||||
public void setDietaryFiber(final BigDecimal dietaryFiber) {
|
||||
this.dietaryFiber = dietaryFiber;
|
||||
}
|
||||
|
||||
public void setCholesterol(final BigDecimal cholesterol) {
|
||||
this.cholesterol = cholesterol;
|
||||
}
|
||||
|
||||
public void setCalcium(final BigDecimal calcium) {
|
||||
this.calcium = calcium;
|
||||
}
|
||||
|
||||
public void setSodium(final BigDecimal sodium) {
|
||||
this.sodium = sodium;
|
||||
}
|
||||
|
||||
public void setCaloriesNrv(final BigDecimal caloriesNrv) {
|
||||
this.caloriesNrv = caloriesNrv;
|
||||
}
|
||||
|
||||
public void setProteinNrv(final BigDecimal proteinNrv) {
|
||||
this.proteinNrv = proteinNrv;
|
||||
}
|
||||
|
||||
public void setFatNrv(final BigDecimal fatNrv) {
|
||||
this.fatNrv = fatNrv;
|
||||
}
|
||||
|
||||
public void setCarbohydrateNrv(final BigDecimal carbohydrateNrv) {
|
||||
this.carbohydrateNrv = carbohydrateNrv;
|
||||
}
|
||||
|
||||
public void setDietaryFiberNrv(final BigDecimal dietaryFiberNrv) {
|
||||
this.dietaryFiberNrv = dietaryFiberNrv;
|
||||
}
|
||||
|
||||
public void setCholesterolNrv(final BigDecimal cholesterolNrv) {
|
||||
this.cholesterolNrv = cholesterolNrv;
|
||||
}
|
||||
|
||||
public void setCalciumNrv(final BigDecimal calciumNrv) {
|
||||
this.calciumNrv = calciumNrv;
|
||||
}
|
||||
|
||||
public void setSodiumNrv(final BigDecimal sodiumNrv) {
|
||||
this.sodiumNrv = sodiumNrv;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.bonus.core.menu.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.bonus.core.common.utils.SysUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel("菜品标签分页返回")
|
||||
public class MenuMaterialBasVO implements Serializable {
|
||||
@ApiModelProperty("食材id")
|
||||
private Long materialId;
|
||||
@ApiModelProperty("食材名称")
|
||||
private String materialName;
|
||||
@ApiModelProperty("原料编号")
|
||||
private String materialCode;
|
||||
@ApiModelProperty("食材重量(g)")
|
||||
private Double weight;
|
||||
@ApiModelProperty("材料类型(1主料,2辅料,3配料)")
|
||||
private Integer materialType;
|
||||
@ApiModelProperty("大类")
|
||||
private String bigType;
|
||||
@ApiModelProperty("小类")
|
||||
private String littleType;
|
||||
@ApiModelProperty("原料图片")
|
||||
private String imageUrl;
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = SysUtil.getCutPath(imageUrl);
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return SysUtil.getCutFileUrl(this.imageUrl);
|
||||
}
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return this.materialName;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return this.materialCode;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Integer getMaterialType() {
|
||||
return this.materialType;
|
||||
}
|
||||
|
||||
public String getBigType() {
|
||||
return this.bigType;
|
||||
}
|
||||
|
||||
public String getLittleType() {
|
||||
return this.littleType;
|
||||
}
|
||||
|
||||
public void setMaterialId(final Long materialId) {
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public void setMaterialName(final String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public void setMaterialCode(final String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setMaterialType(final Integer materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public void setBigType(final String bigType) {
|
||||
this.bigType = bigType;
|
||||
}
|
||||
|
||||
public void setLittleType(final String littleType) {
|
||||
this.littleType = littleType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.core.menu.mapper.MenuMaterialDishesMapper">
|
||||
|
||||
<!-- 批量插入数据 -->
|
||||
<!-- <insert id="insertBatch" parameterType="List">-->
|
||||
<!-- insert into-->
|
||||
<!-- menu_material_dishes (dishes_id, material_id, weight, material_type, crby)-->
|
||||
<!-- values-->
|
||||
<!-- <foreach collection="materialList" item="materialList" separator="," close=";">-->
|
||||
<!-- (#{materialList.dishesId}, #{materialList.materialId}, #{materialList.weight},-->
|
||||
<!-- #{materialList.materialType}, #{materialList.crby})-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <select id="getDishDetails" resultType="com.bonus.core.menu.vo.DishDetails">-->
|
||||
<!-- SELECT mmd.dishes_id,-->
|
||||
<!-- mm.nutrition_id,-->
|
||||
<!-- mm.material_name,-->
|
||||
<!-- mn.big_type,-->
|
||||
<!-- mn.little_type,-->
|
||||
<!-- mmd.weight,-->
|
||||
<!-- mn.calories,-->
|
||||
<!-- mn.protein,-->
|
||||
<!-- mn.fat,-->
|
||||
<!-- mn.carbohydrate,-->
|
||||
<!-- mn.cholesterol,-->
|
||||
<!-- mn.purine,-->
|
||||
<!-- mn.glycemic_index,-->
|
||||
<!-- mn.fatty_acid-->
|
||||
<!-- FROM menu_material_dishes mmd-->
|
||||
<!-- LEFT JOIN menu_material mm ON mm.material_id = mmd.material_id-->
|
||||
<!-- LEFT JOIN menu_nutrition mn ON mn.nutrition_id = mm.nutrition_id-->
|
||||
<!-- WHERE mmd.dishes_id = #{dishesId}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getMenuMaterialById" resultType="com.bonus.core.menu.vo.MenuMaterialBasVO">
|
||||
SELECT mm.material_id,
|
||||
mm.material_name,
|
||||
mm.material_code,
|
||||
mm.image_url,
|
||||
mmd.weight,
|
||||
mmd.material_type,
|
||||
mn.big_type,
|
||||
mn.little_type
|
||||
FROM menu_material mm
|
||||
LEFT JOIN menu_material_dishes mmd ON mm.material_id = mmd.material_id
|
||||
LEFT JOIN menu_nutrition mn ON mn.nutrition_id = mm.nutrition_id
|
||||
WHERE mmd.dishes_id = #{dishesId}
|
||||
and mmd.del_flag = 2
|
||||
</select>
|
||||
<!-- <select id="selectDishesList" resultType="com.bonus.core.menu.dto.MenuUpdateDishesModel">-->
|
||||
<!-- select-->
|
||||
<!-- md.id,-->
|
||||
<!-- md.dishes_id-->
|
||||
<!-- from-->
|
||||
<!-- menu_material_dishes mmd-->
|
||||
<!-- left join menu_dishes md on mmd.dishes_id = md.dishes_id-->
|
||||
<!-- where-->
|
||||
<!-- mmd.material_id in-->
|
||||
<!-- <foreach collection="materialIdList" item="materialId" separator="," open="(" close=")">-->
|
||||
<!-- #{materialId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- group by-->
|
||||
<!-- md.id,-->
|
||||
<!-- md.dishes_id-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
Reference in New Issue