@Override
public int addScheduleKFGroupAndBsRobotInfoByBatch(List<RobotKFGroupAndBsRobotScheduleParam> list) {
if(null == list || list.isEmpty()){
return 0;
}
if(list.size()<= RobotSiteServiceImpl.DB_PATCH_INSERT_SIZE){
robotSiteDao.addScheduleKFGroupAndBsRobotInfoByBatch(list);
}else{
int size = 0;
while(true){//通过对list的分批处理实现分批入库
List<RobotKFGroupAndBsRobotScheduleParam> iteams =
list.stream().skip(size).limit(RobotSiteServiceImpl.DB_PATCH_INSERT_SIZE).collect(Collectors.toList());
if(iteams == null || iteams.isEmpty()){
break;
}else{
robotSiteDao.addScheduleKFGroupAndBsRobotInfoByBatch(iteams);
size += iteams.size();
}
}
}
return list.size();
}