Browse Source

查询系统-设备树bug修复

linhuili 3 years ago
parent
commit
82f6116ac2

+ 18 - 2
src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -161,13 +161,29 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         for (AdmObjectType major : allMajor) {
             //设置专业
             if(CollUtil.isNotEmpty(majorSystemMap)){
+                if("system".equals(major) || "equipment".equals(major)){
+                    continue;
+                }
                 //专业下的系统
                 List<AdmObjectType> systemCodes = majorSystemMap.get(major.getCode());
-                major.setChildren(systemCodes);
+                if(CollUtil.isEmpty(systemCodes)){
+                    major.setChildren(new ArrayList<>());
+                }else{
+                    major.setChildren(systemCodes);
+                }
+                
                 //系统下的设备类
                 if(CollUtil.isNotEmpty(systemEquipMap) && CollUtil.isNotEmpty(systemCodes)){
                     for (AdmObjectType systemType : systemCodes) {
-                        systemType.setChildren(systemEquipMap.get(systemType.getCode()));
+                        if("system".equals(systemType) || "equipment".equals(systemType)){
+                            continue;
+                        }
+                        List<AdmObjectType> systems = systemEquipMap.get(systemType.getCode());
+                        if(CollUtil.isEmpty(systems)){
+                            systemType.setChildren(new ArrayList<>());
+                        }else {
+                            systemType.setChildren(systemEquipMap.get(systemType.getCode()));
+                        }
                     }
                 }
             }