数据异常导出失败

This commit is contained in:
wangliwen 2022-10-18 15:43:22 +08:00
parent a4047352c1
commit f2a1b152a8
1 changed files with 11 additions and 11 deletions

View File

@ -485,11 +485,11 @@ public class CensusController {
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusResourceTable(params); ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusResourceTable(params);
List<List<Object>> date = resultList.stream().map(index -> { List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>(); List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("deptName", "")); data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
data.add(index.getOrDefault("type", "")); data.add(index.getOrDefault("type", "") == null ? "" : index.getOrDefault("type", "").toString());
data.add(index.getOrDefault("resourceName", "")); data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString());
data.add(index.getOrDefault("createDate", "")); data.add(index.getOrDefault("createDate", "") == null ? "" : index.getOrDefault("createDate", "").toString());
data.add(index.getOrDefault("approveStatus", "").toString()); data.add(index.getOrDefault("approveStatus", "") == null ? "" : index.getOrDefault("approveStatus", "").toString());
return data; return data;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
@ -550,12 +550,12 @@ public class CensusController {
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusApplyTable(params); ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusApplyTable(params);
List<List<Object>> date = resultList.stream().map(index -> { List<List<Object>> date = resultList.stream().map(index -> {
List<Object> data = new ArrayList<>(); List<Object> data = new ArrayList<>();
data.add(index.getOrDefault("resourceDeptName", "")); data.add(index.getOrDefault("resourceDeptName", "") == null ? "" : index.getOrDefault("resourceDeptName", "").toString());
data.add(index.getOrDefault("resourceName", "")); data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString());
data.add(index.getOrDefault("type", "")); data.add(index.getOrDefault("type", "") == null ? "" : index.getOrDefault("type", "").toString());
data.add(index.getOrDefault("deptName", "")); data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
data.add(index.getOrDefault("createDate", "")); data.add(index.getOrDefault("createDate", "") == null ? "" : index.getOrDefault("createDate", "").toString());
data.add(index.getOrDefault("approveStatus", "")); data.add(index.getOrDefault("approveStatus", "") == null ? "" : index.getOrDefault("approveStatus", "").toString());
return data; return data;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");