|
@@ -10,6 +10,7 @@ import com.gyee.common.vo.benchmark.DataVo;
|
|
|
import com.gyee.common.vo.threerate.PvVo;
|
|
|
import com.gyee.runeconomy.dto.EchartDataVo;
|
|
|
import com.gyee.runeconomy.dto.response.InverterAnalysis;
|
|
|
+import com.gyee.runeconomy.dto.response.InverterAnalysis2;
|
|
|
import com.gyee.runeconomy.dto.response.StationAnalysis;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
@@ -1136,9 +1137,12 @@ public class WindturbinegoodnessService {
|
|
|
}
|
|
|
lias.add(ia);
|
|
|
}
|
|
|
+ int total = lias.size();
|
|
|
+ long offset = (pageNum - 1) * pageSize;
|
|
|
+ lias = lias.stream().skip(offset).limit(pageSize).collect(Collectors.toList());
|
|
|
|
|
|
analysisPage.setRecords(lias);
|
|
|
- analysisPage.setTotal(lias.size());
|
|
|
+ analysisPage.setTotal(total);
|
|
|
analysisPage.setCurrent(pageNum);
|
|
|
analysisPage.setSize(pageSize);
|
|
|
|
|
@@ -1149,8 +1153,71 @@ public class WindturbinegoodnessService {
|
|
|
/**
|
|
|
* 逆变器分析二次页面
|
|
|
*/
|
|
|
- /* public Map<String, List<StationAnalysis>> inverterAnalysis2(String wtid, String beginDate, String endDate, Long pageSize, Long pageNum, String target, String sort) {
|
|
|
+ public Page<InverterAnalysis2> inverterAnalysis2(String wtid, String beginDate, String endDate, Long pageSize, Long pageNum, String target, String sort) throws Exception {
|
|
|
+ Long startTs = DateUtils.parseDate1(beginDate).getTime() / 1000;
|
|
|
+ Long endTs = DateUtils.parseDate1(endDate).getTime() / 1000;
|
|
|
+
|
|
|
+ Page<InverterAnalysis2> analysisPage = new Page<>();
|
|
|
+
|
|
|
+ List<ProBasicEquipmentPoint> srg = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "AIG010".equals(pbep.getUniformCode()) && wtid.equals(pbep.getWindturbineId())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<ProBasicEquipmentPoint> scg = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "AIG007".equals(pbep.getUniformCode()) && wtid.equals(pbep.getWindturbineId())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<ProBasicEquipmentPoint> srd = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "DIHW050".equals(pbep.getUniformCode()) && wtid.equals(pbep.getWindturbineId())).collect(Collectors.toList());
|
|
|
+ if (srd.size() == 0) {
|
|
|
+ srd = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "AIG019".equals(pbep.getUniformCode()) && wtid.equals(pbep.getWindturbineId())).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ //所有逆变器的输入功率测点
|
|
|
+ String srgTag = srg.stream().map(epp -> epp.getNemCode()).collect(Collectors.joining(";"));
|
|
|
+ List<PointData> historySrgDatas = edosUtil.getHistoryDatasSnap(srgTag, startTs, endTs, null, 900L);
|
|
|
+ Map<Long, PointData> srgMap = historySrgDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
+
|
|
|
+ //所有逆变器的输出功率测点
|
|
|
+ String scgTag = scg.stream().map(epp -> epp.getNemCode()).collect(Collectors.joining(";"));
|
|
|
+ List<PointData> historyScgDatas = edosUtil.getHistoryDatasSnap(scgTag, startTs, endTs, null, 900L);
|
|
|
+ Map<Long, PointData> scgMap = historyScgDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
+
|
|
|
+ //所有逆变器的输出电压测点
|
|
|
+ String srdTag = srd.stream().map(epp -> epp.getNemCode()).collect(Collectors.joining(";"));
|
|
|
+ List<PointData> historySrdDatas = edosUtil.getHistoryDatasSnap(srdTag, startTs, endTs, null, 900L);
|
|
|
+ Map<Long, PointData> srdMap = historySrdDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
|
|
|
|
|
|
- }*/
|
|
|
+ List<InverterAnalysis2> lpds = new ArrayList<>();
|
|
|
+ for (PointData data : historySrgDatas) {
|
|
|
+ Long pointTime = data.getPointTime();
|
|
|
+ InverterAnalysis2 ia = new InverterAnalysis2();
|
|
|
+ ia.setTime(pointTime);
|
|
|
+ ia.setInverterId(wtid);
|
|
|
+ ia.setInverterName(CacheContext.proBasicOrganizeTreesMap.get(wtid).getNemName());
|
|
|
+ ia.setInputPower(srgMap.get(pointTime).getPointValueInDouble());
|
|
|
+ ia.setOutputPower(scgMap.get(pointTime).getPointValueInDouble());
|
|
|
+ ia.setInputVoltage(srdMap.get(pointTime).getPointValueInDouble());
|
|
|
+ /*if (srgMap.get(pointTime).getPointValueInDouble() == null || srgMap.get(pointTime).getPointValueInDouble() == 0.0 || scgMap.get(pointTime).getPointValueInDouble() == null || scgMap.get(pointTime).getPointValueInDouble() == 0.0) {
|
|
|
+ ia.setConversionRate(0.0);
|
|
|
+ } else {
|
|
|
+ ia.setConversionRate(scgMap.get(pointTime).getPointValueInDouble() / srgMap.get(pointTime).getPointValueInDouble() * 100);
|
|
|
+ }*/
|
|
|
+ Double srgValue = srgMap.get(pointTime) != null ? srgMap.get(pointTime).getPointValueInDouble() : null;
|
|
|
+ Double scgValue = scgMap.get(pointTime) != null ? scgMap.get(pointTime).getPointValueInDouble() : null;
|
|
|
+ if (srgValue == null || Double.valueOf(0.0).equals(srgValue) || scgValue == null || Double.valueOf(0.0).equals(scgValue)) {
|
|
|
+ ia.setConversionRate(0.0);
|
|
|
+ } else {
|
|
|
+ ia.setConversionRate(scgValue / srgValue * 100);
|
|
|
+ }
|
|
|
+ lpds.add(ia);
|
|
|
+ }
|
|
|
+ List<InverterAnalysis2> lias2 = lpds.stream().sorted(Comparator.comparing(InverterAnalysis2::getTime)).collect(Collectors.toList());
|
|
|
+ int total = lias2.size();
|
|
|
+ long offset = (pageNum - 1) * pageSize;
|
|
|
+ lias2 = lias2.stream().skip(offset).limit(pageSize).collect(Collectors.toList());
|
|
|
+
|
|
|
+ analysisPage.setRecords(lias2);
|
|
|
+ analysisPage.setTotal(total);
|
|
|
+ analysisPage.setCurrent(pageNum);
|
|
|
+ analysisPage.setSize(pageSize);
|
|
|
+
|
|
|
+ return analysisPage;
|
|
|
+ }
|
|
|
}
|