|
@@ -54,7 +54,7 @@ public class AverageAndGeneratingService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 保存风速,功率实时计算点
|
|
|
|
|
|
+ * 保存平均风速,平均功率,scada发电量实时计算点
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public void saveAvespeedAndAvepowerAndScada() throws Exception {
|
|
public void saveAvespeedAndAvepowerAndScada() throws Exception {
|
|
@@ -64,139 +64,351 @@ public class AverageAndGeneratingService {
|
|
List<Project> projects = wppromap.get(wp.getId());
|
|
List<Project> projects = wppromap.get(wp.getId());
|
|
Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
|
|
Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
|
|
Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
|
|
Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
|
|
|
|
+ Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
|
|
|
|
+ Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
|
|
Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
|
|
Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
|
|
|
|
+ Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
|
|
|
|
+ Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
|
|
|
|
+ Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
|
|
|
|
+ Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
|
|
|
|
+ Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
|
|
List<PointData> projectavespeedList = new ArrayList<>();
|
|
List<PointData> projectavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> yprojectavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> nprojectavespeedList = new ArrayList<>();
|
|
List<PointData> projectavepowerList = new ArrayList<>();
|
|
List<PointData> projectavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> yprojectavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> nprojectavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> projectfdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> projectyfdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> projectnfdlList = new ArrayList<>();
|
|
projects.stream().forEach(project -> {
|
|
projects.stream().forEach(project -> {
|
|
List<Line> lines = prolinemap.get(project);
|
|
List<Line> lines = prolinemap.get(project);
|
|
Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
|
|
Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
|
|
Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
|
|
Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
|
|
|
|
+ Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
|
|
|
|
+ Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
|
|
Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
|
|
Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
|
|
|
|
+ Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
|
|
|
|
+ Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
|
|
|
|
+ Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
|
|
|
|
+ Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
|
|
|
|
+ Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
|
|
List<PointData> lineavespeedList = new ArrayList<>();
|
|
List<PointData> lineavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> ylineavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> nlineavespeedList = new ArrayList<>();
|
|
List<PointData> lineavepowerList = new ArrayList<>();
|
|
List<PointData> lineavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> ylineavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> nlineavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> linefdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> ylinefdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> nlinefdlList = new ArrayList<>();
|
|
lines.stream().forEach(line -> {
|
|
lines.stream().forEach(line -> {
|
|
List<Windturbine> windturbines = linewtmap.get(line.getId());
|
|
List<Windturbine> windturbines = linewtmap.get(line.getId());
|
|
Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
|
|
Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
|
|
Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
|
|
Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
|
|
|
|
+ Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
|
|
|
|
+ Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
|
|
Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
|
|
Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
|
|
|
|
+ Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
|
|
|
|
+ Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
|
|
|
|
+ Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
|
|
|
|
+ Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
|
|
|
|
+ Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
|
|
List<PointData> wtavespeedList = new ArrayList<>();
|
|
List<PointData> wtavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> ywtavespeedList = new ArrayList<>();
|
|
|
|
+ List<PointData> nwtavespeedList = new ArrayList<>();
|
|
List<PointData> wtavepowerList = new ArrayList<>();
|
|
List<PointData> wtavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> ywtavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> nwtavepowerList = new ArrayList<>();
|
|
|
|
+ List<PointData> rfdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> yfdlList = new ArrayList<>();
|
|
|
|
+ List<PointData> nfdlList = new ArrayList<>();
|
|
|
|
|
|
windturbines.stream().forEach(wt->{
|
|
windturbines.stream().forEach(wt->{
|
|
Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
|
|
Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
|
|
Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
|
|
Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
|
|
|
|
+ Windturbinetestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
|
|
|
|
+ Windturbinetestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
|
|
Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
|
|
Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
|
|
Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
|
|
Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
|
|
|
|
+ Windturbinetestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
|
|
|
|
+ Windturbinetestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
|
|
Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
|
|
Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
|
|
|
|
+ Windturbinetestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
|
|
|
|
+ Windturbinetestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
|
|
|
|
+ Windturbinetestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
|
|
|
|
+ Windturbinetestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
|
|
try {
|
|
try {
|
|
|
|
+ //算发电量
|
|
|
|
+ Double currentValue = 0.0;
|
|
|
|
+ Double samedayValue = 0.0;
|
|
|
|
+ Double monthFirstValue = 0.0;
|
|
|
|
+ Double yearFirstValue = 0.0;
|
|
|
|
+ Optional<PointData> currentfirst = edosUtil.getHistoryDatasSnap(ai064, currentDate.getTime() / 1000, currentDate.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
|
+ if (currentfirst.isPresent()){
|
|
|
|
+ currentValue = currentfirst.get().getPointValueInDouble();
|
|
|
|
+ }
|
|
|
|
+ Optional<PointData> samedayfirst = edosUtil.getHistoryDatasSnap(ai064, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
|
+ if (samedayfirst.isPresent()){
|
|
|
|
+ samedayValue = samedayfirst.get().getPointValueInDouble();
|
|
|
|
+ }
|
|
|
|
+ Optional<PointData> monthfirst = edosUtil.getHistoryDatasSnap(ai064, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
|
+ if (monthfirst.isPresent()){
|
|
|
|
+ monthFirstValue = monthfirst.get().getPointValueInDouble();
|
|
|
|
+ }
|
|
|
|
+ Optional<PointData> yearfirst = edosUtil.getHistoryDatasSnap(ai064, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
|
+ if (yearfirst.isPresent()){
|
|
|
|
+ yearFirstValue = yearfirst.get().getPointValueInDouble();
|
|
|
|
+ }
|
|
|
|
+ Double rfdl = currentValue - samedayValue;
|
|
|
|
+ Double yfdl = currentValue - monthFirstValue;
|
|
|
|
+ Double nfdl = currentValue - yearFirstValue;
|
|
|
|
+
|
|
|
|
+ PointData fdlpointData = createPointData(fjfdl, rfdl);
|
|
|
|
+ rfdlList.add(fdlpointData);
|
|
|
|
+
|
|
|
|
+ PointData yfdlpointData = createPointData(fjyfdl, yfdl);
|
|
|
|
+ yfdlList.add(yfdlpointData);
|
|
|
|
+
|
|
|
|
+ PointData nfdlpointData = createPointData(fjnfdl, nfdl);
|
|
|
|
+ yfdlList.add(nfdlpointData);
|
|
//算平均风速
|
|
//算平均风速
|
|
List<PointData> ssfsList = edosUtil.getHistStat(fjssfs, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
List<PointData> ssfsList = edosUtil.getHistStat(fjssfs, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
Optional<PointData> ssfsFirst = ssfsList.stream().findFirst();
|
|
Optional<PointData> ssfsFirst = ssfsList.stream().findFirst();
|
|
if (ssfsFirst.isPresent()){
|
|
if (ssfsFirst.isPresent()){
|
|
PointData pointData = ssfsFirst.get();
|
|
PointData pointData = ssfsFirst.get();
|
|
double inDouble = pointData.getPointValueInDouble();
|
|
double inDouble = pointData.getPointValueInDouble();
|
|
- pointData.setEdnaId(aveSpeedPoint.getCode());
|
|
|
|
- pointData.setPointName(aveSpeedPoint.getName());
|
|
|
|
- pointData.setPointValueInDouble(inDouble);
|
|
|
|
- pointData.setPointValue(String.valueOf(inDouble));
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
|
|
+ createWtPointData(aveSpeedPoint, pointData, inDouble);
|
|
wtavespeedList.add(pointData);
|
|
wtavespeedList.add(pointData);
|
|
}
|
|
}
|
|
|
|
+ //算月平均风速
|
|
|
|
+ List<PointData> yssfsList = edosUtil.getHistStat(fjssfs, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
|
|
+ Optional<PointData> yssfsFirst = yssfsList.stream().findFirst();
|
|
|
|
+ if (yssfsFirst.isPresent()){
|
|
|
|
+ PointData pointData = yssfsFirst.get();
|
|
|
|
+ double inDouble = pointData.getPointValueInDouble();
|
|
|
|
+ createWtPointData(monthAveSpeedPoint, pointData, inDouble);
|
|
|
|
+ ywtavespeedList.add(pointData);
|
|
|
|
+ }
|
|
|
|
+ //算年平均风速
|
|
|
|
+ List<PointData> nssfsList = edosUtil.getHistStat(fjssfs, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
|
|
+ Optional<PointData> nssfsFirst = nssfsList.stream().findFirst();
|
|
|
|
+ if (nssfsFirst.isPresent()){
|
|
|
|
+ PointData pointData = nssfsFirst.get();
|
|
|
|
+ double inDouble = pointData.getPointValueInDouble();
|
|
|
|
+ createWtPointData(yearAveSpeedPoint, pointData, inDouble);
|
|
|
|
+ nwtavespeedList.add(pointData);
|
|
|
|
+ }
|
|
//算平均功率
|
|
//算平均功率
|
|
List<PointData> ssglList = edosUtil.getHistStat(fjssgl, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
List<PointData> ssglList = edosUtil.getHistStat(fjssgl, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
Optional<PointData> ssglFirst = ssglList.stream().findFirst();
|
|
Optional<PointData> ssglFirst = ssglList.stream().findFirst();
|
|
if (ssglFirst.isPresent()){
|
|
if (ssglFirst.isPresent()){
|
|
PointData pointData = ssglFirst.get();
|
|
PointData pointData = ssglFirst.get();
|
|
double inDouble = pointData.getPointValueInDouble();
|
|
double inDouble = pointData.getPointValueInDouble();
|
|
- pointData.setEdnaId(avePowerPoint.getCode());
|
|
|
|
- pointData.setPointName(avePowerPoint.getName());
|
|
|
|
- pointData.setPointValueInDouble(inDouble);
|
|
|
|
- pointData.setPointValue(String.valueOf(inDouble));
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
|
|
+ createWtPointData(avePowerPoint, pointData, inDouble);
|
|
wtavepowerList.add(pointData);
|
|
wtavepowerList.add(pointData);
|
|
}
|
|
}
|
|
|
|
+ //算月平均功率
|
|
|
|
+ List<PointData> yssglList = edosUtil.getHistStat(fjssgl, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
|
|
+ Optional<PointData> yssglFirst = yssglList.stream().findFirst();
|
|
|
|
+ if (yssglFirst.isPresent()){
|
|
|
|
+ PointData pointData = yssglFirst.get();
|
|
|
|
+ double inDouble = pointData.getPointValueInDouble();
|
|
|
|
+ createWtPointData(yavePowerPoint, pointData, inDouble);
|
|
|
|
+ ywtavepowerList.add(pointData);
|
|
|
|
+ }
|
|
|
|
+ //算年平均功率
|
|
|
|
+ List<PointData> nssglList = edosUtil.getHistStat(fjssgl, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
|
|
|
|
+ Optional<PointData> nssglFirst = nssglList.stream().findFirst();
|
|
|
|
+ if (nssglFirst.isPresent()){
|
|
|
|
+ PointData pointData = nssglFirst.get();
|
|
|
|
+ double inDouble = pointData.getPointValueInDouble();
|
|
|
|
+ createWtPointData(navePowerPoint, pointData, inDouble);
|
|
|
|
+ nwtavepowerList.add(pointData);
|
|
|
|
+ }
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
resultList.addAll(wtavespeedList);
|
|
resultList.addAll(wtavespeedList);
|
|
|
|
+ resultList.addAll(ywtavespeedList);
|
|
|
|
+ resultList.addAll(nwtavespeedList);
|
|
resultList.addAll(wtavepowerList);
|
|
resultList.addAll(wtavepowerList);
|
|
|
|
+ resultList.addAll(ywtavepowerList);
|
|
|
|
+ resultList.addAll(nwtavepowerList);
|
|
|
|
+ resultList.addAll(rfdlList);
|
|
|
|
+ resultList.addAll(yfdlList);
|
|
|
|
+ resultList.addAll(nfdlList);
|
|
|
|
+ double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ double lineyfdl = yfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ double linenfdl = nfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
|
|
|
|
+ PointData yfdlpoint = createWpPointData(ylinefdlpointnew, lineyfdl);
|
|
|
|
+ PointData nfdlpoint = createWpPointData(nlinefdlpointnew, linenfdl);
|
|
|
|
+ linefdlList.add(fdlpoint);
|
|
|
|
+ ylinefdlList.add(yfdlpoint);
|
|
|
|
+ nlinefdlList.add(nfdlpoint);
|
|
|
|
+
|
|
OptionalDouble average = wtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
OptionalDouble average = wtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
if (average.isPresent()){
|
|
if (average.isPresent()){
|
|
double linespeed = average.getAsDouble();
|
|
double linespeed = average.getAsDouble();
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(linepointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(linepointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(linespeed));
|
|
|
|
- pointData.setPointValueInDouble(linespeed);
|
|
|
|
|
|
+ PointData pointData = createWpPointData(linepointnew, linespeed);
|
|
lineavespeedList.add(pointData);
|
|
lineavespeedList.add(pointData);
|
|
}
|
|
}
|
|
- OptionalDouble poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
- if (poweraverage.isPresent()){
|
|
|
|
- double linepower = poweraverage.getAsDouble();
|
|
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(linepowerpointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(linepowerpointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(linepower));
|
|
|
|
- pointData.setPointValueInDouble(linepower);
|
|
|
|
- lineavepowerList.add(pointData);
|
|
|
|
|
|
+ OptionalDouble yaverage = ywtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+ if (yaverage.isPresent()){
|
|
|
|
+ double linespeed = yaverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(ylinepointnew, linespeed);
|
|
|
|
+ ylineavespeedList.add(pointData);
|
|
|
|
+ }
|
|
|
|
+ OptionalDouble naverage = nwtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+ if (naverage.isPresent()){
|
|
|
|
+ double linespeed = naverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(nlinepointnew, linespeed);
|
|
|
|
+ nlineavespeedList.add(pointData);
|
|
}
|
|
}
|
|
|
|
+ Double poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData powerpointData = createWpPointData(linepowerpointnew, poweraverage);
|
|
|
|
+ lineavepowerList.add(powerpointData);
|
|
|
|
+
|
|
|
|
+ Double ypoweraverage = ywtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData ypowerpointData = createWpPointData(ylinepowerpointnew, ypoweraverage);
|
|
|
|
+ ylineavepowerList.add(ypowerpointData);
|
|
|
|
+
|
|
|
|
+ Double npoweraverage = nwtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData npowerpointData = createWpPointData(nlinepowerpointnew, npoweraverage);
|
|
|
|
+ nlineavepowerList.add(npowerpointData);
|
|
});
|
|
});
|
|
OptionalDouble average = lineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
OptionalDouble average = lineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
- OptionalDouble poweraverage = lineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
|
|
+ OptionalDouble yaverage = ylineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+ OptionalDouble naverage = nlineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+
|
|
|
|
+ Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ Double proyfdl = ylinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ Double pronfdl = nlinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
resultList.addAll(lineavespeedList);
|
|
resultList.addAll(lineavespeedList);
|
|
|
|
+ resultList.addAll(ylineavespeedList);
|
|
|
|
+ resultList.addAll(nlineavespeedList);
|
|
resultList.addAll(lineavepowerList);
|
|
resultList.addAll(lineavepowerList);
|
|
|
|
+ resultList.addAll(ylineavepowerList);
|
|
|
|
+ resultList.addAll(nlineavepowerList);
|
|
|
|
+ resultList.addAll(linefdlList);
|
|
|
|
+ resultList.addAll(ylinefdlList);
|
|
|
|
+ resultList.addAll(nlinefdlList);
|
|
|
|
+
|
|
|
|
+ PointData rfdlpointData = createWpPointData(fdlprojectpointnew, prorfdl);
|
|
|
|
+ PointData yfdlpointData = createWpPointData(yfdlprojectpointnew, proyfdl);
|
|
|
|
+ PointData nfdlpointData = createWpPointData(nfdlprojectpointnew, pronfdl);
|
|
|
|
+ projectfdlList.add(rfdlpointData);
|
|
|
|
+ projectyfdlList.add(yfdlpointData);
|
|
|
|
+ projectnfdlList.add(nfdlpointData);
|
|
if (average.isPresent()){
|
|
if (average.isPresent()){
|
|
double projectspeed = average.getAsDouble();
|
|
double projectspeed = average.getAsDouble();
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(projectpointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(projectpointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(projectspeed));
|
|
|
|
- pointData.setPointValueInDouble(projectspeed);
|
|
|
|
|
|
+ PointData pointData = createWpPointData(projectpointnew, projectspeed);
|
|
projectavespeedList.add(pointData);
|
|
projectavespeedList.add(pointData);
|
|
}
|
|
}
|
|
- if (poweraverage.isPresent()){
|
|
|
|
- double projectpower = poweraverage.getAsDouble();
|
|
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(powerprojectpointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(powerprojectpointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(projectpower));
|
|
|
|
- pointData.setPointValueInDouble(projectpower);
|
|
|
|
- projectavepowerList.add(pointData);
|
|
|
|
|
|
+ if (yaverage.isPresent()){
|
|
|
|
+ double projectspeed = yaverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(yprojectpointnew, projectspeed);
|
|
|
|
+ yprojectavespeedList.add(pointData);
|
|
|
|
+ }
|
|
|
|
+ if (naverage.isPresent()){
|
|
|
|
+ double projectspeed = naverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(nprojectpointnew, projectspeed);
|
|
|
|
+ nprojectavespeedList.add(pointData);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Double poweraverage = lineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ Double ypoweraverage = ylineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ Double npoweraverage = nlineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData powerpointData = createWpPointData(powerprojectpointnew, poweraverage);
|
|
|
|
+ projectavepowerList.add(powerpointData);
|
|
|
|
+ PointData ypowerpointData = createWpPointData(ypowerprojectpointnew, ypoweraverage);
|
|
|
|
+ yprojectavepowerList.add(ypowerpointData);
|
|
|
|
+ PointData npowerpointData = createWpPointData(npowerprojectpointnew, npoweraverage);
|
|
|
|
+ nprojectavepowerList.add(npowerpointData);
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ resultList.addAll(projectfdlList);
|
|
|
|
+ resultList.addAll(projectyfdlList);
|
|
|
|
+ resultList.addAll(projectnfdlList);
|
|
|
|
+ double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
|
|
|
|
+ resultList.add(fdlpointData);
|
|
|
|
+
|
|
|
|
+ double fcyfdl = projectyfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData yfdlpointData = createWpPointData(yfdlwppointnew, fcyfdl);
|
|
|
|
+ resultList.add(yfdlpointData);
|
|
|
|
+
|
|
|
|
+ double fcnfdl = projectnfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ PointData nfdlpointData = createWpPointData(nfdlwppointnew, fcnfdl);
|
|
|
|
+ resultList.add(nfdlpointData);
|
|
|
|
+
|
|
OptionalDouble average = projectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
OptionalDouble average = projectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
resultList.addAll(projectavespeedList);
|
|
resultList.addAll(projectavespeedList);
|
|
if (average.isPresent()){
|
|
if (average.isPresent()){
|
|
double wpspeed = average.getAsDouble();
|
|
double wpspeed = average.getAsDouble();
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(wppointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(wppointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(wpspeed));
|
|
|
|
- pointData.setPointValueInDouble(wpspeed);
|
|
|
|
|
|
+ PointData pointData = createWpPointData(wppointnew, wpspeed);
|
|
resultList.add(pointData);
|
|
resultList.add(pointData);
|
|
}
|
|
}
|
|
- OptionalDouble poweraverage = projectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
- resultList.addAll(projectavepowerList);
|
|
|
|
- if (poweraverage.isPresent()){
|
|
|
|
- double wppwer = poweraverage.getAsDouble();
|
|
|
|
- PointData pointData = new PointData();
|
|
|
|
- pointData.setEdnaId(powerwppointnew.getCode());
|
|
|
|
- pointData.setPointTime(currentDate.getTime());
|
|
|
|
- pointData.setPointName(powerwppointnew.getName());
|
|
|
|
- pointData.setPointValue(String.valueOf(wppwer));
|
|
|
|
- pointData.setPointValueInDouble(wppwer);
|
|
|
|
|
|
+ OptionalDouble yaverage = yprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+ resultList.addAll(yprojectavespeedList);
|
|
|
|
+ if (yaverage.isPresent()){
|
|
|
|
+ double wpspeed = yaverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(ywppointnew, wpspeed);
|
|
resultList.add(pointData);
|
|
resultList.add(pointData);
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ OptionalDouble naverage = nprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
|
|
|
|
+ resultList.addAll(nprojectavespeedList);
|
|
|
|
+ if (naverage.isPresent()){
|
|
|
|
+ double wpspeed = naverage.getAsDouble();
|
|
|
|
+ PointData pointData = createWpPointData(nwppointnew, wpspeed);
|
|
|
|
+ resultList.add(pointData);
|
|
|
|
+ }
|
|
|
|
+ Double poweraverage = projectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ resultList.addAll(projectavepowerList);
|
|
|
|
+ PointData powerpointData = createWpPointData(powerwppointnew, poweraverage);
|
|
|
|
+ resultList.add(powerpointData);
|
|
|
|
+
|
|
|
|
+ Double ypoweraverage = yprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ resultList.addAll(yprojectavepowerList);
|
|
|
|
+ PointData ypowerpointData = createWpPointData(ypowerwppointnew, ypoweraverage);
|
|
|
|
+ resultList.add(ypowerpointData);
|
|
|
|
|
|
|
|
+ Double npoweraverage = nprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
|
+ resultList.addAll(nprojectavepowerList);
|
|
|
|
+ PointData npowerpointData = createWpPointData(npowerwppointnew, npoweraverage);
|
|
|
|
+ resultList.add(npowerpointData);
|
|
|
|
+ });
|
|
edosUtil.sendMultiPoint(resultList);
|
|
edosUtil.sendMultiPoint(resultList);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private PointData createPointData(Windturbinetestingpointnew fjfdl, Double rfdl) {
|
|
|
|
+ PointData pointData = new PointData();
|
|
|
|
+ pointData.setEdnaId(fjfdl.getCode());
|
|
|
|
+ pointData.setPointName(fjfdl.getName());
|
|
|
|
+ pointData.setPointTime(currentDate.getTime());
|
|
|
|
+ pointData.setPointValueInDouble(rfdl);
|
|
|
|
+ pointData.setPointValue(String.valueOf(rfdl));
|
|
|
|
+ return pointData;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
|
|
|
|
+ PointData pointData = new PointData();
|
|
|
|
+ pointData.setEdnaId(linepointnew.getCode());
|
|
|
|
+ pointData.setPointTime(currentDate.getTime());
|
|
|
|
+ pointData.setPointName(linepointnew.getName());
|
|
|
|
+ pointData.setPointValue(String.valueOf(linespeed));
|
|
|
|
+ pointData.setPointValueInDouble(linespeed);
|
|
|
|
+ return pointData;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void createWtPointData(Windturbinetestingpointnew aveSpeedPoint, PointData pointData, double inDouble) {
|
|
|
|
+ pointData.setEdnaId(aveSpeedPoint.getCode());
|
|
|
|
+ pointData.setPointName(aveSpeedPoint.getName());
|
|
|
|
+ pointData.setPointValueInDouble(inDouble);
|
|
|
|
+ pointData.setPointValue(String.valueOf(inDouble));
|
|
|
|
+ pointData.setPointTime(currentDate.getTime());
|
|
|
|
+ }
|
|
}
|
|
}
|