wangchangsheng vor 2 Jahren
Ursprung
Commit
3dde7b0ff8

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/model/auto/ProEconEquipmentmodel.java

@@ -97,7 +97,7 @@ public class ProEconEquipmentmodel extends Model {
     /**
      * 设备类别
      */
-    private Integer equipmentCategory;
+    private String equipmentCategory;
 
     @TableField(exist = false)
     private List<ProBasicModelPower> Children = new ArrayList<>();

+ 56 - 108
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/service/auto/impl/ProEconTestingPointServiceImpl.java

@@ -31,8 +31,19 @@ import java.util.stream.Collectors;
 @Service
 public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPointMapper, ProEconTestingPoint> implements IProEconTestingPointService {
 
-    private final String GCJSFW = "gcjsfw";
-    private final String FCJSFW = "fcjsfw";
+
+
+
+    //gfjsfw
+    private final String GFC = "gfc";
+    //gcjsfw
+    private final String GCC = "gcc";
+    //agcjsfw
+    private final String AGCC = "agcc";
+    //fjjsfw
+    private final String FJC = "fjc";
+    //fcjsfw
+    private final String FCC = "fcc";
 
     @Resource
     private IProEconTestingPointService proEconTestingPointService;
@@ -149,13 +160,13 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
         List<ProEconTestingPoint> list = new ArrayList<>();
         switch (type) {
             case "fj":
-                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("gf") ||  i.getTypeId().equals("fj") || i.getTypeId().equals("fjjsfw")  || i.getTypeId().equals("gfjsfw")).collect(Collectors.toList());
+                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("gf") ||  i.getTypeId().equals("fj") || i.getTypeId().equals(FJC)  || i.getTypeId().equals(GFC)).collect(Collectors.toList());
                 break;
             case "fc":
-                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals(FCJSFW) || i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
+                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals(FCC) || i.getTypeId().equals(GCC)).collect(Collectors.toList());
                 break;
             case "sbs":
-                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") ).collect(Collectors.toList());
+                list = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("agc") || i.getTypeId().equals(AGCC) ).collect(Collectors.toList());
                 break;
             case "ws":
                 list = CacheContext.tpls.stream().filter(i ->  i.getTypeId().equals("cft") || i.getTypeId().equals("qxz")).collect(Collectors.toList());
@@ -219,6 +230,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     }
 
                     sb.append("XX_XX_XXXX_");
+                    sb.append(p.getTypeId().toUpperCase()).append("_");
                     if (p.getUniformCode().indexOf("AI") >= 0) {
                         sb.append("AI");
 
@@ -248,29 +260,18 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     StringBuilder sbtable = new StringBuilder();
 
 
-                    if (p.getTypeId().endsWith("jsfw")) {
-                        sbtable.append(sba).append("JSFW.");
-                        sbtable.append(sb);
-                    } else {
-                        sbtable.append(sba).append(".");
-                        sbtable.append(sb);
-                    }
+                    sbtable.append(sba).append("JSFW.");
+                    sbtable.append(sb);
                     ProBasicPowerstationPoint po = new ProBasicPowerstationPoint();
                     po.setId(StringUtils.getUUID());
-                    if (p.getTypeId().endsWith("jsfw")) {
-                        po.setNemCode(String.valueOf(sbtable));
-                    } else {
                     po.setNemCode("INITIAL");
-                    }
                     sb = new StringBuilder();
                     sb.append(ss.getName()).append(p.getName());
                     po.setName(String.valueOf(sb));
                     po.setWindpowerstationId(ss.getId());
                     po.setUniformCode(p.getUniformCode());
                     po.setTypeId(p.getTypeId());
-                    sb = new StringBuilder();
-                    sb.append(sbtable.toString().substring(0, sbtable.toString().lastIndexOf(".")));
-                    po.setRealtimeId(String.valueOf(sb));
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                     points.add(po);
                 }
                 allpoints.addAll(points);
@@ -326,6 +327,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     }
 
                     sb.append("XX_XX_XXXX_");
