|
@@ -257,7 +257,7 @@ public class PVSystemEfficiencyCalculator {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- //计算期次级别
|
|
|
|
|
|
+ //计算线路级别
|
|
int ts3 = 1; // 设置为本年一月一号0点
|
|
int ts3 = 1; // 设置为本年一月一号0点
|
|
|
|
|
|
Calendar calendar3 = Calendar.getInstance();
|
|
Calendar calendar3 = Calendar.getInstance();
|
|
@@ -391,79 +391,82 @@ public class PVSystemEfficiencyCalculator {
|
|
Date date = null;
|
|
Date date = null;
|
|
List<ProEconSystemEfficiencyEquipment> stringList = new ArrayList<>();
|
|
List<ProEconSystemEfficiencyEquipment> stringList = new ArrayList<>();
|
|
for (ProBasicPowerstation wp : CacheContext.wplsG) {
|
|
for (ProBasicPowerstation wp : CacheContext.wplsG) {
|
|
- List<ProBasicEquipment> wtlsG = CacheContext.wtls.stream().filter(p -> p.getSpare1().equals("IN") && wp.getId().equals(p.getWindpowerstationId())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
- for (ProBasicEquipment wt : wtlsG) {
|
|
|
|
|
|
+ List<ProBasicEquipment> wtlsG = CacheContext.wtls.stream().filter(p -> p.getSpare1().equals("IN") && wp.getId().equals(p.getWindpowerstationId())).collect(Collectors.toList());
|
|
|
|
|
|
- List<ProEconEquipmentmodel> collect = CacheContext.equipmentmodels.stream().filter(w -> wt.getModelId().equals(w.getId())).collect(Collectors.toList());
|
|
|
|
|
|
+ for (ProBasicEquipment wt : wtlsG) {
|
|
|
|
+
|
|
|
|
+ List<ProEconEquipmentmodel> collect = CacheContext.equipmentmodels.stream().filter(w -> wt.getModelId().equals(w.getId())).collect(Collectors.toList());
|
|
|
|
|
|
// for (int i = 0; i < currentMonth; i++) {
|
|
// for (int i = 0; i < currentMonth; i++) {
|
|
|
|
|
|
|
|
|
|
- if (calFirstMonth4 == currentMonth && dqnf == currentyear) {
|
|
|
|
- Calendar calendar5 = Calendar.getInstance();
|
|
|
|
- ts4 = calendar5.get(Calendar.DAY_OF_MONTH);
|
|
|
|
- } else {
|
|
|
|
- // 获取当前月份的天数
|
|
|
|
- ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
- }
|
|
|
|
|
|
+ if (calFirstMonth4 == currentMonth && dqnf == currentyear) {
|
|
|
|
+ Calendar calendar5 = Calendar.getInstance();
|
|
|
|
+ ts4 = calendar5.get(Calendar.DAY_OF_MONTH);
|
|
|
|
+ } else {
|
|
|
|
+ // 获取当前月份的天数
|
|
|
|
+ ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
+ }
|
|
|
|
|
|
- List<ProEconEquipmentInfoDay1> rzqdls = proEconEquipmentInfoDay1Service.getmax(wt.getId(), firstDayZeroHour4);
|
|
|
|
|
|
+ List<ProEconEquipmentInfoDay1> rzqdls = proEconEquipmentInfoDay1Service.getmax(wt.getId(), firstDayZeroHour4);
|
|
|
|
|
|
- double solarRadiationWattsPerSquareMeter = 0.0; // 太阳能辐射,单位为W/m²
|
|
|
|
- double actualPowerOutputKilowattHours = 0.0; // 实际发电量,单位为千瓦时(kWh)
|
|
|
|
- double moduleCapacityKilowatts = 0.0; // 光伏模块额定容量,单位为千瓦(kW)
|
|
|
|
- double pr = 0.0;
|
|
|
|
|
|
+ double solarRadiationWattsPerSquareMeter = 0.0; // 太阳能辐射,单位为W/m²
|
|
|
|
+ double actualPowerOutputKilowattHours = 0.0; // 实际发电量,单位为千瓦时(kWh)
|
|
|
|
+ double moduleCapacityKilowatts = 0.0; // 光伏模块额定容量,单位为千瓦(kW)
|
|
|
|
+ double pr = 0.0;
|
|
|
|
|
|
- if (!rzqdls.isEmpty() && rzqdls != null) {
|
|
|
|
- for (ProEconEquipmentInfoDay1 day : rzqdls) {
|
|
|
|
- actualPowerOutputKilowattHours = day.getYfdl().doubleValue();
|
|
|
|
- solarRadiationWattsPerSquareMeter = day.getYpjfs().doubleValue();
|
|
|
|
- date = day.getRecordDate();
|
|
|
|
|
|
+ if (!rzqdls.isEmpty() && rzqdls != null) {
|
|
|
|
+ for (ProEconEquipmentInfoDay1 day : rzqdls) {
|
|
|
|
+ actualPowerOutputKilowattHours = day.getYfdl().doubleValue();
|
|
|
|
+ solarRadiationWattsPerSquareMeter = day.getYpjfs().doubleValue();
|
|
|
|
+ date = day.getRecordDate();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
- moduleCapacityKilowatts = collect.get(0).getPowerProduction();
|
|
|
|
|
|
+ moduleCapacityKilowatts = collect.get(0).getPowerProduction();
|
|
|
|
|
|
- double expectedPowerOutputKilowattHours = calculateExpectedPowerOutput(solarRadiationWattsPerSquareMeter, moduleCapacityKilowatts, ts4); // 预期发电量(kWh)
|
|
|
|
- pr = calculatePR(actualPowerOutputKilowattHours, expectedPowerOutputKilowattHours); // 计算PR
|
|
|
|
|
|
+ double expectedPowerOutputKilowattHours = calculateExpectedPowerOutput(solarRadiationWattsPerSquareMeter, moduleCapacityKilowatts, ts4); // 预期发电量(kWh)
|
|
|
|
+ pr = calculatePR(actualPowerOutputKilowattHours, expectedPowerOutputKilowattHours); // 计算PR
|
|
|
|
|
|
- pr = StringUtils.round(pr, 2);
|
|
|
|
- solarRadiationWattsPerSquareMeter = StringUtils.round(solarRadiationWattsPerSquareMeter, 2);
|
|
|
|
|
|
+ pr = StringUtils.round(pr, 2);
|
|
|
|
+ solarRadiationWattsPerSquareMeter = StringUtils.round(solarRadiationWattsPerSquareMeter, 2);
|
|
|
|
|
|
|
|
|
|
- ProEconSystemEfficiencyEquipment power = new ProEconSystemEfficiencyEquipment();
|
|
|
|
- if (date != null) {
|
|
|
|
- power.setId(StringUtils.getUUID());
|
|
|
|
- power.setForeignKeyId(wt.getNemCode());
|
|
|
|
- power.setStationId(wt.getWindpowerstationId());
|
|
|
|
- power.setProjectId(wt.getProjectId());
|
|
|
|
- power.setLineId(wt.getLineId());
|
|
|
|
- power.setEquipmentId(wt.getId());
|
|
|
|
- power.setLocation("wt");
|
|
|
|
- power.setDataDate(date);
|
|
|
|
- power.setPowerGeneration(actualPowerOutputKilowattHours);
|
|
|
|
- power.setLlfdlmax(expectedPowerOutputKilowattHours);
|
|
|
|
- power.setRzqd(solarRadiationWattsPerSquareMeter);
|
|
|
|
- power.setEfficiency(pr);
|
|
|
|
- power.setOrderNum(wt.getOrderNum());
|
|
|
|
- stringList.add(power);
|
|
|
|
- }
|
|
|
|
|
|
+ ProEconSystemEfficiencyEquipment power = new ProEconSystemEfficiencyEquipment();
|
|
|
|
+ if (date != null) {
|
|
|
|
+ power.setId(StringUtils.getUUID());
|
|
|
|
+ power.setForeignKeyId(wt.getNemCode());
|
|
|
|
+ power.setStationId(wt.getWindpowerstationId());
|
|
|
|
+ power.setProjectId(wt.getProjectId());
|
|
|
|
+ power.setLineId(wt.getLineId());
|
|
|
|
+ power.setEquipmentId(wt.getId());
|
|
|
|
+ power.setLocation("wt");
|
|
|
|
+ power.setDataDate(date);
|
|
|
|
+ power.setPowerGeneration(actualPowerOutputKilowattHours);
|
|
|
|
+ power.setLlfdlmax(expectedPowerOutputKilowattHours);
|
|
|
|
+ power.setRzqd(solarRadiationWattsPerSquareMeter);
|
|
|
|
+ power.setEfficiency(pr);
|
|
|
|
+ power.setOrderNum(wt.getOrderNum());
|
|
|
|
+ stringList.add(power);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
//
|
|
//
|
|
// firstDayZeroHour4 = DateUtils.addMonths(firstDayZeroHour4, 1);
|
|
// firstDayZeroHour4 = DateUtils.addMonths(firstDayZeroHour4, 1);
|
|
// calFirstDayZeroHour4.setTime(firstDayZeroHour4);
|
|
// calFirstDayZeroHour4.setTime(firstDayZeroHour4);
|
|
// calFirstMonth4 = calFirstDayZeroHour4.get(Calendar.MONTH) + 1;
|
|
// calFirstMonth4 = calFirstDayZeroHour4.get(Calendar.MONTH) + 1;
|
|
- ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
|
|
+ ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
// }
|
|
// }
|
|
- // 恢复初始值
|
|
|
|
|
|
+ // 恢复初始值
|
|
// firstDayZeroHour4 = initialFirstDayZeroHour4;
|
|
// firstDayZeroHour4 = initialFirstDayZeroHour4;
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ efficiencyEquipmentService.batchAdd(stringList);
|
|
|
|
+ stringList.clear();
|
|
}
|
|
}
|
|
|
|
|
|
- efficiencyEquipmentService.batchAdd(stringList);
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|