|
@@ -3,6 +3,7 @@ package com.gyee.runeconomy.service.Electricity;
|
|
import com.gyee.common.contant.ContantXk;
|
|
import com.gyee.common.contant.ContantXk;
|
|
import com.gyee.common.util.DateUtils;
|
|
import com.gyee.common.util.DateUtils;
|
|
import com.gyee.common.util.SortUtils;
|
|
import com.gyee.common.util.SortUtils;
|
|
|
|
+import com.gyee.runeconomy.dto.CoulometricVo;
|
|
import com.gyee.runeconomy.dto.ElectricityVo;
|
|
import com.gyee.runeconomy.dto.ElectricityVo;
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
@@ -45,7 +46,7 @@ public class Electricityservice {
|
|
private final String FD = "-1";
|
|
private final String FD = "-1";
|
|
private final String GF = "-2";
|
|
private final String GF = "-2";
|
|
|
|
|
|
- public Map<String, Object> planvalue(String wpId, String timetype) throws Exception {
|
|
|
|
|
|
+ public Map<String, Object> planvalue(String wpId, String timetype) throws Exception {
|
|
|
|
|
|
List<ElectricityVo> vos = new ArrayList<ElectricityVo>();
|
|
List<ElectricityVo> vos = new ArrayList<ElectricityVo>();
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
@@ -157,15 +158,15 @@ public class Electricityservice {
|
|
|
|
|
|
|
|
|
|
//实际电量
|
|
//实际电量
|
|
- List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(),firstDayZeroHour);
|
|
|
|
- if (!sjdlls.isEmpty() && sjdlls !=null) {
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(), firstDayZeroHour);
|
|
|
|
+ if (!sjdlls.isEmpty() && sjdlls != null) {
|
|
bysjdlhjsum += sjdlls.get(0).getYfdldb().doubleValue();
|
|
bysjdlhjsum += sjdlls.get(0).getYfdldb().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) {
|
|
dqzqlsum = 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);
|
|
rfdlyclsum = dqycls.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
}
|
|
}
|
|
@@ -190,14 +191,14 @@ public class Electricityservice {
|
|
// //添加实际电量
|
|
// //添加实际电量
|
|
// PointData data = edosUtil.getSectionData(month, endOfDayOfLastDayOfMonth.getTime());
|
|
// PointData data = edosUtil.getSectionData(month, endOfDayOfLastDayOfMonth.getTime());
|
|
// PointData data = edosUtil.getSectionData(month, date1.getTime());
|
|
// PointData data = edosUtil.getSectionData(month, date1.getTime());
|
|
- vo.setSjdl(StringUtils.round(bysjdlhjsum /10000,2));
|
|
|
|
|
|
+ vo.setSjdl(StringUtils.round(bysjdlhjsum / 10000, 2));
|
|
|
|
|
|
|
|
|
|
//添加当月占比
|
|
//添加当月占比
|
|
- vo.setDyzb(StringUtils.round(((bysjdlhjsum / 10000)/bnjhdlsum ) *100,0));
|
|
|
|
|
|
+ vo.setDyzb(StringUtils.round(((bysjdlhjsum / 10000) / bnjhdlsum) * 100, 0));
|
|
|
|
|
|
//添加全年占比
|
|
//添加全年占比
|
|
- vo.setQnzb(StringUtils.round(((bysjdlhjsum / 10000) / yeardlsum) *100,0));
|
|
|
|
|
|
+ vo.setQnzb(StringUtils.round(((bysjdlhjsum / 10000) / yeardlsum) * 100, 0));
|
|
|
|
|
|
//添加超短期准确率
|
|
//添加超短期准确率
|
|
vo.setDqzql(dqzqlsum);
|
|
vo.setDqzql(dqzqlsum);
|
|
@@ -209,7 +210,7 @@ public class Electricityservice {
|
|
|
|
|
|
vos.add(vo);
|
|
vos.add(vo);
|
|
SortUtils.sort(vos, "hours", SortUtils.ASC);
|
|
SortUtils.sort(vos, "hours", SortUtils.ASC);
|
|
- map.put("value",vos);
|
|
|
|
|
|
+ map.put("value", vos);
|
|
}
|
|
}
|
|
|
|
|
|
double yeardlsum = 0.0;
|
|
double yeardlsum = 0.0;
|
|
@@ -231,8 +232,8 @@ public class Electricityservice {
|
|
// PointData bnsjdlhj = edosUtil.getHistMatrix(nfdl, currentDate.getTime() / 1000);
|
|
// PointData bnsjdlhj = edosUtil.getHistMatrix(nfdl, currentDate.getTime() / 1000);
|
|
// bnsjdlhjsum += bnsjdlhj.getPointValueInDouble();
|
|
// bnsjdlhjsum += bnsjdlhj.getPointValueInDouble();
|
|
|
|
|
|
- List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(),yearHour);
|
|
|
|
- bnsjdlhjsum += sjdlls.get(0).getNfdldb().doubleValue();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(), yearHour);
|
|
|
|
+ bnsjdlhjsum += sjdlls.get(0).getNfdldb().doubleValue();
|
|
|
|
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
calendar1.set(Calendar.DAY_OF_YEAR, 1);
|
|
calendar1.set(Calendar.DAY_OF_YEAR, 1);
|
|
@@ -243,16 +244,16 @@ public class Electricityservice {
|
|
|
|
|
|
Date firstDayOfYearZeroHour = calendar1.getTime();
|
|
Date firstDayOfYearZeroHour = calendar1.getTime();
|
|
|
|
|
|
- List<ProEconStationPower> dqyc = powerService.getlist1(wpls.getId(),firstDayOfYearZeroHour);
|
|
|
|
- if (!dqyc.isEmpty() && dqyc!=null) {
|
|
|
|
|
|
+ List<ProEconStationPower> dqyc = powerService.getlist1(wpls.getId(), firstDayOfYearZeroHour);
|
|
|
|
+ if (!dqyc.isEmpty() && dqyc != null) {
|
|
dqzqlhjsum = 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);
|
|
rfdlychjsum = dqyc.stream().map(ProEconStationPower::getDayPowerForecast).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
}
|
|
}
|
|
- map.put("bnjhdlhj",MathUtil.twoBit(yeardlsum));
|
|
|
|
- map.put("rfdlychj",rfdlychjsum);
|
|
|
|
- map.put("bnsjdlhj",MathUtil.twoBit(bnsjdlhjsum / 10000));
|
|
|
|
- map.put("qnzbhj",StringUtils.round(((bnsjdlhjsum / 10000) /yeardlsum) * 100,0));
|
|
|
|
- map.put("dqzqlhj",dqzqlhjsum);
|
|
|
|
|
|
+ map.put("bnjhdlhj", MathUtil.twoBit(yeardlsum));
|
|
|
|
+ map.put("rfdlychj", rfdlychjsum);
|
|
|
|
+ map.put("bnsjdlhj", MathUtil.twoBit(bnsjdlhjsum / 10000));
|
|
|
|
+ map.put("qnzbhj", StringUtils.round(((bnsjdlhjsum / 10000) / yeardlsum) * 100, 0));
|
|
|
|
+ map.put("dqzqlhj", dqzqlhjsum);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -260,19 +261,19 @@ public class Electricityservice {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
return map;
|
|
return map;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<String, Object> coulometric(String wpId) throws Exception {
|
|
|
|
|
|
+ public Map<String, Object> coulometric(String wpId) throws Exception {
|
|
|
|
|
|
- List<ProBasicPowerstation> wplsG = CacheContext.wplsG.stream().filter(g->wpId.equals(g.getId())).collect(Collectors.toList());
|
|
|
|
- List<ElectricityVo> vos = new ArrayList<ElectricityVo>();
|
|
|
|
|
|
+ List<ProBasicPowerstation> wplsG = CacheContext.wplsG.stream().filter(g -> wpId.equals(g.getId())).collect(Collectors.toList());
|
|
|
|
+ List<CoulometricVo> vos = new ArrayList<CoulometricVo>();
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
|
|
int day = 0;
|
|
int day = 0;
|
|
|
|
+ int ts = 1;
|
|
//当前年份
|
|
//当前年份
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
int currentyear = cal.get(Calendar.YEAR);//本年
|
|
int currentyear = cal.get(Calendar.YEAR);//本年
|
|
@@ -286,7 +287,6 @@ public class Electricityservice {
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
calendar.set(Calendar.SECOND, 0);
|
|
calendar.set(Calendar.SECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
-
|
|
|
|
Date yearHour = calendar.getTime();
|
|
Date yearHour = calendar.getTime();
|
|
|
|
|
|
// 获取当前日期
|
|
// 获取当前日期
|
|
@@ -306,31 +306,42 @@ public class Electricityservice {
|
|
// 获取firstDayZeroHour的月份
|
|
// 获取firstDayZeroHour的月份
|
|
Calendar calFirstDayZeroHour = Calendar.getInstance();
|
|
Calendar calFirstDayZeroHour = Calendar.getInstance();
|
|
calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
- int currentMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
|
|
|
+ int calFirstMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
|
+
|
|
|
|
+ //当前时间月份
|
|
|
|
+ int currentMonth = calendar.get(Calendar.MONTH) + 1;
|
|
|
|
+
|
|
|
|
|
|
// 将calendar2的时间设置回当前日期
|
|
// 将calendar2的时间设置回当前日期
|
|
calendar2.setTime(new Date());
|
|
calendar2.setTime(new Date());
|
|
|
|
|
|
- // 获取当前月份的天数
|
|
|
|
- int ts = calendar2.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
|
|
+ //年电量
|
|
|
|
+ double yeardlsum = 0.0;
|
|
|
|
+
|
|
|
|
+ double bnsjdlhjsum = 0.0;
|
|
|
|
+
|
|
|
|
+ double bnrzqdhjsum = 0.0;
|
|
|
|
+
|
|
|
|
+ double dxxsssum = 0.0;
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= 12; i++) {
|
|
for (int i = 1; i <= 12; i++) {
|
|
|
|
|
|
//本月计划电量
|
|
//本月计划电量
|
|
double byjhdlsum = 0.0;
|
|
double byjhdlsum = 0.0;
|
|
-
|
|
|
|
- //年电量
|
|
|
|
- double yeardlsum = 0.0;
|
|
|
|
-
|
|
|
|
//本月实际电量合计
|
|
//本月实际电量合计
|
|
double bysjdlhjsum = 0.0;
|
|
double bysjdlhjsum = 0.0;
|
|
-
|
|
|
|
|
|
+ double dxxss = 0.0;
|
|
//本月日照强度合计
|
|
//本月日照强度合计
|
|
double byrzqdhjsum = 0.0;
|
|
double byrzqdhjsum = 0.0;
|
|
|
|
|
|
- BigDecimal dqzqlsum = null;
|
|
|
|
- BigDecimal rfdlyclsum = null;
|
|
|
|
|
|
+ if (calFirstMonth == currentMonth) {
|
|
|
|
+ Calendar calendar5 = Calendar.getInstance();
|
|
|
|
+ ts = calendar5.get(Calendar.DAY_OF_MONTH);
|
|
|
|
+ } else {
|
|
|
|
+ // 获取当前月份的天数
|
|
|
|
+ ts = calFirstDayZeroHour.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
|
+ }
|
|
|
|
|
|
day = i;
|
|
day = i;
|
|
for (ProBasicPowerstation wpls : wplsG) {
|
|
for (ProBasicPowerstation wpls : wplsG) {
|
|
@@ -338,65 +349,75 @@ public class Electricityservice {
|
|
//计划电量-循环所有场站当前月集合
|
|
//计划电量-循环所有场站当前月集合
|
|
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> yearjh = yearls.stream().filter(wp -> wp.getWindpowerstationId().equals(wpls.getId()))
|
|
|
|
- .collect(Collectors.toList()); //当前场站1-12月所有集合
|
|
|
|
-
|
|
|
|
- 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());
|
|
- byjhdlsum += currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本月计划电量合
|
|
|
|
|
|
+ byjhdlsum = currentjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum(); //本月计划电量合
|
|
|
|
|
|
|
|
|
|
//当前场站循环月实际电量
|
|
//当前场站循环月实际电量
|
|
- List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(),firstDayZeroHour);
|
|
|
|
- if (!sjdlls.isEmpty() && sjdlls !=null) {
|
|
|
|
- bysjdlhjsum += sjdlls.get(0).getYfdldb().doubleValue();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpls.getId(), firstDayZeroHour);
|
|
|
|
+ if (!sjdlls.isEmpty() && sjdlls != null) {
|
|
|
|
+ bysjdlhjsum = sjdlls.get(0).getYfdldb().doubleValue();
|
|
}
|
|
}
|
|
|
|
|
|
//当前场站循环月日照强度
|
|
//当前场站循环月日照强度
|
|
- List<ProEconPowerstationInfoDay1> rzqdls = proEconPowerstationInfoDay1Service.getmax(wpls.getId(),firstDayZeroHour);
|
|
|
|
- if (!rzqdls.isEmpty() && rzqdls !=null) {
|
|
|
|
- byrzqdhjsum += rzqdls.get(0).getYpjfs().doubleValue();
|
|
|
|
|
|
+ List<ProEconPowerstationInfoDay1> rzqdls = proEconPowerstationInfoDay1Service.getmax(wpls.getId(), firstDayZeroHour);
|
|
|
|
+ if (!rzqdls.isEmpty() && rzqdls != null) {
|
|
|
|
+ byrzqdhjsum = rzqdls.get(0).getYpjfs().doubleValue();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ dxxss = (bysjdlhjsum / 10000) / wpls.getJrCapacity() * ts * 24;
|
|
|
|
+ dxxsssum += StringUtils.round(dxxss,0);
|
|
}
|
|
}
|
|
|
|
|
|
-// int ts = daysInMonth;
|
|
|
|
|
|
|
|
- ElectricityVo vo = new ElectricityVo();
|
|
|
|
|
|
+ CoulometricVo vo = new CoulometricVo();
|
|
|
|
|
|
//添加计划电量
|
|
//添加计划电量
|
|
vo.setJhdl(StringUtils.round(byjhdlsum, 2));
|
|
vo.setJhdl(StringUtils.round(byjhdlsum, 2));
|
|
vo.setHours(i);
|
|
vo.setHours(i);
|
|
//添加实际电量
|
|
//添加实际电量
|
|
- vo.setSjdl(StringUtils.round(bysjdlhjsum /10000,2));
|
|
|
|
|
|
+ vo.setSjdl(StringUtils.round(bysjdlhjsum / 10000, 2));
|
|
|
|
|
|
|
|
|
|
- //添加当月占比
|
|
|
|
- vo.setDyzb(StringUtils.round(((bysjdlhjsum / 10000)/byjhdlsum ) *100,0));
|
|
|
|
|
|
+ //添加完成情况
|
|
|
|
+ vo.setWcqk(StringUtils.round(((bysjdlhjsum / 10000) / byjhdlsum) * 100, 0));
|
|
|
|
|
|
-// //添加全年占比
|
|
|
|
-// vo.setQnzb(StringUtils.round(((bysjdlhjsum / 10000) / yeardlsum) *100,0));
|
|
|
|
|
|
+ //等效小时数
|
|
|
|
+ vo.setDxfdxs(StringUtils.round(dxxss,0));
|
|
|
|
|
|
- //添加日发电量预测
|
|
|
|
- vo.setRfdlyc(BigDecimal.valueOf(byrzqdhjsum));
|
|
|
|
|
|
+ //添加日照强度
|
|
|
|
+ vo.setRzqd(byrzqdhjsum);
|
|
|
|
|
|
// 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);
|
|
- map.put("value",vos);
|
|
|
|
-
|
|
|
|
|
|
+ map.put("value", vos);
|
|
|
|
|
|
// 月份增加一个月
|
|
// 月份增加一个月
|
|
firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, 1);
|
|
firstDayZeroHour = DateUtils.addMonths(firstDayZeroHour, 1);
|
|
calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
calFirstDayZeroHour.setTime(firstDayZeroHour);
|
|
- currentMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
|
|
|
+ calFirstMonth = calFirstDayZeroHour.get(Calendar.MONTH) + 1;
|
|
|
|
+ ts = calFirstDayZeroHour.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
}
|
|
}
|
|
|
|
+ List<ProBasicProjectPlan> yearls = proBasicProjectPlanService.getList(String.valueOf(currentyear));
|
|
|
|
+ List<ProBasicProjectPlan> yearjh = yearls.stream().filter(wp -> wp.getWindpowerstationId().equals(wpId)).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ yeardlsum = yearjh.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum();
|
|
|
|
+
|
|
|
|
+ List<ProEconPowerstationInfoDay5> sjdlls = proEconPowerstationInfoDay5Service.getmax(wpId, yearHour);
|
|
|
|
+ bnsjdlhjsum += sjdlls.get(0).getNfdldb().doubleValue();
|
|
|
|
+
|
|
|
|
+ List<ProEconPowerstationInfoDay1> rzqddlls = proEconPowerstationInfoDay1Service.getmax(wpId, yearHour);
|
|
|
|
+ bnrzqdhjsum += rzqddlls.get(0).getNpjfs().doubleValue();
|
|
|
|
+
|
|
|
|
+ map.put("jhdlhj",yeardlsum);
|
|
|
|
+ map.put("sjdlhj",StringUtils.round((bnsjdlhjsum / 10000),2));
|
|
|
|
+ map.put("wcqkhj",StringUtils.round(((bnsjdlhjsum / 10000) / yeardlsum) * 100,0));
|
|
|
|
+ map.put("rzqdhj",StringUtils.round(bnrzqdhjsum,2));
|
|
|
|
+ map.put("dxxsshj",StringUtils.round(dxxsssum,0));
|
|
|
|
+
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+}
|