package com.bonus.core.menu.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.core.menu.entity.MenuRecipeDishes;
import com.bonus.core.menu.mapper.MenuRecipeDishesMapper;
import com.bonus.core.menu.service.MenuRecipeDishesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
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 extends ServiceImpl<MenuRecipeDishesMapper, MenuRecipeDishes> implements MenuRecipeDishesService {
   private static final Logger log = LoggerFactory.getLogger(MenuRecipeDishesServiceImpl.class);

   @Resource
   private MenuRecipeDishesMapper menuRecipeDishesMapper;

   @Override
   public boolean saveBatch(Collection<MenuRecipeDishes> entityList) {
      Iterator var2 = CollUtil.split(entityList, 500).iterator();

      while(var2.hasNext()) {
         List<MenuRecipeDishes> menuRecipeDishes = (List)var2.next();
         menuRecipeDishesMapper.insertValues(menuRecipeDishes);
      }

      return true;
   }

}
