فهرست منبع

光伏功能调整

全业务考评 1 سال پیش
والد
کامیت
2ed611503e
1فایلهای تغییر یافته به همراه36 افزوده شده و 20 حذف شده
  1. 36 20
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/IvPvCurveFittingService.java

+ 36 - 20
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/IvPvCurveFittingService.java

@@ -4,11 +4,12 @@ import com.gyee.power.fitting.common.alg.CurrentVoltageCalc;
 import com.gyee.power.fitting.common.alg.PolynomialCurveFitting;
 import com.gyee.power.fitting.common.config.GyeeConfig;
 import com.gyee.power.fitting.common.constants.Constants;
-import com.gyee.power.fitting.common.feign.IAdapterService;
+import com.gyee.power.fitting.common.feign.RemoteServiceBuilder;
 import com.gyee.power.fitting.common.spring.InitialRunner;
 import com.gyee.power.fitting.common.util.DateUtils;
 import com.gyee.power.fitting.common.util.FileUtil;
 import com.gyee.power.fitting.common.util.PowerFittingUtil;
+import com.gyee.power.fitting.model.ProBasicPowerstationPoint;
 import com.gyee.power.fitting.model.ProEconPowerFittingAnalySis;
 import com.gyee.power.fitting.model.Windpowerstationtestingpoint2;
 import com.gyee.power.fitting.model.Windturbinetestingpointai2;
@@ -22,6 +23,7 @@ import com.gyee.power.fitting.service.IWindpowerstationtestingpoint2Service;
 import com.gyee.power.fitting.service.Windturbinetestingpointai2Service;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.math3.fitting.WeightedObservedPoints;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -40,8 +42,11 @@ public class IvPvCurveFittingService {
     private IWindpowerstationtestingpoint2Service stationPointService;
     @Resource
     private Windturbinetestingpointai2Service windPointService;
-    @Resource
-    private IAdapterService adpClient;
+//    @Resource
+//    private IAdapterService adpClient;
+
+    @Autowired
+    private RemoteServiceBuilder remoteService;
     @Resource
     private GyeeConfig config;
     @Resource
@@ -434,7 +439,8 @@ public class IvPvCurveFittingService {
             //场站
             String stationid = wstp.getWindpowerstationid();
 
-            List<TsDoubleData> history = adpClient.getHistorySnap(wstp.getCode(), startdate + oneday * 1000, enddate, oneday);
+            List<TsDoubleData> history = remoteService.adaptergf().getHistorySnap(wstp.getCode(), startdate + oneday * 1000, enddate, oneday);
+
             double d = 0;
             for (TsDoubleData data : history) {
                 d += data.getDoubleValue();
@@ -493,38 +499,36 @@ public class IvPvCurveFittingService {
         Map<String, String> adlpoints = getPoints(stationid, "adl");
         Map<String, String> bdlpoints = getPoints(stationid, "bdl");
         Map<String, String> cdlpoints = getPoints(stationid, "cdl");
-        Windpowerstationtestingpoint2 zfsPoint = InitialRunner.zfsMap.get(stationid);
-        Windpowerstationtestingpoint2 zjwdPoint = InitialRunner.zjwdMap.get(stationid);
+        ProBasicPowerstationPoint zfsPoint = InitialRunner.newzfsMap.get(stationid);
+        ProBasicPowerstationPoint zjwdPoint = InitialRunner.newzjwdMap.get(stationid);
 
         //总辐射
-        List<TsDoubleData> zfsDatas = adpClient.getHistorySnap(zfsPoint.getCode(), start, end, interval);
+        List<TsDoubleData> zfsDatas = remoteService.adapterfd().getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
         //组件温度
-        List<TsDoubleData> zjwdDatas = adpClient.getHistorySnap(zjwdPoint.getCode(), start, end, interval);
-
+        List<TsDoubleData> zjwdDatas = remoteService.adaptergf().getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
         List<List<PhotovoltaicInfo>> infosLit = new ArrayList<>();
         //按逆变器
         for (String wtid : zglpoints.keySet()) {
 
             //总功率
-            List<TsDoubleData> zglDatas = adpClient.getHistorySnap(zglpoints.get(wtid), start, end, interval);
+            List<TsDoubleData> zglDatas = remoteService.adaptergf().getHistorySnap(zglpoints.get(wtid), start, end, interval);
 
             //电网A相电压
-            List<TsDoubleData> adyDatas = adpClient.getHistorySnap(adypoints.get(wtid), start, end, interval);
+            List<TsDoubleData> adyDatas = remoteService.adaptergf().getHistorySnap(adypoints.get(wtid), start, end, interval);
             //电网A相电流
-            List<TsDoubleData> adlDatas = adpClient.getHistorySnap(adlpoints.get(wtid), start, end, interval);
-
+            List<TsDoubleData> adlDatas = remoteService.adaptergf().getHistorySnap(adlpoints.get(wtid), start, end, interval);
             List<PhotovoltaicInfo> infos = new ArrayList<>();
 
             List<TsDoubleData> bdyDatas = null, cdyDatas = null, bdlDatas = null, cdlDatas = null;
             if (gf3xjscz.contains(stationid)) {
                 //电网B相电压
-                bdyDatas = adpClient.getHistorySnap(bdypoints.get(wtid), start, end, interval);
+                bdyDatas = remoteService.adaptergf().getHistorySnap(bdypoints.get(wtid), start, end, interval);
                 //电网C相电压
-                cdyDatas = adpClient.getHistorySnap(cdypoints.get(wtid), start, end, interval);
+                cdyDatas =remoteService.adaptergf().getHistorySnap(cdypoints.get(wtid), start, end, interval);
                 //电网B相电流
-                bdlDatas = adpClient.getHistorySnap(bdlpoints.get(wtid), start, end, interval);
+                bdlDatas =remoteService.adaptergf().getHistorySnap(bdlpoints.get(wtid), start, end, interval);
                 //电网C相电流
-                cdlDatas = adpClient.getHistorySnap(cdlpoints.get(wtid), start, end, interval);
+                cdlDatas =  remoteService.adaptergf().getHistorySnap(cdlpoints.get(wtid), start, end, interval);
             }
 
             for (int j = 0; j < zfsDatas.size(); j++) {
@@ -545,10 +549,22 @@ public class IvPvCurveFittingService {
                     info.setBV(double3Decimal(bdyDatas.get(j).getDoubleValue(), true));
                     info.setCV(double3Decimal(cdyDatas.get(j).getDoubleValue(), true));
                 } else {
-                    info.setI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
-                    info.setV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
+                    if (adlDatas.size() >= 1) {
+                        info.setI(double3Decimal(adlDatas.get(j).getDoubleValue(), false));
+                    } else {
+                        info.setI(0);
+                    }
+                    if (adyDatas.size() >= 1) {
+                        info.setV(double3Decimal(adyDatas.get(j).getDoubleValue(), true));
+                    } else {
+                        info.setV(0);
+                    }
+                }
+                if (zglDatas.size() >= 1) {
+                    info.setActualP(double3Decimal(zglDatas.get(j).getDoubleValue(), false));
+                } else {
+                    info.setActualP(0);
                 }
-                info.setActualP(double3Decimal(zglDatas.get(j).getDoubleValue(), false));
                 infos.add(info);
             }
             infosLit.add(infos);