触发场景描述 直接生成的excel无法获取exce总行数,需要手动编辑一次excel保存后才可获取到. 版本:2.2.3 触发Bug的代码
convert("C:\\Users\\a\\Desktop\\test.csv",
"C:\\Users\\a\\Desktop\\test.xlsx");
ExcelReader excelReader = EasyExcel.read(new File("C:\\Users\\a\\Desktop\\test.xlsx"), HospitalVisitInfoIMO.class, new AnalysisEventListener() {
@Override
public void invoke(Object o, AnalysisContext analysisContext) {
log.info("读取excel总条数:"+analysisContext.getTotalCount());
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).build();
ReadSheet readSheet = EasyExcel.readSheet(0).headRowNumber(1).build();
excelReader.read(readSheet);
excelReader.finish();
提示的异常或者没有达到的效果 预期输出:读取excel总条数:14 实际输出:读取excel总条数:1
MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取并转换数据:14条 MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 转换总耗时1秒 MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1 -MS- 2020-09-17 17:29:57 [main] INFO c.s.r.m.b.data.utils.CvsToExcelUtil - 读取excel总条数:1