xushili 1 рік тому
батько
коміт
64ee511150

+ 2 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/InverterPowerAnalysis2.java

@@ -1,5 +1,6 @@
 package com.gyee.power.fitting.dispersionanalysis;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
@@ -119,7 +120,7 @@ public class InverterPowerAnalysis2 {
 
     // 计算功率离散率
     public double calcPowerDeviation(List<TsDoubleData> gzqd, List<TsDoubleData> yggl, double averagePower, long startTime, long endTime) {
-        if (CollectionUtil.isEmpty(gzqd) || CollectionUtil.isEmpty(yggl)) return 0;
+        if (CollUtil.isEmpty(gzqd) || CollUtil.isEmpty(yggl)) return 0;
         //List<TsDoubleData> S = dataCompletion(gzqd, startTime, endTime);
         //List<TsDoubleData> P = dataCompletion(yggl, startTime, endTime);
         WeightedObservedPoints points = new WeightedObservedPoints();

+ 9 - 4
power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/PhotovoltaicAnalysisTask.java

@@ -1,9 +1,12 @@
 package com.gyee.power.fitting.dispersionanalysis;
 
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateRange;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.stream.CollectorUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.power.fitting.common.feign.RemoteServiceBuilder;
 import com.gyee.power.fitting.model.PhotovoltaicAnalysis;
@@ -15,6 +18,7 @@ import com.gyee.power.fitting.service.IPhotovoltaicAnalysisService;
 import com.gyee.power.fitting.service.ProBasicEquipmentPointService;
 import com.gyee.power.fitting.service.ProBasicEquipmentService;
 import com.gyee.power.fitting.service.ProEconEquipmentmodelService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -47,14 +51,14 @@ public class PhotovoltaicAnalysisTask {
     private PhotovoltaicEfficiencyAnalysis2 photovoltaicEfficiencyAnalysis;
 
     //秒 分 时 日 月 周
-    @Scheduled(cron = "0 22 1 * * ?")
+    @Scheduled(cron = "0 06 15 * * ?")
     public void doTask() {
         //获取逆变器
         QueryWrapper<ProBasicEquipment> eWrapper = new QueryWrapper<>();
         eWrapper.eq("spare1", "IN");
         List<ProBasicEquipment> eList = proBasicEquipmentService.list(eWrapper);
         //场站、机型、逆变器们  .filter(e->"SXJ_KGDL_YY_GDC_STA".equals(e.getWindpowerstationId()))
-        Map<String, Map<String, List<ProBasicEquipment>>> equipmentMapMap = eList.stream().collect(Collectors.groupingBy(
+        Map<String, Map<String, List<ProBasicEquipment>>> equipmentMapMap = eList.stream().filter(e->"SXJ_KGDL_TL_GDC_STA".equals(e.getWindpowerstationId())).collect(Collectors.groupingBy(
                 ProBasicEquipment::getWindpowerstationId, Collectors.groupingBy(ProBasicEquipment::getModelId)));
 
         //获取机型的装机容量
@@ -181,7 +185,7 @@ public class PhotovoltaicAnalysisTask {
             photovoltaicAnalysisService.saveBatch(photovoltaicAnalyses);
             //            CsvWriter writer = CsvUtil.getWriter(gyeeConfig.getGfDataPath() + "testWrite.csv", CharsetUtil.CHARSET_UTF_8);
             //            writer.write(photovoltaicAnalyses);
-            System.out.println("计算完成!");
+            System.out.println("计算完成!" + DateUtil.formatDate(dateTime));
         }
     }
 
@@ -196,6 +200,7 @@ public class PhotovoltaicAnalysisTask {
     }
 
     private double calcDowntimeByFailure(List<TsDoubleData> sbztInfoList) {
+        if (CollUtil.isEmpty(sbztInfoList)) return 0;
         sbztInfoList = sbztInfoList.stream().sorted(Comparator.comparing(TsDoubleData::getTs).reversed()).collect(Collectors.toList());
 
         long duration = 0;//故障或检修时间
@@ -216,7 +221,7 @@ public class PhotovoltaicAnalysisTask {
         //paList.setDataDate(DateUtil.parse("2023-10-14"));
         DateTime startTime;
         DateTime endTime = DateUtil.beginOfDay(DateUtil.yesterday());
-        if (paList == null || paList.getDataDate()==null) {
+        if (paList == null || paList.getDataDate() == null) {
             startTime = endTime;
         } else {
             startTime = DateUtil.offsetDay(paList.getDataDate(), 1);

+ 2 - 2
power-fitting-JN/src/main/java/com.gyee.power.fitting/dispersionanalysis/PhotovoltaicEfficiencyAnalysis2.java

@@ -34,9 +34,9 @@ public class PhotovoltaicEfficiencyAnalysis2 {
         if (lightIntensity == 0) return 0;
         double v = (power * 100000.0) / (lightIntensity * installedCapacity);
 
-        if (v > 70) {
+        if (v > 30) {
             v = v / gyeeConfig.getGfzhxlxs().get(modelId);
-            if (v > 88) v = 90;
+            if (v > 85) v = 86;
         }
 
         return v;

+ 21 - 22
power-fitting-JN/src/main/resources/application.yaml

@@ -18,7 +18,27 @@ gyee:
   off-line: true
   # 是否实时计算五损数据   true:连接实时数据库按天计算   false:使用离线数据按月计算
   real-time-cal: false
-
+  #光伏转换效率系数
+  gfzhxlxs:
+    SG500MX: 1.45
+    SUN2000-28KTL: 1.39 #未确认
+    SG630KTL: 3.57
+    EA500KM-M: 1.39 #未确认
+    AE-500-50-PV-X-HV: 1.01
+    SG50KTL-M: 9.34
+    SG500KTL: 1.39 #未确认
+    SG630MX: 0.92
+    SGI-500KTL: 1.01
+    SG1250UD: 1.14
+    SG60KTL-M: 1.89
+    PVS-800-57-100KW-A: 1.39 #未确认
+    SSL500: 1.39 #未确认
+    Sunny Central 500HE: 1.39 #未确认
+    SG630-MX: 1.39 #未确认
+    SG50KTL: 1.21
+    TS80KTL-PLUS: 2.97
+    SUN2000-125KTL-MO: 2.87
+    SG136TX: 1.4
 
 server:
   port: 9002
@@ -101,26 +121,5 @@ logging:
 #光伏三相电流电压计算功率的场站
 gf3xjscz: HZJ_GDC,AK_GDC
 
-#光伏转换效率系数
-gfzhxlxs:
-  SG500MX: 145
-  SUN2000-28KTL: 139 #未确认
-  SG630KTL: 357
-  EA500KM-M: 139 #未确认
-  AE-500-50-PV-X-HV: 101
-  SG50KTL-M: 934
-  SG500KTL: 139 #未确认
-  SG630MX: 92
-  SGI-500KTL: 101
-  SG1250UD: 114
-  SG60KTL-M: 189
-  PVS-800-57-100KW-A: 139 #未确认
-  SSL500: 139 #未确认
-  Sunny Central 500HE: 139 #未确认
-  SG630-MX: 139 #未确认
-  SG50KTL: 121
-  TS80KTL-PLUS: 297
-  SUN2000-125KTL-MO: 287
-  SG136TX: 140