|
@@ -112,19 +112,34 @@ public class Electricityservice {
|
|
calendar.set(Calendar.SECOND, 0);
|
|
calendar.set(Calendar.SECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
|
- Date firstDayZeroHour = calendar.getTime();
|
|
|
|
Date yearHour = calendar.getTime();
|
|
Date yearHour = calendar.getTime();
|
|
|
|
|
|
|
|
+ // 获取当前日期
|
|
|
|
+ Calendar calendar2 = Calendar.getInstance();
|
|
|
|
+ calendar2.setTime(new Date());
|
|
|
|
|
|
|
|
+ // 设置为本年一月一号0点
|
|
|
|
+ calendar2.set(Calendar.MONTH, Calendar.JANUARY); // 0表示一月
|
|
|
|
+ calendar2.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
+ calendar2.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ calendar2.set(Calendar.MINUTE, 0);
|
|
|
|
+ calendar2.set(Calendar.SECOND, 0);
|
|
|
|
+ calendar2.set(Calendar.MILLISECOND, 0);
|
|
|
|
|
|
- for (int i = month2; i > 0; i--) {
|
|
|
|
|
|
+ Date firstDayZeroHour = calendar2.getTime();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
double bnjhdlsum = 0.0;
|
|
double bnjhdlsum = 0.0;
|
|
double yeardlsum = 0.0;
|
|
double yeardlsum = 0.0;
|
|
double bysjdlhjsum = 0.0;
|
|
double bysjdlhjsum = 0.0;
|
|
- BigDecimal cdqzqlsum = null;
|
|
|
|
|
|
+ BigDecimal dqzqlsum = null;
|
|
|
|
+ BigDecimal rfdlyclsum = null;
|
|
double number = 100;
|
|
double number = 100;
|
|
day = i;
|
|
day = i;
|
|
for (ProBasicPowerstation wpls : wplist) {
|
|
for (ProBasicPowerstation wpls : wplist) {
|
|
|
|
+
|
|
|
|
+ //计划电量
|
|
List<ProBasicProjectPlan> currentls = proBasicProjectPlanService.getmonthList(String.valueOf(day)); //本月所有集合
|
|
List<ProBasicProjectPlan> currentls = proBasicProjectPlanService.getmonthList(String.valueOf(day)); //本月所有集合
|
|
|
|
|
|
List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
|
|
List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
|
|
@@ -133,19 +148,23 @@ public class Electricityservice {
|
|
yeardlsum += yearjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本年计划电量合
|
|
yeardlsum += yearjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本年计划电量合
|
|
|
|
|
|
|
|
|
|
- //本年所有集合
|
|
|
|
|
|
+ //计划电量本年所有集合
|
|
List<ProBasicProjectPlan> currentjh = currentls.stream().filter(wp -> wp.getWindpowerstationId().equals(wpls.getId())).collect(Collectors.toList());
|
|
List<ProBasicProjectPlan> currentjh = currentls.stream().filter(wp -> wp.getWindpowerstationId().equals(wpls.getId())).collect(Collectors.toList());
|
|
bnjhdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本月计划电量合
|
|
bnjhdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本月计划电量合
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //实际电量
|
|
List<ProEconPowerstationInfoDay1> sjdlls = proEconPowerstationInfoDay1Service.getmax(wpls.getId(),firstDayZeroHour);
|
|
List<ProEconPowerstationInfoDay1> sjdlls = proEconPowerstationInfoDay1Service.getmax(wpls.getId(),firstDayZeroHour);
|
|
if (!sjdlls.isEmpty() && sjdlls !=null) {
|
|
if (!sjdlls.isEmpty() && sjdlls !=null) {
|
|
bysjdlhjsum += sjdlls.get(0).getYfdl().doubleValue();
|
|
bysjdlhjsum += sjdlls.get(0).getYfdl().doubleValue();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //短期预测准确率和日发电量预测
|
|
List<ProEconStationPower> dqycls = powerService.getlist(wpls.getId(),firstDayZeroHour);
|
|
List<ProEconStationPower> dqycls = powerService.getlist(wpls.getId(),firstDayZeroHour);
|
|
|
|
|
|
if (!dqycls.isEmpty() && dqycls != null){
|
|
if (!dqycls.isEmpty() && dqycls != null){
|
|
- cdqzqlsum = dqycls.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
+ dqzqlsum = dqycls.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ rfdlyclsum = dqycls.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -178,9 +197,12 @@ public class Electricityservice {
|
|
vo.setQnzb(MathUtil.twoBit(((bysjdlhjsum / 10000) / yeardlsum)));
|
|
vo.setQnzb(MathUtil.twoBit(((bysjdlhjsum / 10000) / yeardlsum)));
|
|
|
|
|
|
//添加超短期准确率
|
|
//添加超短期准确率
|
|
- vo.setCdqzql(cdqzqlsum);
|
|
|
|
|
|
+ vo.setDqzql(dqzqlsum);
|
|
|
|
+
|
|
|
|
+ //添加日发电量预测
|
|
|
|
+ vo.setRfdlyc(rfdlyclsum);
|
|
|
|
|
|
- firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, -1);
|
|
|
|
|
|
+ firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, +1);
|
|
|
|
|
|
vos.add(vo);
|
|
vos.add(vo);
|
|
SortUtils.sort(vos, "hours", SortUtils.ASC);
|
|
SortUtils.sort(vos, "hours", SortUtils.ASC);
|
|
@@ -189,9 +211,12 @@ public class Electricityservice {
|
|
|
|
|
|
double yeardlsum = 0.0;
|
|
double yeardlsum = 0.0;
|
|
double bnsjdlhjsum = 0.0;
|
|
double bnsjdlhjsum = 0.0;
|
|
- BigDecimal cdqzqlhjsum = null;
|
|
|
|
|
|
+ BigDecimal dqzqlhjsum = null;
|
|
|
|
+ BigDecimal rfdlychjsum = null;
|
|
double cdqyc = 0.0;
|
|
double cdqyc = 0.0;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //计算合计
|
|
for (ProBasicPowerstation wpls : wplist) {
|
|
for (ProBasicPowerstation wpls : wplist) {
|
|
//计划电量合计
|
|
//计划电量合计
|
|
List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
|
|
List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
|
|
@@ -217,13 +242,15 @@ public class Electricityservice {
|
|
|
|
|
|
List<ProEconStationPower> dqyc = powerService.getlist1(wpls.getId(),firstDayOfYearZeroHour);
|
|
List<ProEconStationPower> dqyc = powerService.getlist1(wpls.getId(),firstDayOfYearZeroHour);
|
|
if (!dqyc.isEmpty() && dqyc!=null) {
|
|
if (!dqyc.isEmpty() && dqyc!=null) {
|
|
- cdqzqlhjsum = dqyc.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
+ dqzqlhjsum = dqyc.stream().map(ProEconStationPower::getPowerAccuracy).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ rfdlychjsum = dqyc.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
}
|
|
}
|
|
-
|
|
|
|
- map.put("bnsjdlhj",MathUtil.twoBit(bnsjdlhjsum / 10000));
|
|
|
|
map.put("bnjhdlhj",MathUtil.twoBit(yeardlsum));
|
|
map.put("bnjhdlhj",MathUtil.twoBit(yeardlsum));
|
|
|
|
+ map.put("rfdlychj",rfdlychjsum);
|
|
|
|
+ map.put("bnsjdlhj",MathUtil.twoBit(bnsjdlhjsum / 10000));
|
|
map.put("qnzbhj",MathUtil.twoBit((bnsjdlhjsum / 10000) /yeardlsum));
|
|
map.put("qnzbhj",MathUtil.twoBit((bnsjdlhjsum / 10000) /yeardlsum));
|
|
- map.put("cdqzqlhj",cdqzqlhjsum);
|
|
|
|
|
|
+ map.put("dqzqlhj",dqzqlhjsum);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|