Blueherb In solitude, where we are least alone 王佳鑫

easyexecl 文件损坏记录

点击查看代码
 // sheet页角标
            int sheetNum = 1;
            for (int i = 0; i < excelSize; i++) {
if (i < (patchListCount / maxSize) + 1) {
                    if (patchListCount > maxSize) {
                      // 分页查询
                          dataByOperatorExcel = 
                        if (i == 0) {
                            // 不能提取到最外面,否则直接走else   会造成sheet 重复,文件无法打开
                            writeSheet = EasyExcelFactory.writerSheet(patchSheetName).build();
                            // 获取补丁 sheet和 writer-------为了 100万数据分俩次写入同一个sheet
                            writer = getExcelWriter(path, patchListTitle, patchSheetName, writer);
                        }

                        if (i % 2 == 0 && i !=0) {// 超过1000000万下一个sheet页
                            writeSheet = EasyExcelFactory.writerSheet(patchSheetName + sheetNum).build();
                            sheetNum++;
                        }
                        // 根据自定义列获取数据
                        List<List<Object>> lists = ExcelUtils.contentData(dataByOperatorExcel, patchPropertyList);
                        writer.write(lists, writeSheet);

                    } else {
                        //分页查询

                        // 导出
                    }
                }
}
posted @ 2022-06-21 11:19  阿呆学习之路  阅读(464)  评论(0编辑  收藏  举报