一周菜谱

This commit is contained in:
sxu 2025-02-06 18:24:03 +08:00
parent 2a1611f689
commit b0ac8fdb21
11 changed files with 1579 additions and 1 deletions

View File

@ -0,0 +1,48 @@
package com.bonus.core.menu.dto;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
public class CheckDishesDto {
@ApiModelProperty("日期")
private LocalDate orderDate;
@ApiModelProperty("菜品id")
private Long goodsDishesId;
@ApiModelProperty("菜谱id")
private Long recipeId;
@ApiModelProperty("餐次")
private Integer mealtimeType;
public LocalDate getOrderDate() {
return this.orderDate;
}
public Long getGoodsDishesId() {
return this.goodsDishesId;
}
public Long getRecipeId() {
return this.recipeId;
}
public Integer getMealtimeType() {
return this.mealtimeType;
}
public void setOrderDate(final LocalDate orderDate) {
this.orderDate = orderDate;
}
public void setGoodsDishesId(final Long goodsDishesId) {
this.goodsDishesId = goodsDishesId;
}
public void setRecipeId(final Long recipeId) {
this.recipeId = recipeId;
}
public void setMealtimeType(final Integer mealtimeType) {
this.mealtimeType = mealtimeType;
}
}

View File

@ -0,0 +1,97 @@
package com.bonus.core.menu.dto;
import io.swagger.annotations.ApiModelProperty;
public class OrderRecipeDishesDto {
@ApiModelProperty("菜谱详情id")
private Long detailId;
@ApiModelProperty("菜品id")
private Long dishesId;
@ApiModelProperty("菜品名称")
private String dishesName;
@ApiModelProperty("菜品单价")
private Integer price;
@ApiModelProperty("菜品价格(优惠价)")
private Integer salePrice;
@ApiModelProperty("销售方式(1按份,2称重)")
private Integer salesMode;
@ApiModelProperty("称重单位多少克(默认1kg)")
private Integer unitPrice;
@ApiModelProperty("菜品图片url")
private String imageUrl;
@ApiModelProperty("菜品规格")
private Long sizeType;
public Long getDetailId() {
return this.detailId;
}
public Long getDishesId() {
return this.dishesId;
}
public String getDishesName() {
return this.dishesName;
}
public Integer getPrice() {
return this.price;
}
public Integer getSalePrice() {
return this.salePrice;
}
public Integer getSalesMode() {
return this.salesMode;
}
public Integer getUnitPrice() {
return this.unitPrice;
}
public String getImageUrl() {
return this.imageUrl;
}
public Long getSizeType() {
return this.sizeType;
}
public void setDetailId(final Long detailId) {
this.detailId = detailId;
}
public void setDishesId(final Long dishesId) {
this.dishesId = dishesId;
}
public void setDishesName(final String dishesName) {
this.dishesName = dishesName;
}
public void setPrice(final Integer price) {
this.price = price;
}
public void setSalePrice(final Integer salePrice) {
this.salePrice = salePrice;
}
public void setSalesMode(final Integer salesMode) {
this.salesMode = salesMode;
}
public void setUnitPrice(final Integer unitPrice) {
this.unitPrice = unitPrice;
}
public void setImageUrl(final String imageUrl) {
this.imageUrl = imageUrl;
}
public void setSizeType(final Long sizeType) {
this.sizeType = sizeType;
}
}

View File

@ -0,0 +1,154 @@
package com.bonus.core.menu.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
@TableName("menu_recipe")
@ApiModel("菜品计划信息")
public class MenuRecipe {
@TableId
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("菜谱id")
private Long recipeId;
@ApiModelProperty("菜谱类型 1 默认 3按周")
private Integer recipeType;
@ApiModelProperty("菜品计划id(数据同步)")
private String planId;
@ApiModelProperty("菜谱名称")
private String recipeName;
@ApiModelProperty("食堂id")
private Long canteenId;
@ApiModelProperty("档口id")
private Long stallId;
@ApiModelProperty("适用人员范围")
private Long effId;
@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 getRecipeId() {
return this.recipeId;
}
public Integer getRecipeType() {
return this.recipeType;
}
public String getPlanId() {
return this.planId;
}
public String getRecipeName() {
return this.recipeName;
}
public Long getCanteenId() {
return this.canteenId;
}
public Long getStallId() {
return this.stallId;
}
public Long getEffId() {
return this.effId;
}
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 setRecipeId(final Long recipeId) {
this.recipeId = recipeId;
}
public void setRecipeType(final Integer recipeType) {
this.recipeType = recipeType;
}
public void setPlanId(final String planId) {
this.planId = planId;
}
public void setRecipeName(final String recipeName) {
this.recipeName = recipeName;
}
public void setCanteenId(final Long canteenId) {
this.canteenId = canteenId;
}
public void setStallId(final Long stallId) {
this.stallId = stallId;
}
public void setEffId(final Long effId) {
this.effId = effId;
}
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;
}
}

View File

