|
@@ -150,7 +150,7 @@ public class BenchmarkingService {
|
|
|
return true;
|
|
|
}).collect(Collectors.toList());*/
|
|
|
List<ProBasicOrganizeTree> collect = CacheContext.proBasicOrganizeTrees.stream()
|
|
|
- .filter(ot->!"EQ".equals(ot.getOrgType())).collect(Collectors.toList());
|
|
|
+ .filter(ot -> !"EQ".equals(ot.getOrgType())).collect(Collectors.toList());
|
|
|
SortUtils.sort(collect, "orderNum", SortUtils.ASC);
|
|
|
organizeTrees = ObjectUtil.cloneByStream(collect);
|
|
|
ProBasicOrganizeTree.buildTree(organizeTrees);
|
|
@@ -1584,11 +1584,11 @@ public class BenchmarkingService {
|
|
|
if (companys.contains("RGN")) {
|
|
|
wpList = CacheContext.organizeEquipmentList.stream().map(el -> el.getWindpowerstationId()).distinct().collect(Collectors.toList());
|
|
|
} else {
|
|
|
- wpList = CacheContext.organizeEquipmentList.stream().filter(el -> wpids.contains(el.getCompanyId()))
|
|
|
+ wpList = CacheContext.organizeEquipmentList.stream().filter(el -> companys.contains(el.getCompanyId()))
|
|
|
.map(el -> el.getWindpowerstationId()).distinct().collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(wpList)){
|
|
|
+ if (StringUtils.isNotEmpty(wpList)) {
|
|
|
qw.in("windpowerstation_id", wpList);
|
|
|
pepi1.in("windpowerstation_id", wpList);
|
|
|
}
|
|
@@ -1600,33 +1600,56 @@ public class BenchmarkingService {
|
|
|
List<ProEconPowerstationInfoDay1> lpepi1 = iProEconPowerstationInfoDay1Service.list(pepi1);
|
|
|
Map<String, ProEconPowerstationInfoDay1> pepid1Map = lpepi1.stream().collect(Collectors.toMap(ProEconPowerstationInfoDay1::getWindpowerstationId, Function.identity()));
|
|
|
|
|
|
+ List<String> finalWpList = wpList;
|
|
|
Map<String, ProBasicPowerstationPoint> collect = CacheContext.proBasicPowerstationPoint.stream()
|
|
|
- .filter(p -> "GNLYL".equals(p.getUniformCode()) && wpids.contains(p.getWindpowerstationId()))
|
|
|
+ .filter(p -> "GNLYL".equals(p.getUniformCode()) && finalWpList.contains(p.getWindpowerstationId()))
|
|
|
.collect(Collectors.toMap(ProBasicPowerstationPoint::getWindpowerstationId, Function.identity()));
|
|
|
|
|
|
for (ProEconPowerstationInfoDay7 day7 : lpepi7) {
|
|
|
String wpId = day7.getWindpowerstationId();
|
|
|
OperationalAnalysis oa = new OperationalAnalysis();
|
|
|
- oa.setWpsName(CacheContext.proBasicOrganizeTreesMap.get(wpId).getAname());
|
|
|
+ if (CacheContext.proBasicOrganizeTreesMap.get(wpId) == null) {
|
|
|
+ System.out.println(wpId);
|
|
|
+ } else {
|
|
|
+ oa.setWpsName(CacheContext.proBasicOrganizeTreesMap.get(wpId).getAname());
|
|
|
+ }
|
|
|
oa.setWpsId(wpId);
|
|
|
oa.setModelId(equipmentStationMap.get(wpId).get(0).getModelId());
|
|
|
oa.setConversionRate(day7.getRnbqzhxl().doubleValue());
|
|
|
- oa.setUtilizationHour(pepid1Map.get(wpId).getRfdl().doubleValue() / (CacheContext.proBasicOrganizeTreesMap.get(wpId).getZjCapacity()));
|
|
|
+
|
|
|
+ Double zjCapacity = CacheContext.proBasicOrganizeTreesMap.get(wpId).getZjCapacity();
|
|
|
+ ProEconPowerstationInfoDay1 day1 = pepid1Map.get(wpId);
|
|
|
+ BigDecimal pv = pepid1Map.get(wpId).getRfdl();
|
|
|
+ if (zjCapacity == null || zjCapacity == 0 || pv == null) {
|
|
|
+ oa.setUtilizationHour(0.0);
|
|
|
+ } else {
|
|
|
+ oa.setUtilizationHour(pv.doubleValue() / zjCapacity);
|
|
|
+ }
|
|
|
+
|
|
|
List<PointData> historyDatasRaw = edosUtil.getHistoryDatasRaw(collect.get(wpId).getNemCode(), date1.getTime() / 1000, date2.getTime() / 1000);
|
|
|
double v = historyDatasRaw.stream().mapToDouble(PointData::getPointValueInDouble).average().orElse(0);
|
|
|
oa.setIlluminationUtilizationRate(v);
|
|
|
resultList.add(oa);
|
|
|
}
|
|
|
- Collection<OperationalAnalysis> values = resultList.stream().collect(Collectors.toMap(OperationalAnalysis::getModelId, r -> r, (r1, r2) -> {
|
|
|
+/* Collection<OperationalAnalysis> values = resultList.stream().collect(Collectors.toMap(OperationalAnalysis::getModelId, r -> r, (r1, r2) -> {
|
|
|
r1.setConversionRate(r1.getConversionRate() + r2.getConversionRate());
|
|
|
r1.setUtilizationHour(r1.getUtilizationHour() + r2.getUtilizationHour());
|
|
|
r1.setIlluminationUtilizationRate(r1.getIlluminationUtilizationRate() + r2.getIlluminationUtilizationRate());
|
|
|
return r1;
|
|
|
- })).values();
|
|
|
- List<OperationalAnalysis> collect1 = values.stream().peek(oa -> {
|
|
|
- oa.setConversionRate(NumberUtil.round(oa.getConversionRate(), 2).doubleValue());
|
|
|
- oa.setUtilizationHour(NumberUtil.round(oa.getUtilizationHour(), 2).doubleValue());
|
|
|
- oa.setIlluminationUtilizationRate(NumberUtil.round(oa.getIlluminationUtilizationRate(), 2).doubleValue());
|
|
|
+ })).values();*/
|
|
|
+
|
|
|
+ List<OperationalAnalysis> collect1 = resultList.stream().peek(oa -> {
|
|
|
+ if (oa.getConversionRate() != null) {
|
|
|
+ oa.setConversionRate(NumberUtil.round(oa.getConversionRate(), 2).doubleValue());
|
|
|
+ }
|
|
|
+ if (oa.getUtilizationHour() != null) {
|
|
|
+ oa.setUtilizationHour(NumberUtil.round(oa.getUtilizationHour(), 2).doubleValue());
|
|
|
+ }
|
|
|
+ Double utilizationRate = oa.getIlluminationUtilizationRate();
|
|
|
+ if (utilizationRate != null && !Double.isInfinite(utilizationRate)) {
|
|
|
+ oa.setIlluminationUtilizationRate(NumberUtil.round(utilizationRate, 2).doubleValue());
|
|
|
+ }
|
|
|
+
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
return collect1;
|