|
@@ -477,9 +477,13 @@ public class RelationReportService implements IRelationReportService {
|
|
|
if (!levelMap.containsKey(secondCategoryMes.getId())){
|
|
|
topList.add(this.transfer(secondCategoryMes));
|
|
|
}
|
|
|
+ List<JSONObject> threeLevelList = levelMap.getOrDefault(graphDefine.getCode(), new ArrayList<>());
|
|
|
+ if (CollUtil.isEmpty(threeLevelList)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
List<JSONObject> sonList = levelMap.getOrDefault(secondCategoryMes.getId(), new ArrayList<>());
|
|
|
JSONObject secondLevel = this.transfer(graphDefine);
|
|
|
- secondLevel.put("relationTypeProjectList",levelMap.getOrDefault(graphDefine.getCode(),new ArrayList<>()));
|
|
|
+ secondLevel.put("relationTypeProjectList",threeLevelList);
|
|
|
sonList.add(secondLevel);
|
|
|
sonList.sort(Comparator.comparing(b -> b.getString("graphTypeCode")));
|
|
|
levelMap.put(secondCategoryMes.getId(),sonList);
|
|
@@ -487,8 +491,14 @@ public class RelationReportService implements IRelationReportService {
|
|
|
if (CollUtil.isEmpty(topList)){
|
|
|
return;
|
|
|
}
|
|
|
- for (JSONObject top : topList) {
|
|
|
- top.put("childGraphicTypeList",levelMap.getOrDefault(top.getString("graphTypeId"),new ArrayList<>()));
|
|
|
+ for (int i = topList.size() - 1; i >= 0; i--) {
|
|
|
+ JSONObject top = topList.get(i);
|
|
|
+ List<JSONObject> secondLevelList = levelMap.getOrDefault(top.getString("graphTypeId"), new ArrayList<>());
|
|
|
+ if (CollUtil.isEmpty(secondLevelList)){
|
|
|
+ topList.remove(i);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ top.put("childGraphicTypeList",secondLevelList);
|
|
|
}
|
|
|
// 顶级按sort排序
|
|
|
topList.sort(Comparator.comparing(b -> b.getIntValue("sort")));
|