@ -0,0 +1,146 @@
package com.bonus.core.menu.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
import java.time.LocalDateTime;
@TableName("menu_recipe_detail")
@ApiModel("菜品计划详情信息")
public class MenuRecipeDetail {
@TableId
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("菜谱详情id")
private Long detailId;
@ApiModelProperty("菜品计划销售类别id(数据同步)")
private Long saleTypeId;
@ApiModelProperty("菜谱id")
private Long recipeId;
@ApiModelProperty("启用时间(天)")
private LocalDate applyDate;
@ApiModelProperty("餐次类型")
private Integer mealtimeType;
@ApiModelProperty("详情类型(1-模板,2-详情)")
private Integer detailType;
@ApiModelProperty("启用时间(周)")
private Integer applyWeek;
@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 getDetailId() {
return this.detailId;
}
public Long getSaleTypeId() {
return this.saleTypeId;
}
public Long getRecipeId() {
return this.recipeId;
}
public LocalDate getApplyDate() {
return this.applyDate;
}
public Integer getMealtimeType() {
return this.mealtimeType;
}
public Integer getDetailType() {
return this.detailType;
}
public Integer getApplyWeek() {
return this.applyWeek;
}
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 setDetailId(final Long detailId) {
this.detailId = detailId;
}
public void setSaleTypeId(final Long saleTypeId) {
this.saleTypeId = saleTypeId;
}
public void setRecipeId(final Long recipeId) {
this.recipeId = recipeId;
}
public void setApplyDate(final LocalDate applyDate) {
this.applyDate = applyDate;
}
public void setMealtimeType(final Integer mealtimeType) {
this.mealtimeType = mealtimeType;
}
public void setDetailType(final Integer detailType) {
this.detailType = detailType;
}
public void setApplyWeek(final Integer applyWeek) {
this.applyWeek = applyWeek;
}
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;
}
}

View File

@ -0,0 +1,201 @@
package com.bonus.core.menu.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
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;
import java.util.Optional;
@TableName("menu_recipe_dishes")
@ApiModel("菜品计划菜品关联")
public class MenuRecipeDishes extends Model<MenuRecipeDishes> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("菜谱详情id")
private Long detailId;
@ApiModelProperty("菜品id")
private Long dishesId;
@ApiModelProperty("菜品单价")
private Integer price;
@ApiModelProperty("规格类型(1-标准,2-大份,3-小份,4-50g,5-100g)")
private Long sizeType;
@ApiModelProperty("供应数量")
private Integer supplyNum;
@ApiModelProperty("销售数量")
private Integer saleNum;
@ApiModelProperty("剩余数量")
private Integer surplusNum;
@ApiModelProperty("个人限购数量")
private Integer restrictNum;
@ApiModelProperty("菜品价格(优惠价)")
private Integer salePrice;
@ApiModelProperty("是否推荐")
private Integer recommendFlag;
@ApiModelProperty("排序号")
private Integer sortNum;
@ApiModelProperty("乐观锁")
private Integer revision;
@TableField(
fill = FieldFill.INSERT
)
@ApiModelProperty("创建人")
private String crby;
@TableField(
fill = FieldFill.INSERT
)
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@TableField(
fill = FieldFill.INSERT_UPDATE
)
@ApiModelProperty("更新人")
private String upby;
@TableField(
fill = FieldFill.INSERT_UPDATE
)
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
public Integer getSortNum() {
return (Integer)Optional.ofNullable(this.sortNum).orElse(-1);
}
public Integer getRecommendFlag() {
return (Integer)Optional.ofNullable(this.recommendFlag).orElse(2);
}
public Integer getSaleNum() {
return (Integer)Optional.ofNullable(this.saleNum).orElse(0);
}
public Long getId() {
return this.id;
}
public Long getDetailId() {
return this.detailId;
}
public Long getDishesId() {
return this.dishesId;
}
public Integer getPrice() {
return this.price;
}
public Long getSizeType() {
return this.sizeType;
}
public Integer getSupplyNum() {
return this.supplyNum;
}
public Integer getSurplusNum() {
return this.surplusNum;
}
public Integer getRestrictNum() {
return this.restrictNum;
}
public Integer getSalePrice() {
return this.salePrice;
}
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 setDetailId(final Long detailId) {
this.detailId = detailId;
}
public void setDishesId(final Long dishesId) {
this.dishesId = dishesId;
}
public void setPrice(final Integer price) {
this.price = price;
}
public void setSizeType(final Long sizeType) {
this.sizeType = sizeType;
}
public void setSupplyNum(final Integer supplyNum) {
this.supplyNum = supplyNum;
}
public void setSaleNum(final Integer saleNum) {
this.saleNum = saleNum;
}
public void setSurplusNum(final Integer surplusNum) {
this.surplusNum = surplusNum;
}
public void setRestrictNum(final Integer restrictNum) {
this.restrictNum = restrictNum;
}
public void setSalePrice(final Integer salePrice) {
this.salePrice = salePrice;
}
public void setRecommendFlag(final Integer recommendFlag) {
this.recommendFlag = recommendFlag;
}
public void setSortNum(final Integer sortNum) {
this.sortNum = sortNum;
}
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;
}
}

View File

@ -0,0 +1,17 @@
package com.bonus.core.menu.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bonus.core.menu.entity.MenuRecipeDetail;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface MenuRecipeDetailService {
List<MenuRecipeDetail> getByRecipeIdAndDatesAndIntervalId(Long recipeId, Set<LocalDate> dates, Integer mealtimeType);
MenuRecipeDetail getByRecipeIdAndApplyDateAndIntervalId(Long recipeId, LocalDate applyDate, Integer mealtimeType);
Map<Long, Set<LocalDate>> selectApplyDateListByRecipeId(List<Long> recipeIds);
}

View File

@ -0,0 +1,25 @@
package com.bonus.core.menu.service;
import com.bonus.core.menu.dto.CheckDishesDto;
import com.bonus.core.menu.dto.OrderRecipeDishesDto;
import com.bonus.core.menu.entity.MenuRecipeDishes;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface MenuRecipeDishesService {
Boolean deleteByDetailId(Long detailId);
OrderRecipeDishesDto getOrderDishesDetail(Long detailId, Long dishesId);
Map<Long, Integer> getDishesCountByRecipeIds(List<Long> recipeIds);
Map<LocalDate, Set<Integer>> queryDishesByDate(List<LocalDate> dates, Long recipeId, Long dishesId);
List<CheckDishesVo> checkDishes(List<CheckDishesDto> checkDishes, Integer orderType);
boolean saveBatch(Collection<MenuRecipeDishes> entityList);
}

