Commit 6165377f authored by qinhu's avatar qinhu

质量导出---去掉null

parent bc112b05
......@@ -82,7 +82,7 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
List<QualityApply> list = this.list(qw);
//找到所有项目id归类
Set<Integer> projectIds = list.stream().map(QualityApply::getProjectId).collect(Collectors.toSet());
String[] headers = new String[31];
String[] headers = null;
List<Object[]> datas = new ArrayList<>();
//关联部门名字
Set<Integer> userIds = list.stream()
......@@ -113,12 +113,11 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
userGroupMap.put(arg.getId(), opt.getName());
}
}));
if (userGroupMap.size() == 0){
if (userGroupMap.size() == 0) {
return;
}
for (Integer projectId : projectIds) {
//找到每个项目的检测组 以检测组归类
Set<Integer> teamIds = list.stream()
......@@ -149,7 +148,11 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
objs[6] = "部门";
objs[7] = "分析";
for (int i = 0; i < teams.size(); i++) {
objs[8 + i] = teams.get(i);
String teamName = teams.get(i);
if (teamName.contains("\"")) {
teamName = teamName.replace("\"", "");
}
objs[8 + i] = teamName;
}
datas.add(objs);
});
......@@ -169,11 +172,16 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
//添加名字
objs[7] = arg.getUserName();
for (int i = 0; i < inputValus.size(); i++) {
objs[8 + i] = inputValus.get(i);
String value = inputValus.get(i);
if (value == null){
value = "0";
}
for (int i = 0; i < inputValus.size(); i++) {
objs[8 + i] = inputValus.get(i);
if ( value.contains("\"")) {
value = value.replace("\"", "");
}
objs[8 + i] = value;
}
datas.add(objs);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment