Parcourir la source

场站期次线路树

wangchangsheng il y a 2 ans
Parent
commit
287de1f19b

+ 23 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/BackController.java

@@ -3,6 +3,7 @@ package com.gyee.backconfig.controller;
 
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.Companys;
+import com.gyee.backconfig.model.auto.Windpowerstation;
 import com.gyee.backconfig.service.BackConfigService;
 import com.gyee.backconfig.vo.Companysvo;
 import com.gyee.backconfig.vo.Projectvo;
@@ -43,4 +44,26 @@ public class BackController {
             return R.error().message("访问失败");
         }
     }
+
+
+    /**
+     * 场站树
+     *
+     * @return
+     */
+    @GetMapping(value ="/sttree")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R stationtree() {
+        List<Windpowerstation> resultList = backConfigService.stationtree();
+        if (StringUtils.isNotNull(resultList)) {
+            return com.gyee.backconfig.config.R.ok((int) resultList.size()).data(resultList);
+        } else {
+            return R.error().message("访问失败");
+        }
+    }
+
+
+
+
 }

+ 4 - 2
web/backmanagerconfig/src/main/java/com/gyee/backconfig/model/auto/Project.java

@@ -1,11 +1,10 @@
 package com.gyee.backconfig.model.auto;
 
-import java.math.BigDecimal;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -69,4 +68,7 @@ public class Project extends Model {
 
     @TableField("ORDERNUM")
     private Integer ordernum;
+
+    @TableField(exist = false)
+    private List<Line> Children = new ArrayList<>();
 }

+ 22 - 0
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/BackConfigService.java

@@ -470,4 +470,26 @@ public class BackConfigService {
 //        });
         return cpls;
     }
+
+
+    public List<Windpowerstation> stationtree() {
+
+        List<Windpowerstation> wpls = CacheContext.wpls;
+        List<Project> prols= CacheContext.prols;
+        List<Line> lines = CacheContext.lines;
+        wpls.forEach(wpl -> {
+            List<Project> projects = prols.stream().filter(l -> l.getWindpowerstationid().equals(wpl.getId())).collect(Collectors.toList());
+            wpl.getChildren().addAll(projects);
+        });
+
+        prols.forEach(prol -> {
+
+            List<Line> lineList = lines.stream().filter(l->l.getProjectid().equals(prol.getId())).collect(Collectors.toList());
+            prol.getChildren().addAll(lineList);
+
+        });
+
+        return wpls;
+    }
+
 }

+ 6 - 8
web/backmanagerconfig/src/main/java/com/gyee/backconfig/service/PointGenerateService.java

@@ -94,13 +94,6 @@ public class PointGenerateService {
     }
 
 
-    private String  codeRules(){
-
-
-        return null;
-    }
-
-
 
     private List<Windpowerstationpointnew> fjd(Standardpoint p, List<Companys> companysList) {
         List<Windpowerstationpointnew> stationList = new ArrayList<>();
@@ -215,6 +208,7 @@ public class PointGenerateService {
                     stationpoint.setCode(stationsb.toString() + "XX_XX_XXX_" + p.getUniformcode());
                     stationpoint.setName(station.getName() + p.getName());
                     stationpoint.setUniformcode(p.getUniformcode());
+                    stationpoint.setRealtimeid(substaion + (station.getId().endsWith("_FDC") ? "FCJSFW" : "GCJSFW"));
                     stationList.add(stationpoint);
 
                     List<Project> projectList = projectService.getList(station.getId());
@@ -236,6 +230,7 @@ public class PointGenerateService {
                         stationpoint.setCode(projectsb.toString()+"_XX_XXX_"+p.getUniformcode());
                         stationpoint.setName(project.getName() + p.getName());
                         stationpoint.setUniformcode(p.getUniformcode());
+                        stationpoint.setRealtimeid(substaion + (station.getId().endsWith("_FDC") ? "FCJSFW" : "GCJSFW"));
                         stationList.add(stationpoint);
 
                         List<Line> lineList = lineService.getList(project.getId());
@@ -257,6 +252,7 @@ public class PointGenerateService {
                             stationpoint.setCode(linesb.toString());
                             stationpoint.setName(l.getName() + p.getName());
                             stationpoint.setUniformcode(p.getUniformcode());
+                            stationpoint.setRealtimeid(substaion + (station.getId().endsWith("_FDC") ? "FCJSFW" : "GCJSFW"));
                             stationList.add(stationpoint);
 
                         }
@@ -290,9 +286,9 @@ public class PointGenerateService {
                 testing = new Windturbinetestingpointnew();
                 //fjjs
                 //fjjcd
+                String substaion = station.getId().substring(0, station.getId().indexOf("_"));
                 if ("fjjs".equals(p.getType())) {
                     StringBuilder stationsb = new StringBuilder();
-                    String substaion = station.getId().substring(0, station.getId().indexOf("_"));
                     stationsb.append(substaion).append(station.getId().endsWith("_FDC") ? "FJJSFW." : "GFJSFW.");
                     stationsb.append("SX_JN_").append(substaion);
                     stationsb.append(station.getId().endsWith("_FDC") ? "F" : "G").append("_JS_");
@@ -306,8 +302,10 @@ public class PointGenerateService {
                     //BHB3FJJSFW.SX_JN_BHB3F_JS_P1_L30_001_CI0060
                     //SYGFJSFW.SX_JN_SYG_JS_P2_L3_NBQ0061_CI0174
                     testing.setCode(stationsb.toString() + p.getUniformcode());
+                    testing.setRealtimeid(substaion + (station.getId().endsWith("_FDC") ? "FJJSFW" : "GFJSFW"));
                 } else if ("fjjcd".equals(p.getType())) {
                     testing.setCode("INITIAL");
+                    testing.setRealtimeid(substaion + (station.getId().endsWith("_FDC") ? "FJ" : "GF"));
                 }
 
                 testing.setName(w.getName() + p.getName());