|
@@ -44,6 +44,16 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
|
|
|
List<BaseCameraManagementDto> list = baseDeviceDynamicManagementMapper.list(cameraTreeVo);
|
|
|
if (list.size() > 0) {
|
|
|
for (BaseCameraManagementDto o : list) {
|
|
|
+ //行别字符串
|
|
|
+ String lineDirName = "";
|
|
|
+ if ("1".equals(o.getLineDir())) {
|
|
|
+ lineDirName = "上行";
|
|
|
+ } else if ("2".equals(o.getLineDir())) {
|
|
|
+ lineDirName = "下行";
|
|
|
+ } else if ("3".equals(o.getLineDir())) {
|
|
|
+ lineDirName = "上下行";
|
|
|
+ }
|
|
|
+
|
|
|
// 线路
|
|
|
CameraTree build = CameraTree.builder()
|
|
|
.code(o.getRailwayCode())
|
|
@@ -78,17 +88,17 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
|
|
|
// 里程
|
|
|
String mils = AppendUtils.stringAppend(o.getInstallMile());
|
|
|
CameraTree build1 = CameraTree.builder()
|
|
|
- .code(mils + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"))
|
|
|
- .name(mils + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"))
|
|
|
+ .code(mils + "-" + lineDirName)
|
|
|
+ .name(mils + "-" + lineDirName)
|
|
|
.flay(true)
|
|
|
.publicWorksSection(o.getPublicWorksSection())
|
|
|
.mileage(o.getInstallMile())
|
|
|
.children(new ArrayList<>())
|
|
|
.build();
|
|
|
if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()))) {
|
|
|
- CameraTree cameraTree1 = map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"));
|
|
|
+ CameraTree cameraTree1 = map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + lineDirName);
|
|
|
if (ObjectUtils.isEmpty(cameraTree1)) {
|
|
|
- map.put(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"), build1);
|
|
|
+ map.put(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + lineDirName, build1);
|
|
|
map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()).getChildren().add(build1);
|
|
|
}
|
|
|
}
|
|
@@ -100,8 +110,8 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
|
|
|
.publicWorksSection(o.getPublicWorksSection())
|
|
|
.children(new ArrayList<>())
|
|
|
.build();
|
|
|
- if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")))) {
|
|
|
- map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")).getChildren().add(build2);
|
|
|
+ if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + lineDirName))) {
|
|
|
+ map.get(o.getRailwayCode()+"-"+o.getPublicWorksSection()+"-"+o.getInstallMile() + "-" + lineDirName).getChildren().add(build2);
|
|
|
}
|
|
|
}
|
|
|
}
|