宁檬 1 year ago
parent
commit
6aa910a738
16 changed files with 150 additions and 11 deletions
  1. 2 2
      histroy/analysis-histroy-hb/target/classes/application.yml
  2. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysismain.class
  3. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubcompany.class
  4. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubprojectwindcan.class
  5. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubprojectwindcannot.class
  6. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubstationpv.class
  7. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubstationwind.class
  8. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubtablebottom.class
  9. BIN
      histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/service/analysis/AnalysisNewService.class
  10. 4 4
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/bmk/MyTest.java
  11. 29 0
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbinegoodnessController.java
  12. 26 0
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/dto/response/StationAnalysis.java
  13. 6 0
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/init/CacheContext.java
  14. 6 4
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/PerformanceCurvefittingService.java
  15. 76 0
      web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java
  16. 1 1
      web/runeconomy-jjyx/src/main/resources/application-hn.yml

+ 2 - 2
histroy/analysis-histroy-hb/target/classes/application.yml

@@ -1,5 +1,5 @@
 spring:
   profiles:
-    active: hf
+#    active: hf
 #    active: dev
-#    active: test
+    active: test

BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysismain.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubcompany.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubprojectwindcan.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubprojectwindcannot.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubstationpv.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubstationwind.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/model/auto/Analysissubtablebottom.class


BIN
histroy/analysis-histroy-hb/target/classes/com/gyee/analysis/service/analysis/AnalysisNewService.class


+ 4 - 4
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/bmk/MyTest.java

