|
@@ -81,7 +81,7 @@ public class PVSystemEfficiencyCalculator {
|
|
|
List<ProBasicPowerstation> wplsG = CacheContext.wplsG;
|
|
|
List<ProBasicProject> pjlsG = CacheContext.pjls.stream().filter(p -> p.getSpare4().equals("2")).collect(Collectors.toList());
|
|
|
List<ProBasicLine> lnlsG = CacheContext.lnls.stream().filter(p -> p.getSpare4().equals("2")).collect(Collectors.toList());
|
|
|
- List<ProBasicEquipment> wtlsG = CacheContext.wtls.stream().filter(p -> p.getSpare1().equals("IN")).collect(Collectors.toList());
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -390,73 +390,77 @@ public class PVSystemEfficiencyCalculator {
|
|
|
int calFirstMonth4 = calFirstDayZeroHour4.get(Calendar.MONTH) + 1;
|
|
|
Date date = null;
|
|
|
List<ProEconSystemEfficiencyEquipment> stringList = new ArrayList<>();
|
|
|
- for (ProBasicEquipment wt : wtlsG) {
|
|
|
+ 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());
|
|
|
|
|
|
- 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());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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;
|
|
|
- double actualPowerOutputKilowattHours = 0.0;
|
|
|
- double moduleCapacityKilowatts = 0.0;
|
|
|
- double pr = 0.0;
|
|
|
+ double solarRadiationWattsPerSquareMeter = 0.0;
|
|
|
+ double actualPowerOutputKilowattHours = 0.0;
|
|
|
+ double moduleCapacityKilowatts = 0.0;
|
|
|
+ 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);
|
|
|
- pr = calculatePR(actualPowerOutputKilowattHours, expectedPowerOutputKilowattHours);
|
|
|
+ double expectedPowerOutputKilowattHours = calculateExpectedPowerOutput(solarRadiationWattsPerSquareMeter, moduleCapacityKilowatts, ts4);
|
|
|
+ pr = calculatePR(actualPowerOutputKilowattHours, expectedPowerOutputKilowattHours);
|
|
|
|
|
|
- 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);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
+ ts4 = calFirstDayZeroHour4.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
efficiencyEquipmentService.batchAdd(stringList);
|