|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|