Procházet zdrojové kódy

树形结构修改

gao.qiang před 1 rokem
rodič
revize
c0d22df820

+ 6 - 4
business-service/src/main/java/com/ozs/service/service/impl/BaseDeviceDynamicManagementServiceImpl.java

@@ -72,9 +72,11 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
 
 
                 if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()))) {
-                    CameraTree cameraTree1 = map.get(o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"));
+                    CameraTree cameraTree1 = map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"));
                     if (ObjectUtils.isEmpty(cameraTree1)) {
-                        map.put(o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"), build1);
+                        map.put(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"), build1);
+                        map.get(o.getRailwayCode()).getChildren().add(build1);
+                    }else {
                         map.get(o.getRailwayCode()).getChildren().add(build1);
                     }
                 }
@@ -88,8 +90,8 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
                         .build();
 
 
-                if (!ObjectUtils.isEmpty(map.get(o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")))) {
-                    map.get(o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")).getChildren().add(build2);
+                if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")))) {
+                    map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")).getChildren().add(build2);
                 }
             }
         }