+                    sb.append(p.getTypeId().toUpperCase()).append("_");
                     if (p.getUniformCode().indexOf("AI") >= 0) {
                         sb.append("AI");
 
@@ -355,13 +357,8 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     StringBuilder sbtable = new StringBuilder();
 
 
-                    if (p.getTypeId().endsWith("jsfw")) {
-                        sbtable.append(sba).append("JSFW.");
-                        sbtable.append(sb);
-                    } else {
-                        sbtable.append(sba).append(".");
-                        sbtable.append(sb);
-                    }
+                    sbtable.append(sba).append("JSFW.");
+                    sbtable.append(sb);
                     ProBasicPowerstationPoint po = new ProBasicPowerstationPoint();
                     po.setId(StringUtils.getUUID());
 //                    if (p.getTypeId().indexOf("agcjsfw") >= 0 ) {
@@ -375,9 +372,8 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setWindpowerstationId(ws.getId());
                     po.setUniformCode(p.getUniformCode());
                     po.setTypeId(p.getTypeId());
-                    sb = new StringBuilder();
-                    sb.append(sbtable.toString().substring(0, sbtable.toString().lastIndexOf(".")));
-                    po.setRealtimeId(String.valueOf(sb));
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
+
                     points.add(po);
                 }
                 allpoints.addAll(points);