View File

@ -0,0 +1,32 @@
package com.bonus.core.menu.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.bonus.core.menu.entity.MenuRecipeDetail;
import com.bonus.core.menu.service.MenuRecipeDetailService;
import org.springframework.stereotype.Service;
import java.lang.invoke.SerializedLambda;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
@Service
public class MenuRecipeDetailServiceImpl implements MenuRecipeDetailService {
public List<MenuRecipeDetail> getByRecipeIdAndDatesAndIntervalId(Long recipeId, Set<LocalDate> values, Integer mealtimeType) {
return this.list((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery().eq(MenuRecipeDetail::getMealtimeType, mealtimeType)).eq(MenuRecipeDetail::getRecipeId, recipeId)).in(MenuRecipeDetail::getApplyDate, values));
}
public MenuRecipeDetail getByRecipeIdAndApplyDateAndIntervalId(Long recipeId, LocalDate applyDate, Integer mealtimeType) {
return (MenuRecipeDetail)this.getOne((Wrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery().eq(MenuRecipeDetail::getMealtimeType, mealtimeType)).eq(MenuRecipeDetail::getRecipeId, recipeId)).eq(MenuRecipeDetail::getApplyDate, applyDate));
}
public Map<Long, Set<LocalDate>> selectApplyDateListByRecipeId(List<Long> recipeIds) {
return (Map)this.list((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipeDetail.class).select(new SFunction[]{MenuRecipeDetail::getRecipeId, MenuRecipeDetail::getApplyDate}).ge(MenuRecipeDetail::getApplyDate, LocalDate.now())).in(MenuRecipeDetail::getRecipeId, recipeIds)).stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId, Collectors.mapping(MenuRecipeDetail::getApplyDate, Collectors.toCollection(TreeSet::new))));
}
}

View File

