소스 검색

优化后台计算算法

shilin 1 년 전
부모
커밋
e0ce381985
1개의 변경된 파일28개의 추가작업 그리고 4개의 파일을 삭제
  1. 28 4
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java

+ 28 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java

@@ -100,7 +100,7 @@ public class MatrixService {
             wpPoints.add(pointMap.get(ContantXk.SSZBZGL).getNemCode());
             wpPoints.add(pointMap.get(ContantXk.SSZNHGLZS).getNemCode());
             wpPoints.add(pointMap.get(ContantXk.SSZGL).getNemCode());
-            wpPoints.add(pointMap.get(ContantXk.ZYCGL).getNemCode());
+//            wpPoints.add(pointMap.get(ContantXk.TPOINT_WP_YCGL).getNemCode());
             List<ProBasicEquipment> equipments = wpwtmap.get(wp.getId());
             equipments.stream().forEach(wt -> {
                 Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
@@ -145,16 +145,21 @@ public class MatrixService {
                 powerVo.setBzgl(wpRealdatas.get(15).getPointValueInDouble());
                 powerVo.setLlgl(wpRealdatas.get(16).getPointValueInDouble());
                 powerVo.setSjgl(wpRealdatas.get(17).getPointValueInDouble());
-                powerVo.setYcgl(wpRealdatas.get(18).getPointValueInDouble());
+//                powerVo.setYcgl(wpRealdatas.get(18).getPointValueInDouble());
 
                 AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
                 AtomicReference<Double> agc = new AtomicReference<>((double) 0);
+                AtomicReference<Double> ycgl = new AtomicReference<>((double) 0);
                 List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
                 subStations.stream().forEach(sub->{
                     Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
                     ProBasicPowerstationPoint cxglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
 
                     ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_AGC);
+
+                    ProBasicPowerstationPoint ycglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_YCGL);
+
+
                     cxgl.updateAndGet(v -> {
                         try {
                             return new Double((double) (v + edosUtil.getRealData(cxglPoint).getPointValueInDouble()));
@@ -171,10 +176,18 @@ public class MatrixService {
                         }
                         return v;
                     });
+                    ycgl.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(ycglPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
                 });
                 powerVo.setCxgl(cxgl.get());
                 powerVo.setAgc(agc.get());
-
+                powerVo.setYcgl(ycgl.get());
                 jrts.addAndGet(powerVo.getJrts());
                 dfts.addAndGet((int) wpRealdatas.get(0).getPointValueInDouble());
                 sdtj.addAndGet((int) wpRealdatas.get(1).getPointValueInDouble());
@@ -350,15 +363,17 @@ public class MatrixService {
                 powerVo.setBzgl(wpRealdatas.get(8).getPointValueInDouble());
                 powerVo.setLlgl(wpRealdatas.get(9).getPointValueInDouble());
                 powerVo.setSjgl(wpRealdatas.get(10).getPointValueInDouble());
-                powerVo.setYcgl(wpRealdatas.get(11).getPointValueInDouble());
+//                powerVo.setYcgl(wpRealdatas.get(11).getPointValueInDouble());
                 AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
                 AtomicReference<Double> agc = new AtomicReference<>((double) 0);
+                AtomicReference<Double> ycgl = new AtomicReference<>((double) 0);
                 List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
                 subStations.stream().forEach(sub->{
                     Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
                     ProBasicPowerstationPoint cxglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
 
                     ProBasicPowerstationPoint agcPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_AGC);
+                    ProBasicPowerstationPoint ycglPoint = powerstationPointMap.get(ContantXk.TPOINT_WP_YCGL);
                     cxgl.updateAndGet(v -> {
                         try {
                             return new Double((double) (v + edosUtil.getRealData(cxglPoint).getPointValueInDouble()));
@@ -375,9 +390,18 @@ public class MatrixService {
                         }
                         return v;
                     });
+                    ycgl.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getRealData(ycglPoint).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
                 });
                 powerVo.setCxgl(cxgl.get());
                 powerVo.setAgc(agc.get());
+                powerVo.setYcgl(ycgl.get());
 
                 if (wp.getId().contains("_FDC_")){
                     jrts.addAndGet(powerVo.getJrts());