private AjaxResult exportselecttransportAllExport(List list, HttpServletResponse response) throws IOException {
// 总数据
TemplateExportParams params = new TemplateExportParams(JDWLConfig.getProfile() + "/poi/n_transportAllReport.xlsx");
Map<String, Object> map = new HashMap<>();
map.put("exportselecttransportAllExportInfos", list);
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
String filename = "单据汇总_"+ DateUtils.myGetTime() +".xlsx";
File savefile = new File(FileUploadUtils.buildCommonDownloadFilePath(filename));
FileOutputStream fos = new FileOutputStream(savefile);
workbook.write(fos);
fos.close();
return AjaxResult.success(filename);
}
java.lang.NullPointerException: null
可能是list中有部分数据为空值,tostring无法转换null导致,需要遍历存入map中的null用空字符串代替
不会写替换list中null为空值的逻辑代码,求指点
你是使用指令还是注解的方式