public void excelExport(String excelTemplatesPath, String excelExportPath, List lists) {
String template = excelTemplatesPath;
ExcelWriter build = EasyExcel.write(excelExportPath).withTemplate(template).build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(true).build();
int sheetNo=0;
for(ExcelData excelData :lists){
WriteSheet sheet= EasyExcel.writerSheet(excelData.getSheetNo(),excelData.getSheetName()).build();
build.fill(excelData.getData(), fillConfig, sheet);
}
build.finish();
}
//接口上面是实现类
/**
* 报表以excel方式导出
*
* @param excelTemplatesPath 模版路径
* @param excelExportPath 导出路径
* @param lists 表格数据
*/
void excelExport(String excelTemplatesPath, String excelExportPath, List<ExcelData> lists );
}