Browse Source

矩阵功率取数调整

王波 1 week ago
parent
commit
46ca04c7d9

+ 9 - 8
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixHAService.java

@@ -4,12 +4,12 @@ package com.gyee.runeconomy.service.monitor;
 @date   2023/3/28-8:49
 */
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 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.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.service.auto.IProBasicPowerPointService;
@@ -17,6 +17,7 @@ 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;
@@ -25,15 +26,14 @@ import java.util.stream.Collectors;
 public class MatrixHAService {
     @Resource
     private IEdosUtil edosUtil;
-    @Resource
-    private IProBasicPowerPointService powerPointService;
-
     public Map<String, Object> matrixMX(String company, String type) throws Exception {
 
         List<ProBasicPowerstation> wpls = CacheContext.wpls;
 
         Map<String, Double> modelpower = CacheContext.modelpower;
 
+        long timemills = System.currentTimeMillis() - 30_000L;
+
         if (company.endsWith("ZGS")) {
             wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());
         }
@@ -90,7 +90,8 @@ public class MatrixHAService {
             });
             try {
                 List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
-                List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);
+                List<PointData> wpRealdatas = edosUtil.getRealData(wpPoints);//总有功-总理论功率
+                PointData station_zyggl = edosUtil.getSectionData(pointMap.get(ContantXk.SSZYGGL), timemills);
                 List<PointData> wtRealdatas1 = edosUtil.getRealData(wtPoints1);
 
                 MatrixHAPowerVo powerVo = new MatrixHAPowerVo();
@@ -106,15 +107,15 @@ public class MatrixHAService {
 
 
                 if (wp.getWindType().equals("-1")) {
-                    PointData speed = edosUtil.getRealData(pointMap.get(ContantXk.SSZPJFS).getNemCode());
-                    powerVo.setSpped(StringUtils.round(speed.getPointValueInDouble(), 2));
+                    PointData station_speed = edosUtil.getSectionData(pointMap.get(ContantXk.SSZPJFS),timemills);
+                    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.setSjgl(StringUtils.round(wpRealdatas.get(0).getPointValueInDouble(),2));//兆瓦
+                powerVo.setSjgl(StringUtils.round(station_zyggl.getPointValueInDouble(),2));//兆瓦
                 if(powerVo.getLlgl()<=powerVo.getSjgl()){
                     powerVo.setLlgl(StringUtils.round(powerVo.getSjgl() * 1.02,2));
                 }