Преглед изворни кода

realtime_Wp_CAL计算服务调通

hlf пре 2 месеци
родитељ
комит
6b7f13ae89

+ 15 - 9
generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/RealtimeService.java

@@ -437,10 +437,12 @@ public class RealtimeService {
             AtomicReference<Double> zssglsyz = new AtomicReference<>((double) 0);
 
             ProBasicPowerstationPoint ssfsWpPoint = null;
-            if (project.getSpare4().equals("1")) {
-                ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
-            } else if (project.getSpare4().equals("2")) {
-                ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJGZD);
+            if (null != project.getSpare4()){
+                if (project.getSpare4().equals("1")) {
+                    ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
+                } else if (project.getSpare4().equals("2")) {
+                    ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJGZD);
+                }
             }
             ProBasicPowerstationPoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
             ProBasicPowerstationPoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
@@ -538,7 +540,9 @@ public class RealtimeService {
                 //                    return v;
                 //                });
             });
-            projectResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicLines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
+            if (null != ssfsWpPoint){
+                projectResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicLines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
+            }
             projectResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
             projectResultList.add(PointUtil.createPointData(currentDate, zssglsyz.get(), ssglsyzWpPoint.getNemCode(), ssglsyzWpPoint.getName()));
             projectResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
@@ -581,10 +585,12 @@ public class RealtimeService {
                 Map<String, ProBasicPowerstationPoint> basicWppointMap = propointmap.get(pj.getId());
 
                 ProBasicPowerstationPoint ssbfPoint = null;
-                if (pj.getSpare4().equals("1")) {
-                    ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
-                } else if (pj.getSpare4().equals("2")) {
-                    ssbfPoint = basicWppointMap.get(ContantXk.SSPJGZD);
+                if (null != pj.getSpare4()){
+                    if (pj.getSpare4().equals("1")) {
+                        ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
+                    } else if (pj.getSpare4().equals("2")) {
+                        ssbfPoint = basicWppointMap.get(ContantXk.SSPJGZD);
+                    }
                 }
                 ProBasicPowerstationPoint ssglPoint = basicWppointMap.get(ContantXk.SSZGL);
                 ProBasicPowerstationPoint ssglsyzPoint = basicWppointMap.get(ContantXk.SSZGLSYZ);

+ 3 - 1
generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java

@@ -84,7 +84,9 @@ public class EdosUtil implements IEdosUtil {
             }
         } else {
             PointData po = new PointData();
-            po.setEdnaId(point.getNemCode());
+            if (null != point){
+                po.setEdnaId(point.getNemCode());
+            }
             po.setPointValueInDouble(0.0);
             po.setPointTime(0l);
             return po;

+ 2 - 2
generationXK-service/src/test/java/com/gyee/generation/SaticScheduleCALTaskTest.java

@@ -59,8 +59,8 @@ public class SaticScheduleCALTaskTest {
         //saticSchedulePgTask.shutdown_All_STA();
 
         //saticScheduleCALTask.theoreticalPower_CAL();
-        saticScheduleCALTask.realtime_CAL();
-        //saticScheduleCALTask.realtime_Wp_CAL();
+        //saticScheduleCALTask.realtime_CAL();
+        saticScheduleCALTask.realtime_Wp_CAL();
         //saticScheduleCALTask.electricityMetering_CAL();
 
         //saticScheduleCALTask.accessStatus_CAL();