private void batchData(List<Map> dataList) throws IOException {标签:dataList,分批,List,newList,集合,数据,size From: https://www.cnblogs.com/shalen/p/16838252.html
//分批处理
if(dataList != null && dataList.size() > 0) {
Integer size = dataList.size();//数据总量
//判断是否需要分批
if (pointsDataLimit < size) {
List<Map> newList = new ArrayList<>();
for (int i = 0; i < size; i++) {
newList.add(dataList.get(i));
if(pointsDataLimit == newList.size()|| i == dataList.size()-1){
System.out.print("截取出来的数据:"+newList+"\n");
newList.clear();//剔除数据
}
}
}else{
System.out.print("数据已经不需要分批");
}
}
}