|
@@ -51,13 +51,15 @@ public class ElePerAnalysisService {
|
|
|
|
|
|
List<WindpowerstationPG> list = windpowerstationPGService.findWindpowerstationPG(companyid, regionid, station);
|
|
|
for (WindpowerstationPG wp : list) {
|
|
|
- String wpString = (String) (globalCache.get(station));
|
|
|
+ String wpString = JSONObject.toJSONString(globalCache.get(station));
|
|
|
Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
|
|
|
});
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(beginDate);
|
|
|
+
|
|
|
+
|
|
|
List<ProjectplanPG> pgList = projectplanPGService.findProjectplanPG(station, String.valueOf(calendar.get(Calendar.YEAR)), String.valueOf(calendar.get(Calendar.MONTH)));
|
|
|
//(风场、发电量 YFDL、风速 YPJFS、计划发电量、发电小时、停机小时、故障小时、电量完成率)
|
|
|
ElePerAnalysisVo vo = new ElePerAnalysisVo();
|
|
@@ -66,9 +68,14 @@ public class ElePerAnalysisService {
|
|
|
|
|
|
if (null != stringMapMap) {
|
|
|
String fs = stringMapMap.get("YPJFS").getCode();//月平局风速
|
|
|
- List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, endDate.getTime() - 2, endDate.getTime() - 1, 1l, null);
|
|
|
+ calendar.setTime(endDate);
|
|
|
+ calendar.add(Calendar.SECOND, -2);
|
|
|
+ long newend = calendar.getTimeInMillis() / 1000;
|
|
|
+ calendar.add(Calendar.SECOND, -1);
|
|
|
+ long newbing = calendar.getTimeInMillis() / 1000;
|
|
|
+ List<PointData> fss = realApiUtil.getHistoryDatasSnap(fs, newbing, newend, 1l, 1L);
|
|
|
String yfdl = stringMapMap.get("YFDL").getCode();//发电量
|
|
|
- List<PointData> yfdls = realApiUtil.getHistoryDatasSnap(yfdl, endDate.getTime() - 2, endDate.getTime() - 1, 1l, null);
|
|
|
+ List<PointData> yfdls = realApiUtil.getHistoryDatasSnap(yfdl, newbing, newend, 1l, 1L);
|
|
|
if (!fss.isEmpty() && !yfdl.isEmpty()) {
|
|
|
vo.setFs(fss.get(0).getPointValueInDouble());
|
|
|
vo.setGeneration(yfdls.get(0).getPointValueInDouble());
|
|
@@ -77,9 +84,12 @@ public class ElePerAnalysisService {
|
|
|
}
|
|
|
|
|
|
List<Windpowerinfoday> windpowerinfodayList = windpowerinfodayService.getWindpowerinfodayList2(station, beginDate, endDate);
|
|
|
- Double runhourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getRunhours).sum();
|
|
|
- Double stophourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getStophours).sum();
|
|
|
- Double faulthourssum = windpowerinfodayList.stream().mapToDouble(Windpowerinfoday::getFaulthours).sum();
|
|
|
+ Double runhourssum = windpowerinfodayList.stream().filter(n -> null!=n.getRunhours()).mapToDouble(Windpowerinfoday::getRunhours).sum();
|
|
|
+// Double runhourssum = windpowerinfodayList.stream().collect(Collectors.summingDouble(Windpowerinfoday::getRunhours));
|
|
|
+ Double stophourssum = windpowerinfodayList.stream().filter(n->null!= n.getStophours()).mapToDouble(Windpowerinfoday::getStophours).sum();
|
|
|
+// Double stophourssum = windpowerinfodayList.stream().collect(Collectors.summingDouble(Windpowerinfoday::getStophours));
|
|
|
+ Double faulthourssum = windpowerinfodayList.stream().filter(n->null!= n.getFaulthours()).mapToDouble(Windpowerinfoday::getFaulthours).sum();
|
|
|
+// Double faulthourssum = windpowerinfodayList.stream().collect(Collectors.summingDouble(Windpowerinfoday::getFaulthours));
|
|
|
vo.setRunhours(runhourssum);
|
|
|
vo.setStophours(stophourssum);
|
|
|
vo.setFaulthours(faulthourssum);
|