@@ -399,7 +395,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
     public List<ProBasicPowerstationPoint> initalSbs(String station,String[] setpoints) {
         List<ProBasicPowerstationPoint> allpoints = new ArrayList<>();
 
-        List<ProEconTestingPoint> ls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") ).collect(Collectors.toList());
+        List<ProEconTestingPoint> ls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("agc") || i.getTypeId().equals(AGCC) ).collect(Collectors.toList());
         //获取场站
         for (ProBasicPowerstation postation : CacheContext.wpls) {
             if (null != station && !"".equals(station) && !station.equals(postation.getId())) {
@@ -427,6 +423,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     }
 
                     sb.append("XX_XX_XXXX_");
+                    sb.append(p.getTypeId().toUpperCase()).append("_");
                     if (p.getUniformCode().indexOf("AI") >= 0) {
                         sb.append("AI");
 
@@ -456,7 +453,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     StringBuilder sbtable = new StringBuilder();
 
 
-                    if (p.getTypeId().indexOf("agcjsfw") >= 0 ) {
+                    if (p.getTypeId().indexOf(AGCC) >= 0 ) {
                         sbtable.append(sba).append("JSFW.");
                         sbtable.append(sb);
                     } else {
@@ -465,7 +462,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     }
                     ProBasicPowerstationPoint po = new ProBasicPowerstationPoint();
                     po.setId(StringUtils.getUUID());
-                    if (p.getTypeId().indexOf("agcjsfw") >= 0 ) {
+                    if (p.getTypeId().indexOf(AGCC) >= 0 ) {
                         po.setNemCode(String.valueOf(sbtable));
                     } else {
                         po.setNemCode("INITIAL");
@@ -476,11 +473,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setWindpowerstationId(sub.getId());
                     po.setUniformCode(p.getUniformCode());
                     po.setTypeId(p.getTypeId());
-                    sb = new StringBuilder();
-                    sb.append(sbtable.toString().substring(0, sbtable.toString().lastIndexOf(".")));
-                    po.setRealtimeId(String.valueOf(sb));
-
-
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                     points.add(po);
                 }
                 allpoints.addAll(points);
@@ -495,9 +488,9 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
 
         List<ProBasicEquipmentPoint> allpoints = new ArrayList<>();
 
-        List<ProEconTestingPoint> fdls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("fj") || i.getTypeId().equals("fjjsfw")).collect(Collectors.toList());
+        List<ProEconTestingPoint> fdls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("F") || i.getTypeId().equals(FJC)).collect(Collectors.toList());
 
-        List<ProEconTestingPoint> gfls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("gf") || i.getTypeId().equals("gfjsfw")).collect(Collectors.toList());
+        List<ProEconTestingPoint> gfls = CacheContext.tpls.stream().filter(i -> i.getTypeId().equals("G") || i.getTypeId().equals(GFC)).collect(Collectors.toList());
 
         for (ProBasicPowerstation wp : CacheContext.wpls) {
 
@@ -525,7 +518,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
 
 
                         ProEconTestingPoint stp = ls.get(i);
-                        if(!stp.getTypeId().endsWith("fw") && !stp.getModel().equals(wt.getModelId()))
+                        if((!stp.getTypeId().endsWith(FJC) || !stp.getTypeId().endsWith(FJC) )&&!stp.getModel().equals(wt.getModelId()))
                         {
                             continue;
                         }
@@ -562,6 +555,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             sb.append(temp).append("_");
                         }
 
+                        sb.append(stp.getTypeId().toUpperCase()).append("_");
 
                         if (ls.get(i).getUniformCode().indexOf("AI") >= 0) {
                             sb.append("AI");
@@ -625,21 +619,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                         po.setTypeId(stp.getTypeId());
                         po.setWindpowerstationId(wt.getWindpowerstationId());
                         po.setLogicalUnitId(ls.get(i).getLogicalUnitId());
-
-                        if (stp.getUniformCode().indexOf("AI") < 0 && stp.getUniformCode().indexOf("DI") < 0) {
-                            sb = new StringBuilder();
-
-                            sb.append(wp.getId().substring(0, wp.getId().lastIndexOf("_")).replace("_", "")).append(".JSFW").append(sba);
-
-                            po.setRealtimeId(String.valueOf(sb));
-                        } else {
-                            sb = new StringBuilder();
-
-                            sb.append(wp.getId().substring(0, wp.getId().lastIndexOf("_")).replace("_", "")).append(".").append(sba);
-
-                            po.setRealtimeId(String.valueOf(sb));
-                        }
-
+                        po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                         points.add(po);
 
 
@@ -659,14 +639,14 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
     public List<ProBasicPowerstationPoint> initalFc() {
 
         List<ProEconTestingPoint> pointls = CacheContext.tpls.stream()
-                .filter(i -> i.getTypeId().equals(FCJSFW) || i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
+                .filter(i -> i.getTypeId().equals(FCC) || i.getTypeId().equals(GCC)).collect(Collectors.toList());
 
         pointls = pointls.stream().filter(DistinctObject.distinctByKey(p->p.getUniformCode())).collect(Collectors.toList());
 
         List<ProEconTestingPoint> fdpointls = CacheContext.tpls.stream()
-                .filter(i -> i.getTypeId().equals(FCJSFW)).collect(Collectors.toList());
+                .filter(i -> i.getTypeId().equals(FCC)).collect(Collectors.toList());
         List<ProEconTestingPoint> gfpointls = CacheContext.tpls.stream()
-                .filter(i -> i.getTypeId().equals(GCJSFW)).collect(Collectors.toList());
+                .filter(i -> i.getTypeId().equals(GCC)).collect(Collectors.toList());
 
 
         List<ProBasicRegion> regions = proBasicRegionService.list();
@@ -702,6 +682,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
                     sb.append("XXXX_XXX_X_XX_XX_XXXX_");
+                    sb.append(stp.getTypeId().toUpperCase()).append("_");
                     sb.append("CI");
                     sb.append(stp.getNemCode());
 
@@ -730,9 +711,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setUniformCode(stp.getUniformCode());
                     po.setTypeId(stp.getTypeId());
 
-                    sb = new StringBuilder();
-                    sb.append(re.getNemCode()).append(".JSFW");
-                    po.setRealtimeId(String.valueOf(sb));
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
 
 
                     points.add(po);
@@ -760,6 +739,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
                     sb.append(re.getId().substring(0, re.getId().indexOf("_"))).append("_XXXX_XXX_F_XX_XX_XXXX_");
+                    sb.append(stp.getTypeId().toUpperCase()).append("_");
                     sb.append("CI");
                     sb.append(stp.getNemCode());
 
@@ -785,10 +765,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setWindpowerstationId(String.valueOf(tempsb));
                     po.setUniformCode(stp.getUniformCode());
                     po.setTypeId(stp.getTypeId());
-
-                    sb = new StringBuilder();
-                    sb.append(re.getNemCode()).append(".JSFW");
-                    po.setRealtimeId(String.valueOf(sb));
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                     points.add(po);
                 }
 
@@ -813,6 +790,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
                     sb.append(String.valueOf(sba));
                     sb.append(re.getId().substring(0, re.getId().indexOf("_"))).append("_XXXX_XXX_G_XX_XX_XXXX_");
+                    sb.append(stp.getTypeId().toUpperCase()).append("_");
                     sb.append("CI");
                     sb.append(stp.getNemCode());
 
@@ -839,11 +817,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setWindpowerstationId(String.valueOf(tempsb));
                     po.setUniformCode(stp.getUniformCode());
                     po.setTypeId(stp.getTypeId());
-                    sb = new StringBuilder();
-                    sb.append(re.getNemCode()).append(".JSFW");
-                    po.setRealtimeId(String.valueOf(sb));
-
-
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                     points.add(po);
                 }
 
@@ -873,6 +847,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
 
                             sb.append(String.valueOf(sba));
                             sb.append("XXX_X_XX_XX_XXXX_");
+                            sb.append(stp.getTypeId().toUpperCase()).append("_");
                             sb.append("CI");
                             sb.append(stp.getNemCode());
 
@@ -900,10 +875,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             po.setWindpowerstationId(String.valueOf(tempsb));
                             po.setUniformCode(stp.getUniformCode());
                             po.setTypeId(stp.getTypeId());
-                            sb = new StringBuilder();
-                            sb.append(cs.getId()).append(".JSFW");
-                            po.setRealtimeId(String.valueOf(sb));
-
+                            po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
 
                             points.add(po);
                         }
@@ -929,6 +901,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
                             sb.append(String.valueOf(sba));
                             sb.append("XXX_F_XX_XX_XXXX_");
+                            sb.append(stp.getTypeId().toUpperCase()).append("_");
                             sb.append("CI");
                             sb.append(stp.getNemCode());
 
@@ -954,10 +927,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             po.setWindpowerstationId(String.valueOf(tempsb));
                             po.setUniformCode(stp.getUniformCode());
                             po.setTypeId(stp.getTypeId());
-                            sb = new StringBuilder();
-                            sb.append(cs.getId()).append(".JSFW");
-                            po.setRealtimeId(String.valueOf(sb));
-
+                            po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
 
                             points.add(po);
                         }
