/**
* 把大数据量的List拆分
* @param bigList 需要导出的Excel数据
* @param capacity 子List的最大存储数据量
* */
@SuppressWarnings({ "rawtypes", "unchecked" })
public static List getSplitList(List bigList,int capacity){
List<List> splitList = new ArrayList<List>();
//得到将要拆分的List的子List的数量
int count = bigList.size()%capacity > 0 ? bigList.size()/capacity + 1 : bigList.size()/capacity;
for(int i = 0;i < count;i++){
List smallList = new ArrayList<>();
for(int j =capacity*i;j<Math.min(capacity*(i+1), bigList.size());j++){
smallList.add(bigList.get(j));
}
splitList.add(smallList);
}
return splitList;
}