@ -0,0 +1,220 @@
package com.bonus.core.menu.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.lang.invoke.SerializedLambda;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class MenuRecipeDishesServiceImpl implements MenuRecipeDishesService {
private static final Logger log = LoggerFactory.getLogger(MenuRecipeDishesServiceImpl.class);
@Autowired
@Lazy
private MenuDishesService menuDishesService;
@Autowired
@Lazy
private MenuRecipeDetailService menuRecipeDetailService;
@Autowired
private MenuRecipeMapper menuRecipeMapper;
@Autowired
private AllocDeliveryApi allocDeliveryApi;
@Autowired
private AllocMealtimeApi allocMealtimeApi;
@Autowired
private MenuAppRecipeMapper menuAppRecipeMapper;
public Boolean deleteByDetailId(Long detailId) {
return this.remove((Wrapper)Wrappers.lambdaQuery().eq(MenuRecipeDishes::getDetailId, detailId));
}
public OrderRecipeDishesDto getOrderDishesDetail(Long detailId, Long dishesId) {
MenuRecipeDetail menuRecipeDetail = (MenuRecipeDetail)this.menuRecipeDetailService.getOne((Wrapper)Wrappers.lambdaQuery(MenuRecipeDetail.class).select(new SFunction[]{MenuRecipeDetail::getRecipeId}).eq(MenuRecipeDetail::getDetailId, detailId));
if (ObjectUtil.isNull(menuRecipeDetail)) {
throw new LeException("菜谱已更新,请刷新页面重新点餐");
} else {
String redisKey = String.format("yst:%s:recipe:%s:detail:%s:dishes:%s:order:query", TenantContextHolder.getTenantId(), menuRecipeDetail.getRecipeId(), detailId, dishesId);
Object obj = RedisUtil.getObj(redisKey);
if (obj instanceof OrderRecipeDishesDto) {
OrderRecipeDishesDto o = (OrderRecipeDishesDto)obj;
log.info("取redis缓存,详情: {}", JSON.toJSONString(obj));
return o;
} else {
MenuRecipeDishes menuRecipeDishes = (MenuRecipeDishes)this.getOne((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipeDishes.class).eq(MenuRecipeDishes::getDishesId, dishesId)).eq(MenuRecipeDishes::getDetailId, detailId));
MenuDishes menuDishes = (MenuDishes)this.menuDishesService.getOne((Wrapper)Wrappers.lambdaQuery(MenuDishes.class).eq(MenuDishes::getDishesId, dishesId));
OrderRecipeDishesDto orderRecipeDishesDto = (OrderRecipeDishesDto)BeanUtil.copyProperties(menuRecipeDishes, OrderRecipeDishesDto.class, new String[0]);
orderRecipeDishesDto.setSalesMode(menuDishes.getSalesMode());
orderRecipeDishesDto.setUnitPrice(menuDishes.getUnitPrice());
orderRecipeDishesDto.setImageUrl(menuDishes.getImageUrl());
orderRecipeDishesDto.setDishesName(menuDishes.getDishesName());
log.info("查询数据库信息,详情: {}", JSON.toJSONString(orderRecipeDishesDto));
RedisUtil.setObj(redisKey, orderRecipeDishesDto, 86400L);
return orderRecipeDishesDto;
}
}
}
public Map<Long, Integer> getDishesCountByRecipeIds(List<Long> recipeIds) {
List<RecipeDishesCountDto> dishesCountByRecipeIds = ((MenuRecipeDishesMapper)this.baseMapper).getDishesCountByRecipeIds(recipeIds);
return (Map)dishesCountByRecipeIds.stream().collect(Collectors.toMap(RecipeDishesCountDto::getRecipeId, RecipeDishesCountDto::getNum));
}
public Map<LocalDate, Set<Integer>> queryDishesByDate(List<LocalDate> dates, Long recipeId, Long dishesId) {
List<ExistDateDto> existDateDtos = ((MenuRecipeDishesMapper)this.baseMapper).queryDishesByDate(dates, recipeId, dishesId);
return (Map)existDateDtos.stream().collect(Collectors.groupingBy(ExistDateDto::getApplyDate, Collectors.mapping(ExistDateDto::getMealtimeType, Collectors.toSet())));
}
public List<CheckDishesVo> checkDishes(List<CheckDishesDto> checkDishes, Integer orderType) {
List<Long> dishesIds = (List)checkDishes.stream().map(CheckDishesDto::getGoodsDishesId).collect(Collectors.toList());
Map<Long, MenuDishes> dishesMap = (Map)this.menuDishesService.getMenuDishesList(dishesIds).stream().collect(Collectors.toMap(MenuDishes::getDishesId, Function.identity()));
return (List)checkDishes.stream().map((checkDish) -> {
CheckDishesVo checkDishesVo = this.initCheckDishesVo(dishesMap, checkDish);
MenuRecipeDetail menuRecipeDetail = this.menuRecipeDetailService.getByRecipeIdAndApplyDateAndIntervalId(checkDish.getRecipeId(), checkDish.getOrderDate(), checkDish.getMealtimeType());
if (ObjectUtil.isEmpty(menuRecipeDetail)) {
checkDishesVo.setIfExpired(LeConstants.COMMON_YES);
return checkDishesVo;
} else {
Long detailId = menuRecipeDetail.getDetailId();
Long stallId = this.menuRecipeMapper.selectStallIdByWrappers((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipe.class).eq(MenuRecipe::getRecipeId, menuRecipeDetail.getRecipeId())).eq(MenuRecipe::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
List<AllocDeliveryCostModel> costModelList = this.allocDeliveryApi.queryDeliveryCostModel(stallId);
checkDishesVo.setCostModelList(costModelList);
List<AllocMealtimeStateModel> mealTimeList = this.allocMealtimeApi.getAllocMealtimeMenuModel(stallId).getMealtimeStateModelList();
if (ObjectUtil.isNotEmpty(mealTimeList)) {
mealTimeList = (List)mealTimeList.stream().filter((mealtime) -> {
return mealtime.getIfUse() == 1;
}).collect(Collectors.toList());
}
if (LocalDate.now().isEqual(menuRecipeDetail.getApplyDate()) && !OrderTypeEnum.isCurrMealType(orderType)) {
mealTimeList = (List)mealTimeList.stream().filter((time) -> {
return LocalTime.now().isBefore(time.getStartTime());
}).collect(Collectors.toList());
} else if (LocalDate.now().isAfter(menuRecipeDetail.getApplyDate())) {
mealTimeList = null;
}
MenuRecipeDishes menuRecipeDishes = (MenuRecipeDishes)((MenuRecipeDishesMapper)this.baseMapper).selectOne((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipeDishes.class).eq(MenuRecipeDishes::getDetailId, detailId)).eq(MenuRecipeDishes::getDishesId, checkDish.getGoodsDishesId()));
if (ObjectUtil.isEmpty(menuRecipeDishes)) {
checkDishesVo.setIfExpired(LeConstants.COMMON_YES);
return checkDishesVo;
} else {
BeanUtil.copyProperties(menuRecipeDishes, checkDishesVo, new String[0]);
checkDishesVo.setIfExpired(LeConstants.COMMON_NO);
checkDishesVo.setMenuDetailId(detailId);
checkDishesVo.setSalePrice(BigDecimal.valueOf((long)menuRecipeDishes.getPrice()));
checkDishesVo.setPrefPrice(BigDecimal.valueOf((long)menuRecipeDishes.getSalePrice()));
if (ObjectUtil.isEmpty(mealTimeList)) {
checkDishesVo.setIfExpired(LeConstants.COMMON_YES);
return checkDishesVo;
} else {
boolean contains = mealTimeList.stream().map(AllocMealtimeStateModel::getMealtimeType).toList().contains(checkDish.getMealtimeType());
if (contains) {
checkDishesVo.setIfExpired(LeConstants.COMMON_NO);
} else {
checkDishesVo.setIfExpired(LeConstants.COMMON_YES);
}
return checkDishesVo;
}
}
}
}).collect(Collectors.toList());
}
public CheckDishesVo initCheckDishesVo(Map<Long, MenuDishes> dishesMap, CheckDishesDto checkDish) {
CheckDishesVo checkDishesVo = new CheckDishesVo();
checkDishesVo.setIfExpired(LeConstants.COMMON_YES);
checkDishesVo.setRecipeId(checkDish.getRecipeId());
MenuDishes menuDishes = (MenuDishes)dishesMap.get(checkDish.getGoodsDishesId());
if (ObjectUtil.isNotEmpty(menuDishes)) {
checkDishesVo.setGoodsDishesName(menuDishes.getDishesName());
checkDishesVo.setWeightUnit(menuDishes.getUnitPrice());
checkDishesVo.setSalesMode(menuDishes.getSalesMode());
checkDishesVo.setSizeJson(menuDishes.getSizeJson());
checkDishesVo.setSizeType(menuDishes.getSizeType());
checkDishesVo.setImageUrl(menuDishes.getImageUrl());
}
checkDishesVo.setOrderDate(checkDish.getOrderDate());
checkDishesVo.setMealtimeType(checkDish.getMealtimeType());
checkDishesVo.setGoodsDishesId(checkDish.getGoodsDishesId());
return checkDishesVo;
}
public boolean saveBatch(Collection<MenuRecipeDishes> entityList) {
Iterator var2 = CollUtil.split(entityList, 500).iterator();
while(var2.hasNext()) {
List<MenuRecipeDishes> menuRecipeDishes = (List)var2.next();
((MenuRecipeDishesMapper)this.baseMapper).insertValues(menuRecipeDishes);
}
return true;
}
// $FF: synthetic method
private static Object $deserializeLambda$(SerializedLambda lambda) {
switch (lambda.getImplMethodName()) {
case "getDelFlag":
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipe") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
return MenuRecipe::getDelFlag;
}
break;
case "getDetailId":
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDishes::getDetailId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDetail") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDetail::getDetailId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDishes::getDetailId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDishes::getDetailId;
}
break;
case "getDishesId":
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDishes::getDishesId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuDishes::getDishesId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDishes::getDishesId;
}
break;
case "getRecipeId":
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipeDetail") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipeDetail::getRecipeId;
}
if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("net/xnzn/core/menu/entity/MenuRecipe") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
return MenuRecipe::getRecipeId;
}
}
throw new IllegalArgumentException("Invalid lambda deserialization");
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.core.menu.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.constant.DelFlagEnum;
@ -8,12 +9,18 @@ import com.bonus.core.marketing.constants.MktUserTypeEnum;
import com.bonus.core.marketing.vo.MktEffectiveUserVO;
import com.bonus.core.menu.dto.AppletWeekCanteenDTO;
import com.bonus.core.menu.dto.AppletWeekRecipeDTO;
import com.bonus.core.menu.entity.MenuRecipe;
import com.bonus.core.menu.entity.MenuRecipeDetail;
import com.bonus.core.menu.entity.MenuRecipeDishes;
import com.bonus.core.menu.mapper.MenuRecipeMapper;
import com.bonus.core.menu.service.MenuRecipeDetailService;
import com.bonus.core.menu.service.MenuRecipeDishesService;
import com.bonus.core.menu.service.MenuRecipeService;
import com.bonus.core.menu.mapper.MenuAppRecipeMapper;
import com.bonus.core.menu.vo.AppletWeekCanteenVO;
import com.bonus.core.menu.vo.AppletWeekRecipeVO;
import com.bonus.domain.CustInfo;
import com.bonus.utils.Id;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@ -21,13 +28,23 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class MenuRecipeServiceImpl implements MenuRecipeService {
private static final Logger log = LoggerFactory.getLogger(MenuRecipeServiceImpl.class);
@Autowired
private MenuRecipeDetailService menuRecipeDetailService;
@Autowired
private MenuRecipeDishesService menuRecipeDishesService;
@Autowired
private MenuAppRecipeMapper menuAppRecipeMapper;
@ -95,7 +112,7 @@ public class MenuRecipeServiceImpl implements MenuRecipeService {
((List)recipeIdList).add(content.getRecipeId());
}
//this.generateRecipe((List)recipeIdList, content.getApplyDate());
this.generateRecipe((List)recipeIdList, content.getApplyDate());
List<AppletWeekRecipeVO> resultList = menuRecipeMapper.selectWeekRecipe(content.getApplyDate(), content.getRecipeId(), (List)recipeIdList);
resultList.sort(Collections.reverseOrder((s1, s2) -> {
return s2.getMealtimeType() - s1.getMealtimeType();
@ -103,4 +120,91 @@ public class MenuRecipeServiceImpl implements MenuRecipeService {
return resultList;
}
@Transactional(
rollbackFor = {Exception.class}
)
public synchronized void generateRecipe(List<Long> recipeIdList0, LocalDate applyDate) {
if (!ObjectUtil.isEmpty(recipeIdList0) && !ObjectUtil.isEmpty(applyDate)) {
List<Long> recipeIdList = new ArrayList(recipeIdList0);
Map<Long, Long> recipeDetailContMap = (Map)this.menuRecipeDetailService.list((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipeDetail.class).select(new SFunction[]{MenuRecipeDetail::getRecipeId}).eq(MenuRecipeDetail::getApplyDate, applyDate)).in(MenuRecipeDetail::getRecipeId, recipeIdList)).stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId, Collectors.counting()));
recipeIdList.removeAll(recipeDetailContMap.keySet());
if (!ObjectUtil.isEmpty(recipeIdList)) {
List<MenuRecipe> menuRecipes = this.list((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipe.class).in(MenuRecipe::getRecipeType, new Object[]{2, 3})).in(MenuRecipe::getRecipeId, recipeIdList));
if (!ObjectUtil.isEmpty(menuRecipes)) {
Map<Long, MenuRecipe> recipeMap = (Map)menuRecipes.stream().collect(Collectors.toMap(MenuRecipe::getRecipeId, Function.identity()));
List<MenuRecipeDetail> menuRecipeDetails = this.menuRecipeDetailService.list((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuRecipeDetail.class).eq(MenuRecipeDetail::getDetailType, 1)).in(MenuRecipeDetail::getRecipeId, recipeIdList));
Map<Long, Integer> recipeTypeMap = (Map)menuRecipes.stream().collect(Collectors.toMap(MenuRecipe::getRecipeId, MenuRecipe::getRecipeType));
menuRecipeDetails = this.filterMenuRecipeDetails(recipeTypeMap, menuRecipeDetails, applyDate);
if (!ObjectUtil.isEmpty(menuRecipeDetails)) {
Map<Long, List<MenuRecipeDetail>> detailMap = (Map)menuRecipeDetails.stream().collect(Collectors.groupingBy(MenuRecipeDetail::getRecipeId));
List<Long> detailIds = (List)menuRecipeDetails.stream().map(MenuRecipeDetail::getDetailId).collect(Collectors.toList());
Map<Long, List<MenuRecipeDishes>> recipeDishes = (Map)this.menuRecipeDishesService.list((Wrapper)Wrappers.lambdaQuery(MenuRecipeDishes.class).in(MenuRecipeDishes::getDetailId, detailIds)).stream().collect(Collectors.groupingBy(MenuRecipeDishes::getDetailId));
List<MenuRecipeDetail> recipeDetailV2List = Lists.newArrayList();
List<MenuRecipeDishes> recipeDishesV2List = Lists.newArrayList();
Iterator var13 = recipeMap.keySet().iterator();
label59:
while(true) {
Long recipeId;
Integer type;
List menuRecipeDetail;
do {
if (!var13.hasNext()) {
this.menuRecipeDetailService.saveBatch(recipeDetailV2List);
if (ObjectUtil.isNotEmpty(recipeDishesV2List)) {
this.menuRecipeDishesService.saveBatch(recipeDishesV2List);
}
return;
}
recipeId = (Long)var13.next();
type = (Integer)recipeTypeMap.get(recipeId);
menuRecipeDetail = (List)detailMap.get(recipeId);
} while(!ObjectUtil.isNotEmpty(menuRecipeDetail));
Iterator var17 = menuRecipeDetail.iterator();
while(true) {
Long detailId;
List dishes;
do {
if (!var17.hasNext()) {
continue label59;
}
MenuRecipeDetail recipeDetail = (MenuRecipeDetail)var17.next();
MenuRecipeDetail detailItem = new MenuRecipeDetail();
detailId = Id.next();
detailItem.setDetailId(detailId);
detailItem.setRecipeId(recipeId);
if (ObjectUtil.equal(type, 3)) {
detailItem.setApplyWeek(applyDate.getDayOfWeek().getValue());
}
detailItem.setApplyDate(applyDate);
detailItem.setMealtimeType(recipeDetail.getMealtimeType());
detailItem.setCrby("");
detailItem.setDetailType(2);
recipeDetailV2List.add(detailItem);
dishes = (List)recipeDishes.get(recipeDetail.getDetailId());
} while(!ObjectUtil.isNotEmpty(dishes));
Iterator var22 = dishes.iterator();
while(var22.hasNext()) {
MenuRecipeDishes dish = (MenuRecipeDishes)var22.next();
MenuRecipeDishes dishesItem = (MenuRecipeDishes) BeanUtil.copyProperties(dish, MenuRecipeDishes.class, new String[0]);
dishesItem.setDetailId(detailId);
dishesItem.setId((Long)null);
recipeDishesV2List.add(dishesItem);
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,534 @@
package com.bonus.core.menu.vo;
import io.swagger.annotations.ApiModelProperty;
import net.xnzn.core.allocation.canteen.model.AllocDeliveryCostModel;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
public class CheckDishesVo {
@ApiModelProperty("菜谱id")
private Long recipeId;
private Integer ifExpired;
private String goodsDishesName;
private Long menuDetailId;
private BigDecimal salePrice;
private BigDecimal prefPrice;
private Integer weightUnit;
private String unitName;
private Integer salesMode;
private String tasteName;
@ApiModelProperty("餐次")
private Integer mealtimeType;
@ApiModelProperty("日期")
private LocalDate orderDate;
@ApiModelProperty("菜品id")
private Long goodsDishesId;
@ApiModelProperty("菜品图片url")
private String imageUrl;
@ApiModelProperty("供应数量")
private Integer supplyNum;
@ApiModelProperty("销售数量")
private Integer saleNum;
@ApiModelProperty("剩余数量")
private Integer surplusNum;
@ApiModelProperty("个人限购数量")
private Integer restrictNum;
@ApiModelProperty("规格类型(1-标准,2-大小份)")
private Long sizeType;
@ApiModelProperty("规格json")
private String sizeJson;
@ApiModelProperty("配送方式列表")
private List<AllocDeliveryCostModel> costModelList;
public Long getRecipeId() {
return this.recipeId;
}
public Integer getIfExpired() {
return this.ifExpired;
}
public String getGoodsDishesName() {
return this.goodsDishesName;
}
public Long getMenuDetailId() {
return this.menuDetailId;
}
public BigDecimal getSalePrice() {
return this.salePrice;
}
public BigDecimal getPrefPrice() {
return this.prefPrice;
}
public Integer getWeightUnit() {
return this.weightUnit;
}
public String getUnitName() {
return this.unitName;
}
public Integer getSalesMode() {
return this.salesMode;
}
public String getTasteName() {
return this.tasteName;
}
public Integer getMealtimeType() {
return this.mealtimeType;
}
public LocalDate getOrderDate() {
return this.orderDate;
}
public Long getGoodsDishesId() {
return this.goodsDishesId;
}
public String getImageUrl() {
return this.imageUrl;
}
public Integer getSupplyNum() {
return this.supplyNum;
}
public Integer getSaleNum() {
return this.saleNum;
}
public Integer getSurplusNum() {
return this.surplusNum;
}
public Integer getRestrictNum() {
return this.restrictNum;
}
public Long getSizeType() {
return this.sizeType;
}
public String getSizeJson() {
return this.sizeJson;
}
public List<AllocDeliveryCostModel> getCostModelList() {
return this.costModelList;
}
public void setRecipeId(final Long recipeId) {
this.recipeId = recipeId;
}
public void setIfExpired(final Integer ifExpired) {
this.ifExpired = ifExpired;
}
public void setGoodsDishesName(final String goodsDishesName) {
this.goodsDishesName = goodsDishesName;
}
public void setMenuDetailId(final Long menuDetailId) {
this.menuDetailId = menuDetailId;
}
public void setSalePrice(final BigDecimal salePrice) {
this.salePrice = salePrice;
}
public void setPrefPrice(final BigDecimal prefPrice) {
this.prefPrice = prefPrice;
}
public void setWeightUnit(final Integer weightUnit) {
this.weightUnit = weightUnit;
}
public void setUnitName(final String unitName) {
this.unitName = unitName;
}
public void setSalesMode(final Integer salesMode) {
this.salesMode = salesMode;
}
public void setTasteName(final String tasteName) {
this.tasteName = tasteName;
}
public void setMealtimeType(final Integer mealtimeType) {
this.mealtimeType = mealtimeType;
}
public void setOrderDate(final LocalDate orderDate) {
this.orderDate = orderDate;
}
public void setGoodsDishesId(final Long goodsDishesId) {
this.goodsDishesId = goodsDishesId;
}
public void setImageUrl(final String imageUrl) {
this.imageUrl = imageUrl;
}
public void setSupplyNum(final Integer supplyNum) {
this.supplyNum = supplyNum;
}
public void setSaleNum(final Integer saleNum) {
this.saleNum = saleNum;
}
public void setSurplusNum(final Integer surplusNum) {
this.surplusNum = surplusNum;
}
public void setRestrictNum(final Integer restrictNum) {
this.restrictNum = restrictNum;
}
public void setSizeType(final Long sizeType) {
this.sizeType = sizeType;
}
public void setSizeJson(final String sizeJson) {
this.sizeJson = sizeJson;
}
public void setCostModelList(final List<AllocDeliveryCostModel> costModelList) {
this.costModelList = costModelList;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
} else if (!(o instanceof CheckDishesVo)) {
return false;
} else {
CheckDishesVo other = (CheckDishesVo)o;
if (!other.canEqual(this)) {
return false;
} else {
label263: {
Object this$recipeId = this.getRecipeId();
Object other$recipeId = other.getRecipeId();
if (this$recipeId == null) {
if (other$recipeId == null) {
break label263;
}
} else if (this$recipeId.equals(other$recipeId)) {
break label263;
}
return false;
}
Object this$ifExpired = this.getIfExpired();
Object other$ifExpired = other.getIfExpired();
if (this$ifExpired == null) {
if (other$ifExpired != null) {
return false;
}
} else if (!this$ifExpired.equals(other$ifExpired)) {
return false;
}
label249: {
Object this$menuDetailId = this.getMenuDetailId();
Object other$menuDetailId = other.getMenuDetailId();
if (this$menuDetailId == null) {
if (other$menuDetailId == null) {
break label249;
}
} else if (this$menuDetailId.equals(other$menuDetailId)) {
break label249;
}
return false;
}
Object this$weightUnit = this.getWeightUnit();
Object other$weightUnit = other.getWeightUnit();
if (this$weightUnit == null) {
if (other$weightUnit != null) {
return false;
}
} else if (!this$weightUnit.equals(other$weightUnit)) {
return false;
}
label235: {
Object this$salesMode = this.getSalesMode();
Object other$salesMode = other.getSalesMode();
if (this$salesMode == null) {
if (other$salesMode == null) {
break label235;
}
} else if (this$salesMode.equals(other$salesMode)) {
break label235;
}
return false;
}
Object this$mealtimeType = this.getMealtimeType();
Object other$mealtimeType = other.getMealtimeType();
if (this$mealtimeType == null) {
if (other$mealtimeType != null) {
return false;
}
} else if (!this$mealtimeType.equals(other$mealtimeType)) {
return false;
}
label221: {
Object this$goodsDishesId = this.getGoodsDishesId();
Object other$goodsDishesId = other.getGoodsDishesId();
if (this$goodsDishesId == null) {
if (other$goodsDishesId == null) {
break label221;
}
} else if (this$goodsDishesId.equals(other$goodsDishesId)) {
break label221;
}
return false;
}
label214: {
Object this$supplyNum = this.getSupplyNum();
Object other$supplyNum = other.getSupplyNum();
if (this$supplyNum == null) {
if (other$supplyNum == null) {
break label214;
}
} else if (this$supplyNum.equals(other$supplyNum)) {
break label214;
}
return false;
}
Object this$saleNum = this.getSaleNum();
Object other$saleNum = other.getSaleNum();
if (this$saleNum == null) {
if (other$saleNum != null) {
return false;
}
} else if (!this$saleNum.equals(other$saleNum)) {
return false;
}
label200: {
Object this$surplusNum = this.getSurplusNum();
Object other$surplusNum = other.getSurplusNum();
if (this$surplusNum == null) {
if (other$surplusNum == null) {
break label200;
}
} else if (this$surplusNum.equals(other$surplusNum)) {
break label200;
}
return false;
}
label193: {
Object this$restrictNum = this.getRestrictNum();
Object other$restrictNum = other.getRestrictNum();
if (this$restrictNum == null) {
if (other$restrictNum == null) {
break label193;
}
} else if (this$restrictNum.equals(other$restrictNum)) {
break label193;
}
return false;
}
Object this$sizeType = this.getSizeType();
Object other$sizeType = other.getSizeType();
if (this$sizeType == null) {
if (other$sizeType != null) {
return false;
}
} else if (!this$sizeType.equals(other$sizeType)) {
return false;
}
Object this$goodsDishesName = this.getGoodsDishesName();
Object other$goodsDishesName = other.getGoodsDishesName();
if (this$goodsDishesName == null) {
if (other$goodsDishesName != null) {
return false;
}
} else if (!this$goodsDishesName.equals(other$goodsDishesName)) {
return false;
}
label172: {
Object this$salePrice = this.getSalePrice();
Object other$salePrice = other.getSalePrice();
if (this$salePrice == null) {
if (other$salePrice == null) {
break label172;
}
} else if (this$salePrice.equals(other$salePrice)) {
break label172;
}
return false;
}
Object this$prefPrice = this.getPrefPrice();
Object other$prefPrice = other.getPrefPrice();
if (this$prefPrice == null) {
if (other$prefPrice != null) {
return false;
}
} else if (!this$prefPrice.equals(other$prefPrice)) {
return false;
}
Object this$unitName = this.getUnitName();
Object other$unitName = other.getUnitName();
if (this$unitName == null) {
if (other$unitName != null) {
return false;
}
} else if (!this$unitName.equals(other$unitName)) {
return false;
}
label151: {
Object this$tasteName = this.getTasteName();
Object other$tasteName = other.getTasteName();
if (this$tasteName == null) {
if (other$tasteName == null) {
break label151;
}
} else if (this$tasteName.equals(other$tasteName)) {
break label151;
}
return false;
}
Object this$orderDate = this.getOrderDate();
Object other$orderDate = other.getOrderDate();
if (this$orderDate == null) {
if (other$orderDate != null) {
return false;
}
} else if (!this$orderDate.equals(other$orderDate)) {
return false;
}
label137: {
Object this$imageUrl = this.getImageUrl();
Object other$imageUrl = other.getImageUrl();
if (this$imageUrl == null) {
if (other$imageUrl == null) {
break label137;
}
} else if (this$imageUrl.equals(other$imageUrl)) {
break label137;
}
return false;
}
Object this$sizeJson = this.getSizeJson();
Object other$sizeJson = other.getSizeJson();
if (this$sizeJson == null) {
if (other$sizeJson != null) {
return false;
}
} else if (!this$sizeJson.equals(other$sizeJson)) {
return false;
}
Object this$costModelList = this.getCostModelList();
Object other$costModelList = other.getCostModelList();
if (this$costModelList == null) {
if (other$costModelList == null) {
return true;
}
} else if (this$costModelList.equals(other$costModelList)) {
return true;
}
return false;
}
}
}
protected boolean canEqual(final Object other) {
return other instanceof CheckDishesVo;
}
public int hashCode() {
int PRIME = true;
int result = 1;
Object $recipeId = this.getRecipeId();
result = result * 59 + ($recipeId == null ? 43 : $recipeId.hashCode());
Object $ifExpired = this.getIfExpired();
result = result * 59 + ($ifExpired == null ? 43 : $ifExpired.hashCode());
Object $menuDetailId = this.getMenuDetailId();
result = result * 59 + ($menuDetailId == null ? 43 : $menuDetailId.hashCode());
Object $weightUnit = this.getWeightUnit();
result = result * 59 + ($weightUnit == null ? 43 : $weightUnit.hashCode());
Object $salesMode = this.getSalesMode();
result = result * 59 + ($salesMode == null ? 43 : $salesMode.hashCode());
Object $mealtimeType = this.getMealtimeType();
result = result * 59 + ($mealtimeType == null ? 43 : $mealtimeType.hashCode());
Object $goodsDishesId = this.getGoodsDishesId();
result = result * 59 + ($goodsDishesId == null ? 43 : $goodsDishesId.hashCode());
Object $supplyNum = this.getSupplyNum();
result = result * 59 + ($supplyNum == null ? 43 : $supplyNum.hashCode());
Object $saleNum = this.getSaleNum();
result = result * 59 + ($saleNum == null ? 43 : $saleNum.hashCode());
Object $surplusNum = this.getSurplusNum();
result = result * 59 + ($surplusNum == null ? 43 : $surplusNum.hashCode());
Object $restrictNum = this.getRestrictNum();
result = result * 59 + ($restrictNum == null ? 43 : $restrictNum.hashCode());
Object $sizeType = this.getSizeType();
result = result * 59 + ($sizeType == null ? 43 : $sizeType.hashCode());
Object $goodsDishesName = this.getGoodsDishesName();
result = result * 59 + ($goodsDishesName == null ? 43 : $goodsDishesName.hashCode());
Object $salePrice = this.getSalePrice();
result = result * 59 + ($salePrice == null ? 43 : $salePrice.hashCode());
Object $prefPrice = this.getPrefPrice();
result = result * 59 + ($prefPrice == null ? 43 : $prefPrice.hashCode());
Object $unitName = this.getUnitName();
result = result * 59 + ($unitName == null ? 43 : $unitName.hashCode());
Object $tasteName = this.getTasteName();
result = result * 59 + ($tasteName == null ? 43 : $tasteName.hashCode());
Object $orderDate = this.getOrderDate();
result = result * 59 + ($orderDate == null ? 43 : $orderDate.hashCode());
Object $imageUrl = this.getImageUrl();
result = result * 59 + ($imageUrl == null ? 43 : $imageUrl.hashCode());
Object $sizeJson = this.getSizeJson();
result = result * 59 + ($sizeJson == null ? 43 : $sizeJson.hashCode());
Object $costModelList = this.getCostModelList();
result = result * 59 + ($costModelList == null ? 43 : $costModelList.hashCode());
return result;
}
public String toString() {
Long var10000 = this.getRecipeId();
return "CheckDishesVo(recipeId=" + var10000 + ", ifExpired=" + this.getIfExpired() + ", goodsDishesName=" + this.getGoodsDishesName() + ", menuDetailId=" + this.getMenuDetailId() + ", salePrice=" + String.valueOf(this.getSalePrice()) + ", prefPrice=" + String.valueOf(this.getPrefPrice()) + ", weightUnit=" + this.getWeightUnit() + ", unitName=" + this.getUnitName() + ", salesMode=" + this.getSalesMode() + ", tasteName=" + this.getTasteName() + ", mealtimeType=" + this.getMealtimeType() + ", orderDate=" + String.valueOf(this.getOrderDate()) + ", goodsDishesId=" + this.getGoodsDishesId() + ", imageUrl=" + this.getImageUrl() + ", supplyNum=" + this.getSupplyNum() + ", saleNum=" + this.getSaleNum() + ", surplusNum=" + this.getSurplusNum() + ", restrictNum=" + this.getRestrictNum() + ", sizeType=" + this.getSizeType() + ", sizeJson=" + this.getSizeJson() + ", costModelList=" + String.valueOf(this.getCostModelList()) + ")";
}
}