Browse Source

矩阵功率取数调整

王波 1 week ago
parent
commit
77d445ef94

+ 12 - 7
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixHAService.java

@@ -9,15 +9,13 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.util.DoubleUtils;
 import com.gyee.common.util.SortUtils;
 import com.gyee.common.vo.monitor.*;
-import com.gyee.runeconomy.feign.AdapterApi;
+import com.gyee.runeconomy.controller.agc.AiPoints;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
-import com.gyee.runeconomy.service.auto.IProBasicPowerPointService;
 import com.gyee.runeconomy.util.StringUtils;
 import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
-import java.net.URI;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -32,7 +30,10 @@ public class MatrixHAService {
 
         Map<String, Double> modelpower = CacheContext.modelpower;
 
-        long timemills = System.currentTimeMillis() - 30_000L;
+        AiPoints[] aiPoints = CacheContext.agcDeviateConfigMap.get("NX_FGS_HA_FDC_STA").getAiPoints();
+        List<AiPoints> apcollect = Arrays.stream(aiPoints).filter(ap -> ap.getName().equals("实发有功") || ap.getName().equals("理论功率") || ap.getName().equals("平均风速")).collect(Collectors.toList());
+
+//        long timemills = System.currentTimeMillis() - 30_000L;
 
         if (company.endsWith("ZGS")) {
             wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
@@ -91,7 +92,9 @@ public class MatrixHAService {
             try {
                 List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
                 List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);//总有功-总理论功率
-                PointData station_zyggl = edosUtil.getSectionData(pointMap.get(ContantXk.SSZYGGL), timemills);
+//                PointData station_zyggl = edosUtil.getSectionData(pointMap.get(ContantXk.SSZYGGL), timemills);
+                PointData station_zyggl = edosUtil.getRealData(apcollect.get(0).getTag());
+                PointData station_zllgl = edosUtil.getRealData(apcollect.get(1).getTag());
                 List<PointData> wtRealdatas1 = edosUtil.getRealData(wtPoints1);
 
                 MatrixHAPowerVo powerVo = new MatrixHAPowerVo();
@@ -107,14 +110,16 @@ public class MatrixHAService {
 
 
                 if (wp.getWindType().equals("-1")) {
-                    PointData station_speed = edosUtil.getSectionData(pointMap.get(ContantXk.SSZPJFS),timemills);
+//                    PointData station_speed = edosUtil.getSectionData(pointMap.get(ContantXk.SSZPJFS),timemills);
+                    PointData station_speed = edosUtil.getRealData(apcollect.get(2).getTag());
                     powerVo.setSpped(StringUtils.round(station_speed.getPointValueInDouble(), 2));
                 } else if (wp.getWindType().equals("-2")) {
                     PointData speed = edosUtil.getRealData(pointMap.get(ContantXk.GCGZQD).getNemCode());
                     powerVo.setSpped(StringUtils.round(speed.getPointValueInDouble(), 2));
                 }
 
-                powerVo.setLlgl(StringUtils.round(wpRealdatas.get(1).getPointValueInDouble() /1000,2));//兆瓦
+//                powerVo.setLlgl(StringUtils.round(wpRealdatas.get(1).getPointValueInDouble() /1000,2));//兆瓦
+                powerVo.setLlgl(StringUtils.round(station_zllgl.getPointValueInDouble() /1000,2));//兆瓦
                 powerVo.setSjgl(StringUtils.round(station_zyggl.getPointValueInDouble(),2));//兆瓦
                 if(powerVo.getLlgl()<=powerVo.getSjgl()){
                     powerVo.setLlgl(StringUtils.round(powerVo.getSjgl() * 1.02,2));