package com.bonus.core.menu.api;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.bonus.constant.LeConstants;
import com.bonus.core.menu.dto.MenuRecipeChangeSurplusNum;
import com.bonus.core.menu.entity.MenuDishes;
import com.bonus.core.menu.entity.MenuRecipe;
import com.bonus.core.menu.mapper.MenuDishesMapper;
import com.bonus.core.menu.mapper.MenuRecipeMapper;
import com.bonus.core.menu.model.MenuDishesTypeModel;
import com.bonus.core.menu.service.MenuDishesService;
import com.bonus.core.menu.service.MenuRecipeService;
import com.bonus.core.menu.utils.NutritionEntity;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
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.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public class MenuDishesApi {
   private static final Logger log = LoggerFactory.getLogger(MenuDishesApi.class);
   @Autowired
   @Lazy
   private MenuRecipeService menuRecipeService;
   @Autowired
   @Lazy
   private MenuDishesService menuDishesService;
//   @Autowired
//   @Lazy
//   private MenuMaterialCategoryMapper menuMaterialCategoryMapper;
//   @Autowired
//   @Lazy
//   private MenuMaterialDishesMapper menuMaterialDishesMapper;
//   @Autowired
//   @Lazy
//   private MenuCustomDictMapper menuCustomDictMapper;
//   @Autowired
//   @Lazy
//   private MenuDishesTypeMapper menuDishesTypeMapper;
//   @Autowired
//   @Lazy
//   private MenuMaterialMapper menuMaterialMapper;
   @Autowired
   @Lazy
   private MenuDishesMapper menuDishesMapper;
   @Autowired
   @Lazy
   private MenuRecipeMapper menuRecipeMapper;
//   @Autowired
//   @Lazy
//   private MenuEvaluaOrderMapper menuEvaluaOrderMapper;
//   @Autowired
//   private MercMerchantApi mercMerchantApi;
//   @Autowired
//   private AllocStallApi allocStallApi;
//   @Autowired
//   private AllocCanteenApi allocCanteenApi;
//   @Autowired
//   private MenuDishesStepDetailService menuDishesStepDetailService;
//   @Autowired
//   @Lazy
//   private MenuMaterialFunctionMapper menuMaterialFunctionMapper;
//   @Autowired
//   private MenuDishesAiConfigService menuDishesAiConfigService;
//
//   public AddDishesVo deviceAddDishes(DeviceAddDishesDto content) {
//      Long stallId = content.getStallId();
//      Long areaId = null;
//      Long canteenId = null;
//      if (ObjectUtil.isNotEmpty(stallId)) {
//         AllocStall allocStall = this.allocStallApi.getAllocStall(stallId);
//         AllocCanteen allocCanteen = this.allocCanteenApi.getAllocCanteen(allocStall.getCanteenId());
//         areaId = allocCanteen.getAreaId();
//         canteenId = allocCanteen.getCanteenId();
//      }
//
//      MenuDishesV2AddDTO menuDishesV2AddDTO = (MenuDishesV2AddDTO)BeanUtil.copyProperties(content, MenuDishesV2AddDTO.class, new String[0]);
//      menuDishesV2AddDTO.setMealType(MenuMealTypeEnum.DISHES.key());
//      menuDishesV2AddDTO.setAreaId(areaId);
//      menuDishesV2AddDTO.setCanteenId(canteenId);
//      menuDishesV2AddDTO.setShopstallId(stallId);
//      menuDishesV2AddDTO.setPublicDishes(LeConstants.COMMON_NO);
//      return this.menuDishesService.addMenuDishesV2(menuDishesV2AddDTO);
//   }
//
//   public MenuDishes getOneMenuDishes(Long dishesId) {
//      return (MenuDishes)this.menuDishesMapper.selectOne((Wrapper)Wrappers.lambdaQuery(MenuDishes.class).eq(MenuDishes::getDishesId, dishesId));
//   }
//
//   public MenuDishes getOneMenuDishesByCustomId(Integer customId) {
//      return (MenuDishes)this.menuDishesMapper.selectOne((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuDishes.class).eq(MenuDishes::getCustomId, customId)).eq(MenuDishes::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
//   }
//
//   public List<MenuMaterialBasVO> getMenuMaterialByDishesId(Long dishesId) {
//      return this.menuMaterialDishesMapper.getMenuMaterialById(dishesId);
//   }
//
//   public MenuDishesType getOneMenuDishesType(Long typeId) {
//      return (MenuDishesType)this.menuDishesTypeMapper.selectOne((Wrapper)Wrappers.lambdaQuery(MenuDishesType.class).eq(MenuDishesType::getTypeId, typeId));
//   }
//
//   public List<MenuDishesType> getAllMenuDishesType() {
//      return this.menuDishesTypeMapper.selectList((Wrapper)Wrappers.lambdaQuery(MenuDishesType.class).eq(MenuDishesType::getDelFlag, LeConstants.COMMON_NO));
//   }
//
//   public void updateCustLimitIdUse(Integer customId, Integer ifCustLimitIdUse) {
//   }
//
//   public void updateBatchCustLimitIdUse(Collection<Integer> customIdList, Integer ifCustLimitIdUse) {
//      this.menuCustomDictMapper.update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(MenuCustomDict.class).in(MenuCustomDict::getCustomId, customIdList)).set(MenuCustomDict::getIfCustLimitIdUse, ifCustLimitIdUse));
//   }
//
//   public void updateCardNumUse(Integer customId, Integer ifCardNumUse) {
//   }
//
//   public void updateBatchCardNumUse(Collection<Integer> customIdList, Integer ifCardNumUse) {
//      this.menuCustomDictMapper.update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(MenuCustomDict.class).in(MenuCustomDict::getCustomId, customIdList)).set(MenuCustomDict::getIfCardNumUse, ifCardNumUse));
//   }
//
//   public Integer getUsableMinCustLimitId() {
//      boolean limitFlag = this.mercMerchantApi.checkCurrentMerchantLimitFlag();
//      synchronized(this) {
//         Integer custLimitId = this.menuCustomDictMapper.selectMinCustLimitId(MenuCustomIfUseEnum.UNUSED.key());
//         if (custLimitId != null && custLimitId <= LeConstants.MAX_CUST_LIMIT_ID) {
//            this.menuCustomDictMapper.update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(MenuCustomDict.class).eq(MenuCustomDict::getCustomId, custLimitId)).set(MenuCustomDict::getIfCustLimitIdUse, MenuCustomIfUseEnum.IS_USED.key()));
//            return custLimitId;
//         } else if (limitFlag) {
//            throw new LeException(I18n.getMessage("menu_custom_max_over", new Object[0]));
//         } else {
//            return -1;
//         }
//      }
//   }
//
//   public Integer getUsableMinCardNum() {
//      boolean limitFlag = this.mercMerchantApi.checkCurrentMerchantLimitFlag();
//      synchronized(this) {
//         Integer cardNum = this.menuCustomDictMapper.selectMinCardNum(MenuCustomIfUseEnum.UNUSED.key());
//         if (cardNum != null && cardNum <= LeConstants.MAX_CUST_LIMIT_ID) {
//            this.menuCustomDictMapper.update((Object)null, (Wrapper)((LambdaUpdateWrapper)Wrappers.lambdaUpdate(MenuCustomDict.class).eq(MenuCustomDict::getCustomId, cardNum)).set(MenuCustomDict::getIfCardNumUse, MenuCustomIfUseEnum.IS_USED.key()));
//            return cardNum;
//         } else if (limitFlag) {
//            throw new LeException(I18n.getMessage("menu_custom_max_over", new Object[0]));
//         } else {
//            return -1;
//         }
//      }
//   }
//
//   public void initMenuCustomDict() {
//      this.menuCustomDictMapper.delete((Wrapper)null);
//      List<Integer> customIdList = new ArrayList();
//
//      for(int i = MenuConstant.MIN_CUSTOM_ID; i <= MenuConstant.MAX_CUSTOM_ID; ++i) {
//         customIdList.add(i);
//      }
//
//      this.menuCustomDictMapper.insertBatch(customIdList);
//   }
//
//   public void initMenuDishesType() {
//      MenuDishesType dishesType = new MenuDishesType();
//      dishesType.setTypeId(Id.next());
//      dishesType.setTypeName("默认");
//      dishesType.setDefaultFlag(MenuDishesTypeDefaultFlagEnum.DEFAULT.key());
//      dishesType.setCrby("");
//      this.menuDishesTypeMapper.insert(dishesType);
//   }
//
//   public List<MenuMaterialCategoryIdNameVO> getMenuMaterialCategoryIdNameList() {
//      return this.menuMaterialCategoryMapper.selectCategoryIdAndNameListByWrapper((Wrapper)Wrappers.lambdaQuery(MenuMaterialCategory.class).eq(MenuMaterialCategory::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
//   }
//
//   public Long getMaterialIdByName(String materialName) {
//      return this.menuMaterialMapper.selectMaterialIdByWrapper((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuMaterial.class).eq(MenuMaterial::getMaterialName, materialName)).eq(MenuMaterial::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
//   }
//
//   public void editRecipeDishesPriceFeign(MenuEditRecipePriceDTO content) {
//      this.menuRecipeService.editRecipeDishesPriceFeign(content);
//   }
//
//   public IssueRecipeVO issueRecipeV2(IssueRecipeV2DTO issueRecipeV2DTO) {
//      return this.menuRecipeService.issueRecipeV2(issueRecipeV2DTO);
//   }
//
//   public MenuDishesByCustomIdVO getMenuDishesDetailByCustomId(MenuDishesByCustomIdDTO menuDishesByCustomIdDTO) {
//      return this.menuDishesService.getMenuDishesDetailByCustomId(menuDishesByCustomIdDTO);
//   }
//
//   public MenuRecipeIssueVO getRecipeDishesFeign(MenuRecipeIssueDTO menuRecipeIssueDTO) {
//      return this.menuRecipeService.getRecipeDishesFeign(menuRecipeIssueDTO);
//   }
//
//   public String getRecipeNameById(Long recipeId) {
//      return this.menuRecipeMapper.selectRecipeNameByWrapper((Wrapper)Wrappers.lambdaQuery(MenuRecipe.class).eq(MenuRecipe::getRecipeId, recipeId));
//   }
//
//   public MenuEvaluaShopstallVO selectAvgByShopstall(Long shopstallId, Integer delFlag) {
//      return this.menuEvaluaOrderMapper.selectAvgByShopstall(shopstallId, delFlag);
//   }

   public List<MenuDishes> getMenuDishesList(List<Long> dishesIdList) {
      return this.menuDishesService.list((Wrapper)((LambdaQueryWrapper<MenuDishes>)Wrappers.lambdaQuery(MenuDishes.class).in(MenuDishes::getDishesId, dishesIdList)).eq(MenuDishes::getDelFlag, LeConstants.COMMON_NO));
   }

   public Set<Long> changeSurplusNum(List<MenuRecipeChangeSurplusNum> changeSurplusNumList, Long custId, Integer mealtimeType,
                                     LocalDate ordGoodsDate) {
      return this.menuRecipeService.changeSurplusNum(changeSurplusNumList, custId, mealtimeType, ordGoodsDate);
   }
//
//   public Boolean checkRecipeShopstall(Long canteenId, Long shopstallId) {
//      LambdaQueryWrapper<MenuRecipe> wrapper = Wrappers.lambdaQuery();
//      if (ObjectUtil.isNull(canteenId)) {
//         return false;
//      } else {
//         if (ObjectUtil.isNotNull(canteenId)) {
//            wrapper.eq(MenuRecipe::getCanteenId, canteenId);
//         }
//
//         if (ObjectUtil.isNotNull(shopstallId)) {
//            wrapper.eq(MenuRecipe::getStallId, shopstallId);
//         }
//
//         Integer recipeExist = this.menuRecipeMapper.selectExistByWrapper((Wrapper)wrapper.last("limit 1"));
//         return ObjectUtil.isNotNull(recipeExist);
//      }
//   }

   public Map<Long, String> getRecipeMapByIdList(Long... recipeIdList) {
      List<MenuRecipe> recipeList = this.menuRecipeMapper.selectRecipeNameMap(Wrappers
              .lambdaQuery(MenuRecipe.class).in(MenuRecipe::getRecipeId, Arrays.asList(recipeIdList)));
      Map<Long, String> resultMap = Maps.newHashMap();
      if (ObjectUtil.isNotEmpty(recipeList)) {
         recipeList.forEach((r) -> {
            resultMap.put(r.getRecipeId(), r.getRecipeName());
         });
      }

      return resultMap;
   }
//
//   public Integer menuRecipeCount(Integer mealtimeType, Long dishesId, LocalDate nowDate) {
//      return this.menuDishesService.menuRecipeCount(mealtimeType, dishesId, nowDate);
//   }
//
//   public DishQueryVO queryAllDishes(DishQueryDTO dishQueryDTO) {
//      Page<DishVO> page = new Page((long)dishQueryDTO.getPageNum(), (long)dishQueryDTO.getPageSize());
//      page = this.menuDishesMapper.selectOpenMenuDishesList(page, dishQueryDTO);
//      DishQueryVO dishQueryVO = new DishQueryVO();
//      dishQueryVO.setCount(page.getTotal());
//      dishQueryVO.setCustomerList(page.getRecords());
//      return dishQueryVO;
//   }
//
//   public Long addDishes(DishSyncDTO dishSyncDTO) {
//      return this.menuDishesService.thirdSaveDishes(dishSyncDTO);
//   }
//
//   public DishSyncDTO getDishes(String inventoryId) {
//      return this.menuDishesService.getDishesByInventoryId(inventoryId);
//   }
//
//   public MaterialSomeInfoVO getMaterialByName(String materialName, String unitName) {
//      return this.menuMaterialMapper.getMaterialByName(materialName, unitName, DelFlagEnum.DEL_FALSE.key());
//   }
//
//   public List<MenuDishesTypeVo> getAllDishesTypes(boolean includeDeleted) {
//      List<MenuDishesType> menuDishesTypes = this.menuDishesTypeMapper.selectList(Wrappers.lambdaQuery(MenuDishesType.class).eq(!includeDeleted, MenuDishesType::getDelFlag, LeConstants.COMMON_NO));
//      return BeanUtil.copyToList(menuDishesTypes, MenuDishesTypeVo.class);
//   }
//
//   public List<Long> listCategoryChild(List<Long> cagegoryIdList, Integer materialType) {
//      if (ObjectUtil.isEmpty(cagegoryIdList)) {
//         return cagegoryIdList;
//      } else {
//         LambdaQueryWrapper<MenuMaterialCategory> lambdaQueryWrapper = new LambdaQueryWrapper();
//         lambdaQueryWrapper.eq(MenuMaterialCategory::getDelFlag, DelFlagEnum.DEL_FALSE.key());
//         if (ObjectUtil.isNotEmpty(materialType)) {
//            lambdaQueryWrapper.eq(MenuMaterialCategory::getCategoryType, materialType);
//         }
//
//         List<MenuCategoryTreeVO> categoryTreeVOList = this.menuMaterialCategoryMapper.selectCategoryTree(lambdaQueryWrapper);
//         List<MenuCategoryTreeVO> childList = TreeNodeUtil.getChildList(categoryTreeVOList, cagegoryIdList);
//         if (ObjectUtil.isNotEmpty(childList)) {
//            assert childList != null;
//
//            cagegoryIdList = (List)childList.stream().map(BaseTreeNode::getId).collect(Collectors.toList());
//         }
//
//         return cagegoryIdList;
//      }
//   }
//
//   public List<ProductCategoryListVO> listProductCategory() {
//      return this.menuMaterialCategoryMapper.listProductCategory(MaterialTypeEnum.GOODS.key(), DelFlagEnum.DEL_FALSE.key());
//   }
//
//   public List<MenuLabelAndNutritionVO> getDishesLabelAndNutritionList(List<Long> dishesIdList) {
//      return (List)(ObjectUtil.isEmpty(dishesIdList) ? Lists.newArrayList() : this.menuDishesMapper.selectDishesLabelAndNutritionList(dishesIdList));
//   }
//
//   public List<DishesCookLabelVO> queryDishesCookLabelList(List<Long> dishesIdList) {
//      return this.menuDishesMapper.queryDishesCookLabelList(dishesIdList);
//   }
//
//   public List<MenuDishesMaterialModel> listDishesMaterial(List<Long> dishesIdList) {
//      return this.menuDishesMapper.listDishesMaterial(dishesIdList, MenuSalesTypeEnum.PORTION_ON.key());
//   }
//
//   public Long getUnitIdByMaterialId(Long materialId) {
//      MenuMaterial menuMaterial = (MenuMaterial)this.menuMaterialMapper.selectOne(((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuMaterial.class).eq(MenuMaterial::getMaterialId, materialId)).select(new SFunction[]{MenuMaterial::getUnitId}));
//      return menuMaterial.getUnitId();
//   }
//
//   public Long checkMaterialNameAndUnit(String materialName, String unitName, Long areaId) {
//      return this.menuMaterialMapper.checkMaterialNameAndUnit(materialName, unitName, areaId);
//   }
//
//   public List<MenuDishesSaleModel> getDishesSaleList(List<Integer> customIdList) {
//      return (List)(ObjectUtil.isEmpty(customIdList) ? Lists.newArrayList() : this.menuDishesMapper.selectDishesSaleModelList((Wrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuDishes.class).eq(MenuDishes::getDelFlag, DelFlagEnum.DEL_FALSE.key())).in(MenuDishes::getCustomId, customIdList)));
//   }
//
//   public List<MenuBaseDishesIdDTO> listBaseDishedId(List<Long> dishesIdList, List<Long> baseDishesIdList) {
//      return this.menuDishesMapper.listBaseDishesId(new MenuBaseDishesIdDTO(dishesIdList, baseDishesIdList));
//   }
//
//   public List<MenuDishesSizeModel> listDishesSizeModel() {
//      return this.menuDishesMapper.listDishesSizeModel(MenuSalesTypeEnum.PORTION_ON.key(), DelFlagEnum.DEL_FALSE.key());
//   }

   public List<MenuDishesTypeModel> getDishesTypeName(List<Long> dishesIdList) {
      return (List)(ObjectUtil.isEmpty(dishesIdList) ? Lists.newArrayList() : this.menuDishesMapper
              .selectDishesTypeNameAndIdList(dishesIdList));
   }
//
//   public void asyncUpdateDishesNutrition(Long materialId) {
//      log.info("异步更新菜品营养信息,输入id: {}", materialId);
//      this.menuDishesService.updateDishesNutrition(Collections.singletonList(materialId));
//   }
//
//   public void asyncUpdateDishesNutritionByNutritionId(Long nutritionId) {
//      log.info("异步更新菜品营养信息,营养信息id: {}", nutritionId);
//      this.menuDishesService.updateDishesNutritionByNutritionId(nutritionId);
//   }

   public NutritionEntity getNutrientInfo(Map<Long, Double> dishesQuantityMap) {
      return this.menuDishesService.getNutrientInfo(dishesQuantityMap);
   }
//
//   public List<NutritionGetDishesVo> nutritionGetDishes(NutritionGetDishesDto nutritionGetDishesDto) {
//      return this.menuDishesService.nutritionGetDishes(nutritionGetDishesDto);
//   }
//
//   public MenuDishesAiConfig getMenuDishesAiConfig(Long dishesId) {
//      return this.menuDishesAiConfigService.getMenuDishesAiConfig(dishesId);
//   }
//
//   public MenuDishesAiConfig updateMenuDishesAiConfig(MenuDishesAiConfigDTO menuDishesAiConfig) {
//      return this.menuDishesAiConfigService.updateMenuDishesAiConfig(menuDishesAiConfig);
//   }
//
//   public String checkLimitFlag(Integer limitFlag) {
//      if (ObjectUtil.equals(limitFlag, 1)) {
//         long count = this.menuDishesService.count((Wrapper)Wrappers.lambdaQuery(MenuDishes.class).eq(MenuDishes::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
//         if (count > (long)MenuConstant.MAX_CUSTOM_ID) {
//            return I18n.getMessage("menu_dishes_max_over", new Object[0]);
//         }
//      }
//
//      return null;
//   }
//
//   public List<MenuDishesStepDetailVo> getMenuDishesStepDetail(Long baseDishesId, Integer stepType, Long materialId) {
//      return this.menuDishesStepDetailService.getMenuDishesStepDetail(baseDishesId, stepType, materialId);
//   }
//
//   public Boolean existMaterialProcess(Long functionId) {
//      return ((MenuDishesStepDetailMapper)this.menuDishesStepDetailService.getBaseMapper()).exists((Wrapper)Wrappers.lambdaQuery(MenuDishesStepDetail.class).eq(MenuDishesStepDetail::getFunctionId, functionId));
//   }
//
//   public Long addMaterialFunction(MaterialFunctionAddDTO dto) {
//      MenuMaterialFunction materialFunction = (MenuMaterialFunction)this.menuMaterialFunctionMapper.selectOne(((LambdaQueryWrapper)((LambdaQueryWrapper)((LambdaQueryWrapper)Wrappers.lambdaQuery(MenuMaterialFunction.class).eq(MenuMaterialFunction::getMaterialId, dto.getMaterialId())).eq(MenuMaterialFunction::getType, dto.getType())).eq(MenuMaterialFunction::getContent, dto.getContent())).select(new SFunction[]{MenuMaterialFunction::getFunctionId}));
//      if (ObjectUtil.isNotEmpty(materialFunction)) {
//         return materialFunction.getFunctionId();
//      } else {
//         MenuMaterialFunction menuMaterialFunction = new MenuMaterialFunction();
//         BeanUtil.copyProperties(dto, menuMaterialFunction, new String[0]);
//         this.menuMaterialFunctionMapper.insert(menuMaterialFunction);
//         return menuMaterialFunction.getFunctionId();
//      }
//   }
//
//   public List<DishesNutritionDto> getDishesNutrition(List<Long> dishesIdList) {
//      return this.menuDishesService.getDishesNutrition(dishesIdList);
//   }
//
//   public List<Long> listAllCategoryIdById(List<Long> categoryIdList) {
//      if (CollUtil.isEmpty(categoryIdList)) {
//         return categoryIdList;
//      } else {
//         List<BaseTreeNode> categoryTreeVOList = this.menuMaterialCategoryMapper.listIdAndParentId();
//         List<BaseTreeNode> childList = TreeNodeUtil.getChildList(categoryTreeVOList, categoryIdList);
//         if (ObjectUtil.isNotEmpty(childList)) {
//            assert childList != null;
//
//            categoryIdList = (List)childList.stream().map(BaseTreeNode::getId).collect(Collectors.toList());
//         }
//
//         return categoryIdList;
//      }
//   }
//
//   public List<MenuBaseDishesDetail> getBaseDishesDetail(List<Long> baseDishesIdList) {
//      return (List)(CollUtil.isEmpty(baseDishesIdList) ? Lists.newArrayList() : this.menuDishesMapper.getBaseDishesDetail(baseDishesIdList));
//   }
//
//   // $FF: synthetic method
//   private static Object $deserializeLambda$(SerializedLambda lambda) {
//      switch (lambda.getImplMethodName()) {
//         case "getContent":
//            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/MenuMaterialFunction") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//               return MenuMaterialFunction::getContent;
//            }
//            break;
//         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/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishes::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/MenuDishesType") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishesType::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/MenuMaterialCategory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuMaterialCategory::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/MenuMaterial") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuMaterial::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/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishes::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/MenuDishesType") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishesType::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/MenuMaterialCategory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuMaterialCategory::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/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishes::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/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuDishes::getDelFlag;
//            }
//            break;
//         case "getUnitId":
//            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/MenuMaterial") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuMaterial::getUnitId;
//            }
//            break;
//         case "getFunctionId":
//            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/MenuDishesStepDetail") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuDishesStepDetail::getFunctionId;
//            }
//
//            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/MenuMaterialFunction") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuMaterialFunction::getFunctionId;
//            }
//            break;
//         case "getIfCardNumUse":
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getIfCardNumUse;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getIfCardNumUse;
//            }
//            break;
//         case "getTypeId":
//            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/MenuDishesType") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuDishesType::getTypeId;
//            }
//            break;
//         case "getIfCustLimitIdUse":
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getIfCustLimitIdUse;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getIfCustLimitIdUse;
//            }
//            break;
//         case "getStallId":
//            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::getStallId;
//            }
//            break;
//         case "getCategoryType":
//            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/MenuMaterialCategory") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuMaterialCategory::getCategoryType;
//            }
//            break;
//         case "getType":
//            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/MenuMaterialFunction") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuMaterialFunction::getType;
//            }
//            break;
//         case "getMaterialId":
//            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/MenuMaterial") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuMaterial::getMaterialId;
//            }
//
//            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/MenuMaterialFunction") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuMaterialFunction::getMaterialId;
//            }
//            break;
//         case "getCustomId":
//            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/Integer;")) {
//               return MenuDishes::getCustomId;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getCustomId;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getCustomId;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getCustomId;
//            }
//
//            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/MenuCustomDict") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) {
//               return MenuCustomDict::getCustomId;
//            }
//
//            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/Integer;")) {
//               return MenuDishes::getCustomId;
//            }
//            break;
//         case "getCanteenId":
//            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::getCanteenId;
//            }
//            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/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/MenuDishes") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuDishes::getDishesId;
//            }
//            break;
//         case "getMaterialName":
//            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/MenuMaterial") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) {
//               return MenuMaterial::getMaterialName;
//            }
//            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/MenuRecipe") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) {
//               return MenuRecipe::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");
//   }
}