@@ -24,7 +24,7 @@ public class MyTest implements CommandLineRunner {
     @Override
     public void run(String... args) throws Exception {
         int count = inPowerCurveFittingService.count();
-        if(count<10000) {
+        if (count < 10000) {
             List<ProBasicOrganizeTree> collect = CacheContext.wtls.stream().filter(wtl -> wtl.getEleType().equals("G")).collect(Collectors.toList());
 
             List<ProEconInPowerCurveFitting> list = new ArrayList<>();
@@ -33,11 +33,11 @@ public class MyTest implements CommandLineRunner {
                 for (ProBasicOrganizeTree tree : collect) {
                     j++;
                     ProEconInPowerCurveFitting econ = new ProEconInPowerCurveFitting();
-                    econ.setId(i*3000+j);
+                    econ.setId(i * 3000 + j);
                     econ.setInverterId(tree.getId());
                     econ.setIllumination((double) i);
-                    econ.setActualPower(DoubleUtils.getRoundingNum(i / 60d, 2));
-                    econ.setOptimalPower(DoubleUtils.getRoundingNum(i / 55d, 2));
+                    econ.setActualPower(DoubleUtils.getRoundingNum(i / 2d, 2));
+                    econ.setOptimalPower(DoubleUtils.getRoundingNum(i / 1.97d, 2));
                     list.add(econ);
                 }
             }

+ 29 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/controller/goodness/WindturbinegoodnessController.java

@@ -2,9 +2,11 @@ package com.gyee.runeconomy.controller.goodness;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.common.model.StringUtils;
+import com.gyee.common.vo.benchmark.WxsslVo;
 import com.gyee.common.vo.threerate.PvVo;
 import com.gyee.runeconomy.dto.R;
 import com.gyee.runeconomy.dto.ResultMsg;
+import com.gyee.runeconomy.dto.response.StationAnalysis;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.ProBasicOrganizeTree;
 import com.gyee.runeconomy.model.auto.ProEconWindturbineGoodness;
@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 单机性能分析列表
@@ -152,4 +155,30 @@ public class WindturbinegoodnessController {
         }
     }
 
+
+    /**
+     * 场站性能分析
+     */
+    @GetMapping("/stationanalysis")
+    @ResponseBody
+    @ApiOperation(value = "场站性能分析", notes = "场站性能分析")
+    public R cndb(@RequestParam(value = "companys",required = true) String companys,
+                  @RequestParam(value = "type",required = true) String type,
+                  @RequestParam(value = "wpid",required = true) String wpid,
+                  @RequestParam(value = "beginDate",required = true) String beginDate,
+                  @RequestParam(value = "endDate",required = true) String endDate,
+                  @RequestParam(value = "target",required = true) String target,
+                  @RequestParam(value = "sort",required = true) String sort
+    ) throws Exception {
+
+
+        Map<String, List<StationAnalysis>> resultList = windturbinegoodnessService.stationAnalysis(companys, type, wpid, beginDate, endDate, target, sort);
+
+        if (StringUtils.isNotNull(resultList)) {
+            return R.data(ResultMsg.ok(resultList));
+        } else {
+            return R.error(ResultMsg.error());
+        }
+    }
+
 }

+ 26 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/dto/response/StationAnalysis.java

@@ -0,0 +1,26 @@
+package com.gyee.runeconomy.dto.response;
+
+import lombok.Data;
+
+@Data
+public class StationAnalysis {
+    /**
+     * 时间
+     */
+    private Long time;
+
+    /**
+     * 理论功率
+     */
+    private Double theoreticalPower;
+
+    /**
+     * 实际功率
+     */
+    private Double actualPower;
+
+    /**
+     * 辐照度
+     */
+    private Double irradiance;
+}

+ 6 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -185,6 +185,9 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProEconWtPowerCurveFitting> wtPowerCurveFittingList;
     public static List<ProEconInPowerCurveFitting> inPowerCurveFittingList;
     public static Map<String, List<ProEconInPowerCurveFitting>> inPowerCurveFittingMap;
+    public static List<ProBasicEquipmentPoint> proBasicEquipmentPointList;
+
+    public static List<ProBasicPowerstationPoint> proBasicPowerstationPoint;
 
     @Override
     public void run(String... args) throws Exception {
@@ -198,6 +201,9 @@ public class CacheContext implements CommandLineRunner {
         inPowerCurveFittingList = inPowerCurveFittingService.list();
         inPowerCurveFittingMap = inPowerCurveFittingList.stream().collect(Collectors.groupingBy(ProEconInPowerCurveFitting::getInverterId));
 
+        proBasicEquipmentPointList = proBasicEquipmentPointService.list();
+        proBasicPowerstationPoint = proBasicPowerstationPointService.list();
+
         //List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
         //Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
 

+ 6 - 4
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/PerformanceCurvefittingService.java

@@ -83,8 +83,9 @@ public class PerformanceCurvefittingService {
                 vo.setEnsurepower(DoubleUtils.keepPrecision(fitting.getActualPower(), 2));
                 tempList.add(vo);
             }
-            resultMap.put("list", tempList);
-            resultMap.put("chanrt", tempList.stream().filter(i ->  (i.getSpeed()%Double.valueOf(0.5))==0).collect(Collectors.toList()));
+            List<CurveVo> tempList1 = tempList.stream().sorted(Comparator.comparing(CurveVo::getSpeed)).collect(Collectors.toList());
+            resultMap.put("list", tempList1.stream().filter(i ->  (i.getSpeed()%Double.valueOf(100))==0).collect(Collectors.toList()));
+            resultMap.put("chanrt", tempList1.stream().filter(i ->  (i.getSpeed()%Double.valueOf(100))==0).collect(Collectors.toList()));
         }else {
             List<ProEconInPowerCurveFitting> collect = CacheContext.inPowerCurveFittingList.stream().filter(wpcf -> windturbineIds.contains(wpcf.getInverterId())).collect(Collectors.toList());
             List<CurveVo> tempList = new ArrayList<>();
@@ -97,8 +98,9 @@ public class PerformanceCurvefittingService {
                 vo.setEnsurepower(fitting.getActualPower());
                 tempList.add(vo);
             }
-            resultMap.put("list", tempList);
-            resultMap.put("chanrt", tempList.stream().filter(i ->  (i.getSpeed()%Double.valueOf(25))==0).collect(Collectors.toList()));
+            List<CurveVo> tempList2 = tempList.stream().sorted(Comparator.comparing(CurveVo::getSpeed)).collect(Collectors.toList());
+            resultMap.put("list", tempList2.stream().filter(i ->  (i.getSpeed()%Double.valueOf(100))==0).collect(Collectors.toList()));
+            resultMap.put("chanrt", tempList2.stream().filter(i ->  (i.getSpeed()%Double.valueOf(100))==0).collect(Collectors.toList()));
         }
 
         return resultMap;

+ 76 - 0
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java

@@ -7,8 +7,11 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.util.DoubleUtils;
 import com.gyee.common.util.SortUtils;
 import com.gyee.common.vo.benchmark.DataVo;
+import com.gyee.common.vo.benchmark.WxsslVo;
+import com.gyee.common.vo.curve.CurveVo;
 import com.gyee.common.vo.threerate.PvVo;
 import com.gyee.runeconomy.dto.EchartDataVo;
+import com.gyee.runeconomy.dto.response.StationAnalysis;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
 import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay6Service;
@@ -23,6 +26,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 /**
@@ -992,4 +996,76 @@ public class WindturbinegoodnessService {
 
         return resultList;
     }
+
+
+    /**
+     * 场站性能分析
+     */
+    public Map<String, List<StationAnalysis>> stationAnalysis(String companys, String type, String wpid, String beginDate, String endDate, String target, String sort) throws Exception {
+
+        Map<String, List<StationAnalysis>> resultMap = new HashMap<>();
+        List<ProBasicOrganizeTree> eqs = CacheContext.proBasicOrganizeTrees;
+        List<String> emils = eqs.stream().filter(v -> "EMI".equals(v.getEqType()) && v.getParentCode().equals(wpid))
+                .map(ProBasicOrganizeTree::getId)
+                .collect(Collectors.toList());
+
+        List<String> emil = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> emils.contains(pbep.getNemCode()))
+                .map(ProBasicEquipmentPoint::getNemCode).collect(Collectors.toList());
+
+        Optional<ProBasicPowerstationPoint> sszglpbpp = CacheContext.proBasicPowerstationPoint.stream().filter(pbpp -> "SSZGL".equals(pbpp.getUniformCode()) && wpid.equals(pbpp.getWindpowerstationId())).findFirst();
+        String sszgl = null;
+        if (sszglpbpp.isPresent()) {
+            sszgl = sszglpbpp.get().getNemCode();
+        }
+
+        Optional<ProBasicPowerstationPoint> ssznhglzspbpp = CacheContext.proBasicPowerstationPoint.stream().filter(pbpp -> "SSZNHGLZS".equals(pbpp.getUniformCode()) && wpid.equals(pbpp.getWindpowerstationId())).findFirst();
+        String ssznhglzs = null;
+        if (ssznhglzspbpp.isPresent()) {
+            ssznhglzs = ssznhglzspbpp.get().getNemCode();
+        }
+        int i = 0;
+        double count = 0;
+        Map<Long, PointData> gzpd = new HashMap<>();
+        for (String em : emil) {
+            List<PointData> historyEmilDatas = edosUtil.getHistoryDatasSnap(em, Long.valueOf(beginDate), Long.valueOf(endDate), null, 15000L);
+            for (PointData pd : historyEmilDatas) {
+                if(i==0){
+                    PointData data = new PointData();
+                    data.setPointTime(pd.getPointTime());
+                    data.setPointValueInDouble(pd.getPointValueInDouble());
+                    gzpd.put(pd.getPointTime(),data);
+                }else {
+                    PointData data = gzpd.get(pd.getPointTime());
+                    data.setPointValueInDouble(data.getPointValueInDouble()+pd.getPointValueInDouble());
+                }
+            }
+            i++;
+        }
+        int finalI = i;
+
+        List<PointData> historyEmilDatas = gzpd.values().stream().peek(g -> g.setPointValueInDouble(g.getPointValueInDouble() / finalI)).collect(Collectors.toList());
+        Map<Long, PointData> collect1 = historyEmilDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
+        List<PointData> historySszglDatas = edosUtil.getHistoryDatasSnap(sszgl, Long.valueOf(beginDate), Long.valueOf(endDate), null, 15000L);
+        Map<Long, PointData> collect2 = historySszglDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
+        List<PointData> historySsznhglzsDatas = edosUtil.getHistoryDatasSnap(ssznhglzs, Long.valueOf(beginDate), Long.valueOf(endDate), null, 15000L);
+        Map<Long, PointData> collect3 = historySsznhglzsDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
+
+        List<StationAnalysis> lpds = new ArrayList<>();
+        for (PointData data : historyEmilDatas) {
+            Long pointTime = data.getPointTime();
+            StationAnalysis sa = new StationAnalysis();
+            sa.setTime(pointTime);
+            sa.setIrradiance(collect1.get(pointTime).getPointValueInDouble());
+            sa.setActualPower(collect2.get(pointTime).getPointValueInDouble());
+            sa.setTheoreticalPower(collect3.get(pointTime).getPointValueInDouble());
+            lpds.add(sa);
+        }
+
+        resultMap.put("list", lpds);
+        resultMap.put("chanrt", lpds);
+
+        return resultMap;
+    }
+
+
 }

+ 1 - 1
web/runeconomy-jjyx/src/main/resources/application-hn.yml

@@ -1,5 +1,5 @@
 server:
-  port: 6062
+  port: 6060
   servlet:
     context-path: /