@@ -984,6 +954,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             sbtable.append(re.getId().substring(0, re.getId().indexOf("_")));
                             sb.append(String.valueOf(sba));
                             sb.append("XXX_G_XX_XX_XXXX_");
+                            sb.append(stp.getTypeId().toUpperCase()).append("_");
                             sb.append("CI");
                             sb.append(stp.getNemCode());
 
@@ -1010,10 +981,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             po.setWindpowerstationId(String.valueOf(tempsb));
                             po.setUniformCode(stp.getUniformCode());
                             po.setTypeId(stp.getTypeId());
-                            sb = new StringBuilder();
-                            sb.append(cs.getId()).append(".JSFW");
-                            po.setRealtimeId(String.valueOf(sb));
-
+                            po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
                             points.add(po);
                         }
 
@@ -1084,7 +1052,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                 sba.append(temp2).append(temp3).append("GC");
                 sb.append(temp).append("_G").append("_XX_XX_XXXX_");
             }
-
+            sb.append(stp.getTypeId().toUpperCase()).append("_");
             sb.append("CI");
             sb.append(stp.getNemCode());
             StringBuilder sbtable = new StringBuilder();
@@ -1105,15 +1073,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
             po.setWindpowerstationId(wp.getId());
             po.setUniformCode(stp.getUniformCode());
             po.setTypeId(stp.getTypeId());
-
-            sb = new StringBuilder();
-
-            if (StringUtils.notEmp(wp.getPhoto())) {
-                sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
-            }
-
-            po.setRealtimeId(String.valueOf(sb));
-
+            po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
             points.add(po);
         }
 
@@ -1164,7 +1124,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                         sb.append("P").append(Integer.valueOf(temp.substring(temp.length() - 2))).append("_");
                         sb.append("XX_XXXX_");
                     }
-
+                    sb.append(stp.getTypeId().toUpperCase()).append("_");
                     sb.append("CI");
                     sb.append(stp.getNemCode());
 
@@ -1187,13 +1147,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                     po.setWindpowerstationId(pj.getId());
                     po.setUniformCode(stp.getUniformCode());
                     po.setTypeId(stp.getTypeId());
-                    sb = new StringBuilder();
-
-                    if (StringUtils.notEmp(wp.getPhoto())) {
-                        sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
-                    }
-
-                    po.setRealtimeId(String.valueOf(sb));
+                    po.setRealtimeId(String.valueOf(sbtable).substring(0,sbtable.indexOf(".")));
 
                     points.add(po);
                 }
@@ -1254,7 +1208,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                             sb.append("XXXX_");
 //                            sb.append(CI);
                         }
-
+                        sb.append(stp.getTypeId().toUpperCase()).append("_");
                         sb.append("CI");
                         sb.append(stp.getNemCode());
 
@@ -1280,13 +1234,7 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
                         po.setWindpowerstationId(ln.getId());
                         po.setUniformCode(stp.getUniformCode());
                         po.setTypeId(stp.getTypeId());
-                        sb = new StringBuilder();
-
-                        if (StringUtils.notEmp(wp.getPhoto())) {
-                            sb.append(wp.getPhoto().replace("_", "")).append(".JSFW").append(sba);
-                        }
-
-                        po.setRealtimeId(String.valueOf(sb));
+                        po.setRealtimeId(sba.append("JSFW").toString());
 
                         points.add(po);
                     }