|
@@ -62,7 +62,6 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
proBasicEquipmentPointService.batchAddEquipmentPoint(equipmentPoints);
|
|
|
proBasicPowerstationPointService.batchAddPowerstationPoints(powerstationPoints);
|
|
|
|
|
|
- generateSubStationPoint(station,setpoints);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -76,6 +75,21 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public void generateWsStationPoint(String station, String[] points) {
|
|
|
+ List<ProBasicPowerstationPoint> wsStationPoint = initalWs(station,points);
|
|
|
+
|
|
|
+ proBasicPowerstationPointService.batchAddPowerstationPoints(wsStationPoint);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void generateSquareStationPoint(String station, String[] points) {
|
|
|
+ List<ProBasicPowerstationPoint> ssStationPoint = initalSs(station,points);
|
|
|
+
|
|
|
+ proBasicPowerstationPointService.batchAddPowerstationPoints(ssStationPoint);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public IPage<ProEconTestingPoint> list(String id, String nemCode, String name, String model, String uniformCode, String isDisplay, String pageNum, String pageSize) {
|
|
|
QueryWrapper<ProEconTestingPoint> qw = new QueryWrapper<>();
|
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
@@ -105,16 +119,115 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 阵区测点
|
|
|
* @param station
|
|
|
* @param setpoints
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<ProBasicPowerstationPoint> initalSbs(String station,String[] setpoints) {
|
|
|
+ public List<ProBasicPowerstationPoint> initalSs(String station,String[] setpoints) {
|
|
|
+ List<ProBasicPowerstationPoint> allpoints = new ArrayList<>();
|
|
|
+
|
|
|
+ List<ProEconTestingPoint> ls = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("zq")).collect(Collectors.toList());
|
|
|
+ //获取场站
|
|
|
+ for (ProBasicPowerstation postation : CacheContext.wpls) {
|
|
|
+ if (null != station && !"".equals(station) && !station.equals(postation.getId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取场站下的阵区
|
|
|
+ List<ProBasicSquare> squaare = CacheContext.poSquareMap.get(postation.getId()).stream().filter(i -> i.getTypes().equals("jz")).collect(Collectors.toList());
|
|
|
+ //循环阵区生成测点code
|
|
|
+ for (ProBasicSquare ss : squaare) {
|
|
|
+ List<ProBasicPowerstationPoint> points = new ArrayList<>();
|
|
|
+
|
|
|
+ for (ProEconTestingPoint p : ls) {
|
|
|
+ if (null != setpoints && setpoints.length > 0 && StringUtils.join(setpoints, "|").indexOf(p.getUniformCode()) < 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ String temp = ss.getId().substring(0, ss.getId().lastIndexOf("_"));
|
|
|
+// temp = temp.substring(0, temp.lastIndexOf("_"));
|
|
|
+// temp = temp.substring(temp.lastIndexOf("_") + 1);
|
|
|
+ if (ss.getWindpowerstationId().indexOf("FDC") >= 0) {
|
|
|
+ sb.append(temp).append("_F_");
|
|
|
+ } else {
|
|
|
+ sb.append(temp).append("_G_");
|
|
|
+ }
|
|
|
+
|
|
|
+ sb.append("XX_XX_XXXX_");
|
|
|
+ if (p.getUniformCode().indexOf("AI") >= 0) {
|
|
|
+ sb.append("AI");
|
|
|
+
|
|
|
+ } else if (p.getUniformCode().indexOf("DI") >= 0) {
|
|
|
+ sb.append("DI");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ sb.append("CI");
|
|
|
+ }
|
|
|
+ sb.append(p.getNemCode());
|
|
|
+
|
|
|
+
|
|
|
+ StringBuilder sba = new StringBuilder();
|
|
|
+
|
|
|
+ String temp2 = postation.getCompanyId().substring(0, postation.getCompanyId().lastIndexOf("_"));
|
|
|
+ temp2 = temp2.substring(temp2.indexOf("_") + 1);
|
|
|
+
|
|
|
+ String temp3 = postation.getId().substring(0, postation.getId().lastIndexOf("_"));
|
|
|
+ temp3 = temp3.substring(0, temp3.lastIndexOf("_"));
|
|
|
+ temp3 = temp3.substring(temp3.lastIndexOf("_") + 1);
|
|
|
+ if (postation.getId().indexOf("FDC") >= 0) {
|
|
|
+ sba.append(temp2).append(temp3).append("FC");
|
|
|
+ } else if (postation.getId().indexOf("GDC") >= 0) {
|
|
|
+ sba.append(temp2).append(temp3).append("GC");
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ 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));
|
|
|
+ points.add(po);
|
|
|
+ }
|
|
|
+ allpoints.addAll(points);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return allpoints;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 气象站测点
|
|
|
+ * @param station
|
|
|
+ * @param setpoints
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ProBasicPowerstationPoint> initalWs(String station,String[] setpoints) {
|
|
|
List<ProBasicPowerstationPoint> allpoints = new ArrayList<>();
|
|
|
|
|
|
- List<ProEconTestingPoint> fcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") || i.getTypeId().equals("fggl") || i.getTypeId().equals("cft")).collect(Collectors.toList());
|
|
|
- List<ProEconTestingPoint> gcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") || i.getTypeId().equals("fggl") || i.getTypeId().equals("qxz")).collect(Collectors.toList());
|
|
|
+ List<ProEconTestingPoint> fcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("cft")).collect(Collectors.toList());
|
|
|
+ List<ProEconTestingPoint> gcs = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("fggl") || i.getTypeId().equals("qxz")).collect(Collectors.toList());
|
|
|
//获取场站
|
|
|
for (ProBasicPowerstation postation : CacheContext.wpls) {
|
|
|
if (null != station && !"".equals(station) && !station.equals(postation.getId())) {
|
|
@@ -128,6 +241,107 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
ls = gcs;
|
|
|
}
|
|
|
|
|
|
+ //获取场站下的气象站
|
|
|
+ List<ProBasicWeatherStation> subStations = CacheContext.poWsStationMap.get(postation.getId());
|
|
|
+ //循环气象站生成测点code
|
|
|
+ for (ProBasicWeatherStation ws : subStations) {
|
|
|
+ List<ProBasicPowerstationPoint> points = new ArrayList<>();
|
|
|
+
|
|
|
+ for (ProEconTestingPoint p : ls) {
|
|
|
+ if (null != setpoints && setpoints.length > 0 && StringUtils.join(setpoints, "|").indexOf(p.getUniformCode()) < 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ String temp = ws.getId().substring(0, ws.getId().lastIndexOf("_"));
|
|
|
+// temp = temp.substring(0, temp.lastIndexOf("_"));
|
|
|
+// temp = temp.substring(temp.lastIndexOf("_") + 1);
|
|
|
+ if (ws.getWindpowerstationId().indexOf("FDC") >= 0) {
|
|
|
+ sb.append(temp).append("_F_");
|
|
|
+ } else {
|
|
|
+ sb.append(temp).append("_G_");
|
|
|
+ }
|
|
|
+
|
|
|
+ sb.append("XX_XX_XXXX_");
|
|
|
+ if (p.getUniformCode().indexOf("AI") >= 0) {
|
|
|
+ sb.append("AI");
|
|
|
+
|
|
|
+ } else if (p.getUniformCode().indexOf("DI") >= 0) {
|
|
|
+ sb.append("DI");
|
|
|
+
|
|
|
+ } else {
|
|
|
+ sb.append("CI");
|
|
|
+ }
|
|
|
+ sb.append(p.getNemCode());
|
|
|
+
|
|
|
+
|
|
|
+ StringBuilder sba = new StringBuilder();
|
|
|
+
|
|
|
+ String temp2 = postation.getCompanyId().substring(0, postation.getCompanyId().lastIndexOf("_"));
|
|
|
+ temp2 = temp2.substring(temp2.indexOf("_") + 1);
|
|
|
+
|
|
|
+ String temp3 = postation.getId().substring(0, postation.getId().lastIndexOf("_"));
|
|
|
+ temp3 = temp3.substring(0, temp3.lastIndexOf("_"));
|
|
|
+ temp3 = temp3.substring(temp3.lastIndexOf("_") + 1);
|
|
|
+ if (postation.getId().indexOf("FDC") >= 0) {
|
|
|
+ sba.append(temp2).append(temp3).append("FC");
|
|
|
+ } else if (postation.getId().indexOf("GDC") >= 0) {
|
|
|
+ sba.append(temp2).append(temp3).append("GC");
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ ProBasicPowerstationPoint po = new ProBasicPowerstationPoint();
|
|
|
+ po.setId(StringUtils.getUUID());
|
|
|
+// if (p.getTypeId().indexOf("agcjsfw") >= 0 ) {
|
|
|
+// po.setNemCode(String.valueOf(sbtable));
|
|
|
+// } else {
|
|
|
+ po.setNemCode("INITIAL");
|
|
|
+// }
|
|
|
+ sb = new StringBuilder();
|
|
|
+ sb.append(ws.getName()).append(p.getName());
|
|
|
+ po.setName(String.valueOf(sb));
|
|
|
+ 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));
|
|
|
+ points.add(po);
|
|
|
+ }
|
|
|
+ allpoints.addAll(points);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return allpoints;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 变电所测点
|
|
|
+ * @param station
|
|
|
+ * @param setpoints
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ProBasicPowerstationPoint> initalSbs(String station,String[] setpoints) {
|
|
|
+ List<ProBasicPowerstationPoint> allpoints = new ArrayList<>();
|
|
|
+
|
|
|
+ List<ProEconTestingPoint> ls = proEconTestingPointService.list().stream().filter(i -> i.getTypeId().equals("agc") || i.getTypeId().equals("agcjsfw") ).collect(Collectors.toList());
|
|
|
+ //获取场站
|
|
|
+ for (ProBasicPowerstation postation : CacheContext.wpls) {
|
|
|
+ if (null != station && !"".equals(station) && !station.equals(postation.getId())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
//获取场站下的变电所
|
|
|
List<ProBasicSubStation> subStations = CacheContext.poSubStationMap.get(postation.getId());
|
|
|
//循环变电所生成测点code
|
|
@@ -409,15 +623,15 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
List<ProBasicPowerstationPoint> points = new ArrayList<>();
|
|
|
for (int i = 0; i < pointls.size(); i++) {
|
|
|
ProEconTestingPoint stp = pointls.get(i);
|
|
|
- List<ProBasicPowerstation> groupFCRegion = CacheContext.wpmapGroupFCRegion.get(re.getId());
|
|
|
- if((null == groupFCRegion || groupFCRegion.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- List<ProBasicPowerstation> groupGCRegion = CacheContext.wpmapGroupGCRegion.get(re.getId());
|
|
|
- if((null == groupGCRegion || groupGCRegion.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
- continue;
|
|
|
- }
|
|
|
+// List<ProBasicPowerstation> groupFCRegion = CacheContext.wpmapGroupFCRegion.get(re.getId());
|
|
|
+// if((null == groupFCRegion || groupFCRegion.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<ProBasicPowerstation> groupGCRegion = CacheContext.wpmapGroupGCRegion.get(re.getId());
|
|
|
+// if((null == groupGCRegion || groupGCRegion.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|
|
@@ -579,15 +793,15 @@ public class ProEconTestingPointServiceImpl extends ServiceImpl<ProEconTestingPo
|
|
|
points = new ArrayList<>();
|
|
|
for (int i = 0; i < pointls.size(); i++) {
|
|
|
ProEconTestingPoint stp = pointls.get(i);
|
|
|
- List<ProBasicPowerstation> groupFCCompany = CacheContext.wpmapGroupFCCompany.get(cs.getId());
|
|
|
- if((null == groupFCCompany || groupFCCompany.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- List<ProBasicPowerstation> groupGCCompany = CacheContext.wpmapGroupGCCompany.get(cs.getId());
|
|
|
- if((null == groupGCCompany || groupGCCompany.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
- continue;
|
|
|
- }
|
|
|
+// List<ProBasicPowerstation> groupFCCompany = CacheContext.wpmapGroupFCCompany.get(cs.getId());
|
|
|
+// if((null == groupFCCompany || groupFCCompany.size()<=0) && stp.getTypeId().equals(FCJSFW) ){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<ProBasicPowerstation> groupGCCompany = CacheContext.wpmapGroupGCCompany.get(cs.getId());
|
|
|
+// if((null == groupGCCompany || groupGCCompany.size()<=0) && stp.getTypeId().equals(GCJSFW) ){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
StringBuilder sbtable = new StringBuilder();
|