Explorar o código

Merge branch 'develop' of http://39.106.8.246:3003/BDTP/adm-middleware.git into develop

zhangqiankun %!s(int64=3) %!d(string=hai) anos
pai
achega
2095efd062

+ 13 - 3
src/main/java/com/persagy/proxy/adm/service/impl/RelationReportService.java

@@ -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")));