|
@@ -98,13 +98,13 @@ public class PowerCurveFittingService {
|
|
|
int month3 = c.get(Calendar.MONTH) + 1;
|
|
|
|
|
|
|
|
|
- Map<String, CureFittingVo> windMap = new HashMap<String, CureFittingVo>();
|
|
|
+ Map<String, CureFittingVo> windMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
//初始化风机装机容量
|
|
|
|
|
|
if (windturbineCapacity == null) {
|
|
|
- windturbineCapacity = new HashMap<String, Double>();
|
|
|
+ windturbineCapacity = new HashMap<>();
|
|
|
Map<String, ProEconEquipmentmodel> modelMap = CacheContext.modelMap;
|
|
|
for (ProBasicEquipment windturbine : wtls) {
|
|
|
if (modelMap.containsKey(windturbine.getModelId())) {
|
|
@@ -124,7 +124,7 @@ public class PowerCurveFittingService {
|
|
|
//设备明细状态
|
|
|
String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
|
|
|
|
|
|
- String pointIdFS = "";
|
|
|
+ String pointIdFS;
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) { //测风塔70米风速
|
|
|
|
|
|
if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
|
|
@@ -164,10 +164,10 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
for (String key : windMap.keySet()) {
|
|
|
//初始化集合
|
|
|
- windMap.get(key).setYsjglPoints(new ArrayList<PointVo>());
|
|
|
- windMap.get(key).setYzyglPoints(new ArrayList<PointVo>());
|
|
|
- windMap.get(key).setRsjglPoints(new ArrayList<PointVo>());
|
|
|
- windMap.get(key).setRzyglPoints(new ArrayList<PointVo>());
|
|
|
+ windMap.get(key).setYsjglPoints(new ArrayList<>());
|
|
|
+ windMap.get(key).setYzyglPoints(new ArrayList<>());
|
|
|
+ windMap.get(key).setRsjglPoints(new ArrayList<>());
|
|
|
+ windMap.get(key).setRzyglPoints(new ArrayList<>());
|
|
|
|
|
|
|
|
|
if (windMap.get(key).getPointIdGL() == null || windMap.get(key).getPointIdFS() == null || windMap.get(key).getPointIdZT() == null) {
|
|
@@ -177,11 +177,23 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
//拟合月功率曲线
|
|
|
curveFittingBuilder(begin1, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), key);
|
|
|
+
|
|
|
+ List<PointVo> vos= windMap.get(key).getYsjglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setYsjglPoints(vos);
|
|
|
+ vos=windMap.get(key).getYzyglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setYzyglPoints(vos);
|
|
|
//拟合日功率曲线
|
|
|
curveFittingBuilder(begin2, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getRsjglPoints(), windMap.get(key).getRzyglPoints(), key);
|
|
|
+ vos= windMap.get(key).getRsjglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setRsjglPoints(vos);
|
|
|
+ vos=windMap.get(key).getRzyglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setRzyglPoints(vos);
|
|
|
//拟合年功率曲线
|
|
|
curveFittingBuilder(begin3, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), key);
|
|
|
-
|
|
|
+ vos= windMap.get(key).getNsjglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setNsjglPoints(vos);
|
|
|
+ vos=windMap.get(key).getNzyglPoints().stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
+ windMap.get(key).setNzyglPoints(vos);
|
|
|
}
|
|
|
|
|
|
for (String key : windMap.keySet()) {
|
|
@@ -192,30 +204,30 @@ public class PowerCurveFittingService {
|
|
|
}
|
|
|
|
|
|
// //年的上月
|
|
|
- List<PointVo> yearLastMonthPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> yearLastMonthPoints = new ArrayList<>();
|
|
|
// //年的去年同期
|
|
|
- List<PointVo> yearLastYearPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> yearLastYearPoints;
|
|
|
// //年标准功率
|
|
|
- List<PointVo> yearStandardPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> yearStandardPoints = new ArrayList<>();
|
|
|
|
|
|
|
|
|
//月的上月
|
|
|
- List<PointVo> monthLastMonthPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> monthLastMonthPoints = new ArrayList<>();
|
|
|
//月的去年同期
|
|
|
- List<PointVo> monthLastYearPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> monthLastYearPoints = new ArrayList<>();
|
|
|
//月标准功率
|
|
|
- List<PointVo> monthStandardPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> monthStandardPoints = new ArrayList<>();
|
|
|
|
|
|
|
|
|
//日的昨天
|
|
|
- List<PointVo> dayLastMonthPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> dayLastMonthPoints = new ArrayList<>();
|
|
|
//日的去年同期
|
|
|
- List<PointVo> dayLastYearPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> dayLastYearPoints = new ArrayList<>();
|
|
|
//日标准功率
|
|
|
- List<PointVo> dayStandardPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> dayStandardPoints = new ArrayList<>();
|
|
|
|
|
|
//保证功率
|
|
|
- List<PointVo> bzglpowerPoints = new ArrayList<PointVo>();
|
|
|
+ List<PointVo> bzglpowerPoints = new ArrayList<>();
|
|
|
|
|
|
|
|
|
if (CacheContext.wtstandardmap.containsKey(key)) {
|
|
@@ -237,7 +249,7 @@ public class PowerCurveFittingService {
|
|
|
String stringyear3 = String.valueOf(year3);
|
|
|
String stringmonth3 = String.valueOf(month3);
|
|
|
|
|
|
- /*********************************************年曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+ // /*********************************************年曲线偏差上个月和上一年记录**********************************************************/
|
|
|
|
|
|
|
|
|
List<ProEconWtCurveFittingYear> wcfyls = proEconWtCurveFittingYearService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
@@ -247,22 +259,21 @@ public class PowerCurveFittingService {
|
|
|
yearBuildPoints(wcfyls, yearLastMonthPoints);
|
|
|
yearLastYearPoints = yearLastMonthPoints;
|
|
|
|
|
|
-/*********************************************年曲线偏差上个月和上一年记录**********************************************************/
|
|
|
-/*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+//*********************************************年曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+//*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
|
|
|
|
List<ProEconWtCurveFittingMonth> wcfmls = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
i.getYear().equals(stringyear2) && i.getMonth().equals(stringmonth2)).sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
monthBuildPoints(wcfmls, monthLastMonthPoints);
|
|
|
|
|
|
- wcfmls = null;
|
|
|
wcfmls = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3)).collect(Collectors.toList());
|
|
|
wcfmls.sort(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed));
|
|
|
|
|
|
monthBuildPoints(wcfmls, monthLastYearPoints);
|
|
|
-/*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
|
-/*********************************************日曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+//*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+//*********************************************日曲线偏差上个月和上一年记录**********************************************************/
|
|
|
Date d1 = DateUtils.addDays(current, -1);
|
|
|
Date d2 = DateUtils.addYears(current, -1);
|
|
|
|
|
@@ -272,13 +283,13 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
dayBuildPoints(wcfls, dayLastMonthPoints);
|
|
|
|
|
|
- wcfls = null;
|
|
|
+
|
|
|
wcfls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
i.getRecordDate().compareTo(d2) == 0).collect(Collectors.toList());
|
|
|
|
|
|
//与轶总的原始代码对比不一致,临时修改测试
|
|
|
dayBuildPoints(wcfls, dayLastMonthPoints);
|
|
|
-/*********************************************日曲线偏差上个月和上一年记录**********************************************************/
|
|
|
+//*********************************************日曲线偏差上个月和上一年记录**********************************************************/
|
|
|
if (CacheContext.wtmap.containsKey(key)) {
|
|
|
String modelid = CacheContext.wtmap.get(key).getModelId();
|
|
|
if (StringUtils.notEmp(modelid)) {
|
|
@@ -294,12 +305,12 @@ public class PowerCurveFittingService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-/*********************************************年曲线偏差记录**********************************************************/
|
|
|
+//*********************************************年曲线偏差记录**********************************************************/
|
|
|
|
|
|
-/*********************************************当年曲线偏差记录**********************************************************/
|
|
|
+//*********************************************当年曲线偏差记录**********************************************************/
|
|
|
Optional<ProEconCurveFittYearMain> cfmyearo = proEconCurveFittYearMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getYear().equals(stringyear)).findFirst();
|
|
|
- ProEconCurveFittYearMain cfmyear = null;
|
|
|
+ ProEconCurveFittYearMain cfmyear;
|
|
|
if (cfmyearo.isPresent()) {
|
|
|
cfmyear = cfmyearo.get();
|
|
|
|
|
@@ -315,26 +326,26 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
|
|
|
//年---实际/最优
|
|
|
- cfmyear.setDeviationRate1((Double) pcl(windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), modelpower));
|
|
|
+ cfmyear.setDeviationRate1(pcl(windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), modelpower));
|
|
|
//年---实际/保证
|
|
|
- cfmyear.setDeviationRate2((Double) pcl(windMap.get(key).getNsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmyear.setDeviationRate2( pcl(windMap.get(key).getNsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
//年---最优/保证
|
|
|
- cfmyear.setDeviationRate3((Double) pcl(windMap.get(key).getNzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmyear.setDeviationRate3( pcl(windMap.get(key).getNzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
//年---实际/上月实际
|
|
|
- cfmyear.setMonthDeviationRate((Double) pcl(windMap.get(key).getNsjglPoints(), yearLastMonthPoints, modelpower));
|
|
|
+ cfmyear.setMonthDeviationRate( pcl(windMap.get(key).getNsjglPoints(), yearLastMonthPoints, modelpower));
|
|
|
//年---实际/同期实际
|
|
|
- cfmyear.setYearDeviationRate((Double) pcl(windMap.get(key).getNsjglPoints(), yearLastYearPoints, modelpower));
|
|
|
+ cfmyear.setYearDeviationRate( pcl(windMap.get(key).getNsjglPoints(), yearLastYearPoints, modelpower));
|
|
|
//年---实际/标杆实际
|
|
|
- cfmyear.setStandardDeviationRate((Double) pcl(windMap.get(key).getNsjglPoints(), yearStandardPoints, modelpower));
|
|
|
+ cfmyear.setStandardDeviationRate( pcl(windMap.get(key).getNsjglPoints(), yearStandardPoints, modelpower));
|
|
|
|
|
|
|
|
|
proEconCurveFittYearMainService.save(cfmyear);
|
|
|
|
|
|
-/*********************************************当年曲线偏差记录**********************************************************/
|
|
|
-/*********************************************当月曲线偏差记录**********************************************************/
|
|
|
+//*********************************************当年曲线偏差记录**********************************************************/
|
|
|
+//*********************************************当月曲线偏差记录**********************************************************/
|
|
|
Optional<ProEconCurveFittMonthMain> cfmmontho = proEconCurveFittMonthMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth)).findFirst();
|
|
|
- ProEconCurveFittMonthMain cfmmonth = null;
|
|
|
+ ProEconCurveFittMonthMain cfmmonth;
|
|
|
if (cfmmontho.isPresent()) {
|
|
|
cfmmonth = cfmmontho.get();
|
|
|
|
|
@@ -350,26 +361,26 @@ public class PowerCurveFittingService {
|
|
|
cfmmonth.setMonth(String.valueOf(month));
|
|
|
|
|
|
//月---实际/最优
|
|
|
- cfmmonth.setDeviationRate1((Double) pcl(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower));
|
|
|
+ cfmmonth.setDeviationRate1( pcl(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower));
|
|
|
//月---实际/保证
|
|
|
- cfmmonth.setDeviationRate2((Double) pcl(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmmonth.setDeviationRate2( pcl(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
//月---最优/保证
|
|
|
- cfmmonth.setDeviationRate3((Double) pcl(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmmonth.setDeviationRate3( pcl(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
//月---实际/上月实际
|
|
|
- cfmmonth.setMonthDeviationRate((Double) pcl(windMap.get(key).getYsjglPoints(), monthLastMonthPoints, modelpower));
|
|
|
+ cfmmonth.setMonthDeviationRate( pcl(windMap.get(key).getYsjglPoints(), monthLastMonthPoints, modelpower));
|
|
|
//月---实际/同期实际
|
|
|
- cfmmonth.setYearDeviationRate((Double) pcl(windMap.get(key).getYsjglPoints(), monthLastYearPoints, modelpower));
|
|
|
+ cfmmonth.setYearDeviationRate( pcl(windMap.get(key).getYsjglPoints(), monthLastYearPoints, modelpower));
|
|
|
//月---实际/标杆实际
|
|
|
- cfmmonth.setStandardDeviationRate((Double) pcl(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower));
|
|
|
+ cfmmonth.setStandardDeviationRate( pcl(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower));
|
|
|
|
|
|
|
|
|
proEconCurveFittMonthMainService.save(cfmmonth);
|
|
|
|
|
|
- /*********************************************当月曲线偏差记录**********************************************************/
|
|
|
- /*********************************************当日曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当月曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当日曲线偏差记录**********************************************************/
|
|
|
Optional<ProEconCurveFittingMain> cfmdayo = proEconCurveFittingMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getRecordDate().compareTo(current) == 0).findFirst();
|
|
|
- ProEconCurveFittingMain cfmday = null;
|
|
|
+ ProEconCurveFittingMain cfmday ;
|
|
|
|
|
|
if (cfmdayo.isPresent()) {
|
|
|
cfmday = cfmdayo.get();
|
|
@@ -384,21 +395,21 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
|
|
|
//日---实际/最优
|
|
|
- cfmday.setDeviationRate1((Double) pcl(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower));
|
|
|
+ cfmday.setDeviationRate1( pcl(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower));
|
|
|
//日---实际/保证
|
|
|
- cfmday.setDeviationRate2((Double) pcl(windMap.get(key).getRsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmday.setDeviationRate2( pcl(windMap.get(key).getRsjglPoints(), bzglpowerPoints, modelpower));
|
|
|
//日---最优/保证
|
|
|
- cfmday.setDeviationRate3((Double) pcl(windMap.get(key).getRzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
+ cfmday.setDeviationRate3( pcl(windMap.get(key).getRzyglPoints(), bzglpowerPoints, modelpower));
|
|
|
//日---实际/上日实际
|
|
|
- cfmday.setMonthDeviationRate((Double) pcl(windMap.get(key).getRsjglPoints(), dayLastMonthPoints, modelpower));
|
|
|
+ cfmday.setMonthDeviationRate( pcl(windMap.get(key).getRsjglPoints(), dayLastMonthPoints, modelpower));
|
|
|
//日---实际/同期实际
|
|
|
- cfmday.setYearDeviationRate((Double) pcl(windMap.get(key).getRsjglPoints(), dayLastYearPoints, modelpower));
|
|
|
+ cfmday.setYearDeviationRate( pcl(windMap.get(key).getRsjglPoints(), dayLastYearPoints, modelpower));
|
|
|
//日---实际/标杆实际
|
|
|
- cfmday.setStandardDeviationRate((Double) pcl(windMap.get(key).getRsjglPoints(), dayStandardPoints, modelpower));
|
|
|
+ cfmday.setStandardDeviationRate( pcl(windMap.get(key).getRsjglPoints(), dayStandardPoints, modelpower));
|
|
|
|
|
|
|
|
|
proEconCurveFittingMainService.save(cfmday);
|
|
|
- /*********************************************当日曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当日曲线偏差记录**********************************************************/
|
|
|
pLCBuild(key, stringyear, stringmonth, current, windMap, modelpower, 3, bzglpowerPoints, monthLastMonthPoints, monthLastYearPoints, monthStandardPoints, dayLastMonthPoints, dayLastYearPoints, dayStandardPoints, yearLastMonthPoints, yearLastYearPoints, yearStandardPoints);
|
|
|
pLCBuild(key, stringyear, stringmonth, current, windMap, modelpower, 4, bzglpowerPoints, monthLastMonthPoints, monthLastYearPoints, monthStandardPoints, dayLastMonthPoints, dayLastYearPoints, dayStandardPoints, yearLastMonthPoints, yearLastYearPoints, yearStandardPoints);
|
|
|
pLCBuild(key, stringyear, stringmonth, current, windMap, modelpower, 5, bzglpowerPoints, monthLastMonthPoints, monthLastYearPoints, monthStandardPoints, dayLastMonthPoints, dayLastYearPoints, dayStandardPoints, yearLastMonthPoints, yearLastYearPoints, yearStandardPoints);
|
|
@@ -434,11 +445,11 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
String speedStr = String.valueOf(speed);
|
|
|
|
|
|
- /*********************************************当年曲线偏差子表记录**********************************************************/
|
|
|
+ //*********************************************当年曲线偏差子表记录**********************************************************/
|
|
|
|
|
|
Optional<ProEconCurveFittYearSub> cfmsyearo = proEconCurveFittYearSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getYear().equals(stringyear) && i.getSpeed().equals(speedStr)).findFirst();
|
|
|
- ProEconCurveFittYearSub cfmsyear = null;
|
|
|
+ ProEconCurveFittYearSub cfmsyear;
|
|
|
|
|
|
if (cfmsyearo.isPresent()) {
|
|
|
cfmsyear = cfmsyearo.get();
|
|
@@ -456,25 +467,25 @@ public class PowerCurveFittingService {
|
|
|
proEconCurveFittYearSubService.save(cfmsyear);
|
|
|
|
|
|
//年---实际/最优
|
|
|
- cfmsyear.setDeviationRate1((Double) pcl2(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate1( pcl2(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower, speed));
|
|
|
//年---实际/保证
|
|
|
- cfmsyear.setDeviationRate2((Double) pcl2(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate2( pcl2(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//年---最优/保证
|
|
|
- cfmsyear.setDeviationRate3((Double) pcl2(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate3( pcl2(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//年---实际/上月实际
|
|
|
- cfmsyear.setMonthDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthLastMonthPoints, modelpower, speed));
|
|
|
+ cfmsyear.setMonthDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), yearLastMonthPoints, modelpower, speed));
|
|
|
//年---实际/同期实际
|
|
|
- cfmsyear.setYearDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthLastYearPoints, modelpower, speed));
|
|
|
+ cfmsyear.setYearDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), yearLastYearPoints, modelpower, speed));
|
|
|
//年---实际/标杆实际
|
|
|
- cfmsyear.setStandardDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower, speed));
|
|
|
+ cfmsyear.setStandardDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), yearStandardPoints, modelpower, speed));
|
|
|
|
|
|
proEconCurveFittYearSubService.save(cfmsyear);
|
|
|
-/*********************************************当年曲线偏差子表记录**********************************************************/
|
|
|
-/*********************************************当月曲线偏差子表记录**********************************************************/
|
|
|
+//*********************************************当年曲线偏差子表记录**********************************************************/
|
|
|
+//*********************************************当月曲线偏差子表记录**********************************************************/
|
|
|
|
|
|
Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth) && i.getSpeed().equals(speedStr)).findFirst();
|
|
|
- ProEconCurveFittMonthSub cfmsmonth = null;
|
|
|
+ ProEconCurveFittMonthSub cfmsmonth ;
|
|
|
|
|
|
if (cfmsmontho.isPresent()) {
|
|
|
cfmsmonth = cfmsmontho.get();
|
|
@@ -493,24 +504,24 @@ public class PowerCurveFittingService {
|
|
|
proEconCurveFittMonthSubService.save(cfmsmonth);
|
|
|
|
|
|
//月---实际/最优
|
|
|
- cfmsmonth.setDeviationRate1((Double) pcl2(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower, speed));
|
|
|
+ cfmsmonth.setDeviationRate1( pcl2(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower, speed));
|
|
|
//月---实际/保证
|
|
|
- cfmsmonth.setDeviationRate2((Double) pcl2(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsmonth.setDeviationRate2( pcl2(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//月---最优/保证
|
|
|
- cfmsmonth.setDeviationRate3((Double) pcl2(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsmonth.setDeviationRate3( pcl2(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//月---实际/上月实际
|
|
|
- cfmsmonth.setMonthDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthLastMonthPoints, modelpower, speed));
|
|
|
+ cfmsmonth.setMonthDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), monthLastMonthPoints, modelpower, speed));
|
|
|
//月---实际/同期实际
|
|
|
- cfmsmonth.setYearDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthLastYearPoints, modelpower, speed));
|
|
|
+ cfmsmonth.setYearDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), monthLastYearPoints, modelpower, speed));
|
|
|
//月---实际/标杆实际
|
|
|
- cfmsmonth.setStandardDeviationRate((Double) pcl2(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower, speed));
|
|
|
+ cfmsmonth.setStandardDeviationRate( pcl2(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower, speed));
|
|
|
|
|
|
proEconCurveFittMonthSubService.save(cfmsmonth);
|
|
|
-/*********************************************当月曲线偏差子表记录**********************************************************/
|
|
|
-/*********************************************当日曲线偏差子表记录**********************************************************/
|
|
|
+//*********************************************当月曲线偏差子表记录**********************************************************/
|
|
|
+//*********************************************当日曲线偏差子表记录**********************************************************/
|
|
|
Optional<ProEconCurveFittingSub> cfmso = proEconCurveFittingSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
&& i.getRecordDate().compareTo(current) == 0 && i.getSpeed().equals(speedStr)).findFirst();
|
|
|
- ProEconCurveFittingSub cfms = null;
|
|
|
+ ProEconCurveFittingSub cfms ;
|
|
|
|
|
|
if (cfmso.isPresent()) {
|
|
|
cfms = cfmso.get();
|
|
@@ -526,27 +537,27 @@ public class PowerCurveFittingService {
|
|
|
cfms.setRecordDate(current);
|
|
|
|
|
|
|
|
|
- cfms.setDeviationRate1((Double) pcl2(windMap.get(key).getRsjglPoints(), windMap.get(key).getRzyglPoints(), modelpower, speed));
|
|
|
+ cfms.setDeviationRate1( pcl2(windMap.get(key).getRsjglPoints(), windMap.get(key).getRzyglPoints(), modelpower, speed));
|
|
|
//日---实际/保证
|
|
|
- cfms.setDeviationRate2((Double) pcl2(windMap.get(key).getRsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfms.setDeviationRate2( pcl2(windMap.get(key).getRsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//日---最优/保证
|
|
|
- cfms.setDeviationRate3((Double) pcl2(windMap.get(key).getRzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfms.setDeviationRate3( pcl2(windMap.get(key).getRzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//日---实际/上日实际
|
|
|
- cfms.setMonthDeviationRate((Double) pcl2(windMap.get(key).getRsjglPoints(), dayLastMonthPoints, modelpower, speed));
|
|
|
+ cfms.setMonthDeviationRate( pcl2(windMap.get(key).getRsjglPoints(), dayLastMonthPoints, modelpower, speed));
|
|
|
//日---实际/同期实际
|
|
|
- cfms.setYearDeviationRate((Double) pcl2(windMap.get(key).getRsjglPoints(), dayLastYearPoints, modelpower, speed));
|
|
|
+ cfms.setYearDeviationRate( pcl2(windMap.get(key).getRsjglPoints(), dayLastYearPoints, modelpower, speed));
|
|
|
//日---实际/标杆实际
|
|
|
- cfms.setStandardDeviationRate((Double) pcl2(windMap.get(key).getRsjglPoints(), dayStandardPoints, modelpower, speed));
|
|
|
+ cfms.setStandardDeviationRate( pcl2(windMap.get(key).getRsjglPoints(), dayStandardPoints, modelpower, speed));
|
|
|
|
|
|
proEconCurveFittingSubService.save(cfms);
|
|
|
-/*********************************************当日曲线偏差子表记录**********************************************************/
|
|
|
+//*********************************************当日曲线偏差子表记录**********************************************************/
|
|
|
}
|
|
|
|
|
|
|
|
|
private void insertPoints(Date current, String year, String month, List<PointVo> monthSjglls, List<PointVo> monthZyglls, List<PointVo> daySjglls, List<PointVo> dayZyglls, List<PointVo> yearSjglls, List<PointVo> yearZyglls, String windturbineId) {
|
|
|
- /*********************************************当年曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当年曲线偏差记录**********************************************************/
|
|
|
List<Integer> wtcfmyearidls = proEconWtCurveFittingYearService.list().stream().filter(i -> i.getWindturbineId().equals(windturbineId) &&
|
|
|
- i.getYear().equals(year)).map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ i.getYear().equals(year)).map(ProEconWtCurveFittingYear::getId).collect(Collectors.toList());
|
|
|
|
|
|
for (int i = 0; i < wtcfmyearidls.size(); i++) {
|
|
|
proEconWtCurveFittingYearService.removeByIds(wtcfmyearidls);
|
|
@@ -561,7 +572,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- // item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ // item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
item.setSpeed(yearSjglls.get(i).getX());
|
|
|
|
|
@@ -586,7 +597,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- //item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ //item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
|
|
|
item.setSpeed(yearSjglls.get(i).getX());
|
|
@@ -594,7 +605,7 @@ public class PowerCurveFittingService {
|
|
|
item.setActualPower(yearSjglls.get(i).getY());
|
|
|
|
|
|
int finalI = i;
|
|
|
- OptionalDouble op = yearZyglls.stream().filter(x -> x.getX() == yearSjglls.get(finalI).getX()).mapToDouble(x -> x.getY()).findFirst();
|
|
|
+ OptionalDouble op = yearZyglls.stream().filter(x -> Objects.equals(x.getX(), yearSjglls.get(finalI).getX())).mapToDouble(PointVo::getY).findFirst();
|
|
|
|
|
|
if (op.isPresent()) {
|
|
|
item.setOptimalPower(op.getAsDouble());
|
|
@@ -609,10 +620,10 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- /*********************************************当年曲线偏差记录**********************************************************/
|
|
|
- /*********************************************当月曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当年曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当月曲线偏差记录**********************************************************/
|
|
|
List<Integer> wtcfmmonthidls = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(windturbineId) &&
|
|
|
- i.getYear().equals(year) && i.getMonth().equals(month)).map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ i.getYear().equals(year) && i.getMonth().equals(month)).map(ProEconWtCurveFittingMonth::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
for (int i = 0; i < wtcfmmonthidls.size(); i++) {
|
|
@@ -628,7 +639,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- // item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ // item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
item.setSpeed(monthSjglls.get(i).getX());
|
|
|
|
|
@@ -654,7 +665,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- //item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ //item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
|
|
|
item.setSpeed(monthSjglls.get(i).getX());
|
|
@@ -662,7 +673,7 @@ public class PowerCurveFittingService {
|
|
|
item.setActualPower(monthSjglls.get(i).getY());
|
|
|
|
|
|
int finalI = i;
|
|
|
- OptionalDouble op = monthZyglls.stream().filter(x -> x.getX() == monthSjglls.get(finalI).getX()).mapToDouble(x -> x.getY()).findFirst();
|
|
|
+ OptionalDouble op = monthZyglls.stream().filter(x -> Objects.equals(x.getX(), monthSjglls.get(finalI).getX())).mapToDouble(PointVo::getY).findFirst();
|
|
|
|
|
|
if (op.isPresent()) {
|
|
|
item.setOptimalPower(op.getAsDouble());
|
|
@@ -678,8 +689,8 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- /*********************************************当月曲线偏差记录**********************************************************/
|
|
|
- /*********************************************当日曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当月曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当日曲线偏差记录**********************************************************/
|
|
|
List<Integer> wtcfidls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(windturbineId) &&
|
|
|
i.getRecordDate().compareTo(current) == 0).map(ProEconWtCurveFitting::getId).collect(Collectors.toList());
|
|
|
|
|
@@ -697,7 +708,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- // item.SPEED = Double.Truncate((Double)pointsF2[i].X);
|
|
|
+ // item.SPEED = Double.Truncate(pointsF2[i].X);
|
|
|
} else {
|
|
|
boolean l = String.valueOf(daySjglls.get(i).getX()).contains(".");
|
|
|
if (l) {
|
|
@@ -728,7 +739,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- //item.SPEED = Double.Truncate((Double)pointsF2[i].X);
|
|
|
+ //item.SPEED = Double.Truncate(pointsF2[i].X);
|
|
|
} else {
|
|
|
boolean l = String.valueOf(daySjglls.get(i).getX()).contains(".");
|
|
|
if (l) {
|
|
@@ -739,7 +750,7 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
|
|
|
int finalI = i;
|
|
|
- OptionalDouble op = dayZyglls.stream().filter(x -> x.getX() == daySjglls.get(finalI).getX()).mapToDouble(x -> x.getY()).findFirst();
|
|
|
+ OptionalDouble op = dayZyglls.stream().filter(x -> Objects.equals(x.getX(), daySjglls.get(finalI).getX())).mapToDouble(PointVo::getY).findFirst();
|
|
|
|
|
|
if (op.isPresent()) {
|
|
|
item.setOptimalPower(op.getAsDouble());
|
|
@@ -753,7 +764,7 @@ public class PowerCurveFittingService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- /*********************************************当日曲线偏差记录**********************************************************/
|
|
|
+ //*********************************************当日曲线偏差记录**********************************************************/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -761,7 +772,7 @@ public class PowerCurveFittingService {
|
|
|
private void insertPoints2(Date current, String year, String month, List<PointVo> monthSjglls, List<PointVo> monthZyglls, List<PointVo> daySjglls, List<PointVo> dayZyglls, List<PointVo> yearSjglls, List<PointVo> yearZyglls, String windturbineId) {
|
|
|
|
|
|
|
|
|
- List<Integer> wtpcfidls = proEconWtPowerCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(windturbineId)).map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ List<Integer> wtpcfidls = proEconWtPowerCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(windturbineId)).map(ProEconWtPowerCurveFitting::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
for (int i = 0; i < wtpcfidls.size(); i++) {
|
|
@@ -779,7 +790,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- // item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ // item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
boolean l = String.valueOf(monthSjglls.get(i).getX()).contains(".");
|
|
|
if (l) {
|
|
@@ -811,7 +822,7 @@ public class PowerCurveFittingService {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
continue;
|
|
|
- //item.SPEED = Double.Truncate((Double)pointsF1[i].X);
|
|
|
+ //item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
|
boolean l = String.valueOf(monthSjglls.get(i).getX()).contains(".");
|
|
|
if (l) {
|
|
@@ -823,7 +834,7 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
item.setActualPower(monthSjglls.get(i).getY());
|
|
|
int finalI = i;
|
|
|
- OptionalDouble op = monthZyglls.stream().filter(x -> x.getX() == monthSjglls.get(finalI).getX()).mapToDouble(x -> x.getY()).findFirst();
|
|
|
+ OptionalDouble op = monthZyglls.stream().filter(x -> Objects.equals(x.getX(), monthSjglls.get(finalI).getX())).mapToDouble(PointVo::getY).findFirst();
|
|
|
|
|
|
if (op.isPresent()) {
|
|
|
item.setOptimalPower(op.getAsDouble());
|
|
@@ -841,10 +852,10 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
private void yearBuildPoints(List<ProEconWtCurveFittingYear> data, List<PointVo> points) {
|
|
|
if (data != null) {
|
|
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
+ for (ProEconWtCurveFittingYear datum : data) {
|
|
|
PointVo point = new PointVo();
|
|
|
- point.setX(data.get(i).getSpeed());
|
|
|
- point.setY(data.get(i).getActualPower());
|
|
|
+ point.setX(datum.getSpeed());
|
|
|
+ point.setY(datum.getActualPower());
|
|
|
points.add(point);
|
|
|
}
|
|
|
}
|
|
@@ -852,10 +863,10 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
private void monthBuildPoints(List<ProEconWtCurveFittingMonth> data, List<PointVo> points) {
|
|
|
if (data != null) {
|
|
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
+ for (ProEconWtCurveFittingMonth datum : data) {
|
|
|
PointVo point = new PointVo();
|
|
|
- point.setX(data.get(i).getSpeed());
|
|
|
- point.setY(data.get(i).getActualPower());
|
|
|
+ point.setX(datum.getSpeed());
|
|
|
+ point.setY(datum.getActualPower());
|
|
|
points.add(point);
|
|
|
}
|
|
|
}
|
|
@@ -863,10 +874,10 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
private void dayBuildPoints(List<ProEconWtCurveFitting> data, List<PointVo> points) {
|
|
|
if (data != null) {
|
|
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
+ for (ProEconWtCurveFitting datum : data) {
|
|
|
PointVo point = new PointVo();
|
|
|
- point.setX(data.get(i).getSpeed());
|
|
|
- point.setY(data.get(i).getActualPower());
|
|
|
+ point.setX(datum.getSpeed());
|
|
|
+ point.setY(datum.getActualPower());
|
|
|
points.add(point);
|
|
|
}
|
|
|
}
|
|
@@ -879,10 +890,10 @@ public class PowerCurveFittingService {
|
|
|
if (points1 != null && points1.size() != 0 && points2 != null && points2.size() != 0) {
|
|
|
double count = 0;
|
|
|
double sum = 0;
|
|
|
- double max = (double) modelpower;
|
|
|
+ double max = modelpower;
|
|
|
for (PointVo point : points1) {
|
|
|
- List<PointVo> item = points2.stream().filter(it -> it.getX() == point.getX()).collect(Collectors.toList());
|
|
|
- if (item != null && item.size() > 0) {
|
|
|
+ List<PointVo> item = points2.stream().filter(it -> Objects.equals(it.getX(), point.getX())).collect(Collectors.toList());
|
|
|
+ if (item.size() > 0) {
|
|
|
sum += Math.pow((point.getY() - item.get(0).getY()), 2);
|
|
|
count++;
|
|
|
pc += point.getY() - item.get(0).getY();
|
|
@@ -911,10 +922,10 @@ public class PowerCurveFittingService {
|
|
|
if (points1 != null && points1.size() != 0 && points2 != null && points2.size() != 0) {
|
|
|
double count = 0;
|
|
|
double sum = 0;
|
|
|
- double max = (double) modelpower;
|
|
|
+ double max = modelpower;
|
|
|
for (PointVo point : points1) {
|
|
|
- List<PointVo> item = points2.stream().filter(it -> it.getX() == point.getX()).collect(Collectors.toList());
|
|
|
- if (item != null && item.size() > 0 && item.get(0).getX() >= minSpeed && item.get(0).getX() < maxSpeed) {
|
|
|
+ List<PointVo> item = points2.stream().filter(it -> Objects.equals(it.getX(), point.getX())).collect(Collectors.toList());
|
|
|
+ if (item.size() > 0 && item.get(0).getX() >= minSpeed && item.get(0).getX() < maxSpeed) {
|
|
|
sum += Math.pow((point.getY() - item.get(0).getY()), 2);
|
|
|
count++;
|
|
|
pc += point.getY() - item.get(0).getY();
|
|
@@ -943,9 +954,11 @@ public class PowerCurveFittingService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //判定状态不为运行的进行过滤
|
|
|
- if (zt.getPointValueInDouble() != 2) {
|
|
|
- return false;
|
|
|
+ if (StringUtils.notEmp(fs)) {
|
|
|
+ //判定功率是否超过最大值
|
|
|
+ if (gl.getPointValueInDouble() > 25) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//判定状态不为运行的进行过滤
|
|
@@ -953,6 +966,8 @@ public class PowerCurveFittingService {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//设置时间为10分钟前,10钟前有停机事件数据进行过滤
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
c.setTimeInMillis(zt.getPointTime());
|
|
@@ -1015,18 +1030,16 @@ public class PowerCurveFittingService {
|
|
|
if (null != value && value.size() > 0) {
|
|
|
double qfzt = value.get(0).getPointValueInDouble();
|
|
|
|
|
|
- if (qfzt > 2) {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return !(qfzt > 2);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
//功率曲线拟合
|
|
|
public void curveFittingBuilder(Date begin, Date end, int dimension, double scale, String pointIdGL, String pointIdFS, String pointIdZT, List<PointVo> sjglPoints, List<PointVo> zyglPoints, String windturbineId) throws Exception {
|
|
|
- double maxPower = (double) windturbineCapacity.get(windturbineId) * 1.3;
|
|
|
- List<PointfVo> sjglnhpoints = new ArrayList<PointfVo>();
|
|
|
- Map<Double, PointfVo> zyglnhpoints = new HashMap<Double, PointfVo>();
|
|
|
+ double maxPower = windturbineCapacity.get(windturbineId) * 1.3;
|
|
|
+ List<PointfVo> sjglnhpoints = new ArrayList<>();
|
|
|
+ Map<Double, PointfVo> zyglnhpoints = new HashMap<>();
|
|
|
|
|
|
if (end.after(begin)) {
|
|
|
if (StringUtils.notEmp(pointIdGL) && StringUtils.notEmp(pointIdFS)) {
|
|
@@ -1038,7 +1051,7 @@ public class PowerCurveFittingService {
|
|
|
List<PointData> glpoints = new ArrayList<>();
|
|
|
List<PointData> fspoints = new ArrayList<>();
|
|
|
List<PointData> ztpoints = new ArrayList<>();
|
|
|
- if (glpointstemp.isEmpty() && fspointstemp.isEmpty() && ztpointstemp.isEmpty() && glpointstemp.size() == fspointstemp.size() && fspointstemp.size() == ztpointstemp.size()) {
|
|
|
+ if (!glpointstemp.isEmpty() && !fspointstemp.isEmpty() && !ztpointstemp.isEmpty() && glpointstemp.size() == fspointstemp.size() && fspointstemp.size() == ztpointstemp.size()) {
|
|
|
for (int i = 0; i < glpointstemp.size(); i++) {
|
|
|
if (filterData(glpointstemp.get(i), fspointstemp.get(i), ztpointstemp.get(i), maxPower, windturbineId)) {
|
|
|
glpoints.add(glpointstemp.get(i));
|
|
@@ -1054,24 +1067,24 @@ public class PowerCurveFittingService {
|
|
|
double x = fspoints.get(i).getPointValueInDouble();
|
|
|
double y = -1;
|
|
|
double z = -1;
|
|
|
- double z1 = -1;
|
|
|
+
|
|
|
int finalI1 = i;
|
|
|
List<PointData> yArray = glpoints.stream().filter(it -> it.getPointTime().compareTo(fspoints.get(finalI1).getPointTime()) == 0).collect(Collectors.toList());
|
|
|
- if (yArray != null && yArray.size() > 0) {
|
|
|
+ if (yArray.size() > 0) {
|
|
|
|
|
|
y = yArray.get(i).getPointValueInDouble();
|
|
|
}
|
|
|
|
|
|
int finalI = i;
|
|
|
yArray = ztpoints.stream().filter(it -> it.getPointTime().compareTo(fspoints.get(finalI).getPointTime()) == 0).collect(Collectors.toList());
|
|
|
- if (yArray != null && yArray.size() > 0) {
|
|
|
+ if (yArray.size() > 0) {
|
|
|
|
|
|
z = yArray.get(i).getPointValueInDouble();
|
|
|
}
|
|
|
|
|
|
|
|
|
Double x1 = StringUtils.round(x, 2);
|
|
|
- Double y1 = (Double) y;
|
|
|
+ Double y1 = y;
|
|
|
|
|
|
|
|
|
boolean b = true;
|
|
@@ -1128,7 +1141,7 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
|
|
|
Double x1 = StringUtils.round(x, 2);
|
|
|
- Double y1 = (Double) y;
|
|
|
+ Double y1 = y;
|
|
|
|
|
|
|
|
|
boolean b = true;
|
|
@@ -1176,30 +1189,28 @@ public class PowerCurveFittingService {
|
|
|
|
|
|
sjglnhpoints = sjglnhpoints.stream().filter(it -> it.getX() >= 3).sorted(Comparator.comparing(PointfVo::getX)).collect(Collectors.toList());
|
|
|
|
|
|
- List<PointVo> temp = LineUtil.buildLine(sjglnhpoints.stream().mapToDouble(i -> i.getX()).toArray(), sjglnhpoints.stream().mapToDouble(i -> i.getY()).toArray(), sjglnhpoints.size(), dimension, scale);
|
|
|
+ List<PointVo> temp = LineUtil.buildLine(sjglnhpoints.stream().mapToDouble(PointfVo::getX).toArray(), sjglnhpoints.stream().mapToDouble(PointfVo::getY).toArray(), sjglnhpoints.size(), dimension, scale);
|
|
|
|
|
|
sjglPoints.addAll(temp);
|
|
|
- if (sjglPoints != null && sjglPoints.size() != 0) {
|
|
|
+ if (sjglPoints.size() != 0) {
|
|
|
buildMyPoints(sjglPoints, scale);
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (!zyglnhpoints.containsKey(0))
|
|
|
+ if (!zyglnhpoints.containsKey(0.0))
|
|
|
zyglnhpoints.put(0.0, new PointfVo(0.0, 0.0));
|
|
|
|
|
|
- List<PointfVo> FF = zyglnhpoints.values().stream().filter(it -> it.getX() >= 3).sorted(Comparator.comparing(PointfVo::getX)).collect(Collectors.toList());
|
|
|
- if (FF != null && FF.size() != 0) {
|
|
|
- temp = LineUtil.buildLine(FF.stream().mapToDouble(i -> i.getX()).toArray(), FF.stream().mapToDouble(i -> i.getY()).toArray(), FF.size(), dimension, scale);
|
|
|
+ List<PointfVo> zygltemp = zyglnhpoints.values().stream().filter(it -> it.getX() >= 3).sorted(Comparator.comparing(PointfVo::getX)).collect(Collectors.toList());
|
|
|
+ if (zygltemp.size() != 0) {
|
|
|
+ temp = LineUtil.buildLine(zygltemp.stream().mapToDouble(PointfVo::getX).toArray(), zygltemp.stream().mapToDouble(PointfVo::getY).toArray(), zygltemp.size(), dimension, scale);
|
|
|
}
|
|
|
zyglPoints.addAll(temp);
|
|
|
- if (zyglPoints != null && zyglPoints.size() != 0) {
|
|
|
+ if (zyglPoints.size() != 0) {
|
|
|
buildMyPoints(zyglPoints, scale);
|
|
|
}
|
|
|
|
|
|
|
|
|
- sjglPoints = sjglPoints.stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
|
|
|
- zyglPoints = zyglPoints.stream().filter(it -> it.getX() >= 0 && it.getX() <= 25).sorted(Comparator.comparing(PointVo::getX)).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1220,10 +1231,23 @@ public class PowerCurveFittingService {
|
|
|
smax *= coefficient;
|
|
|
|
|
|
|
|
|
- double min = sjglPoints.stream().min((a, b) -> a.getX().compareTo(b.getX())).get().getX() * coefficient;
|
|
|
- double max = sjglPoints.stream().max((a, b) -> a.getX().compareTo(b.getX())).get().getX() * coefficient;
|
|
|
+ double min =0.0;
|
|
|
+ double max=0.0;
|
|
|
+ double maxval =0.0;
|
|
|
+ if(sjglPoints.stream().min(Comparator.comparing(PointVo::getX)).isPresent())
|
|
|
+ {
|
|
|
+ min = sjglPoints.stream().min(Comparator.comparing(PointVo::getX)).get().getX() * coefficient;
|
|
|
+
|
|
|
+ }
|
|
|
+ if(sjglPoints.stream().max(Comparator.comparing(PointVo::getX)).isPresent())
|
|
|
+ {
|
|
|
+ max = sjglPoints.stream().max(Comparator.comparing(PointVo::getX)).get().getX() * coefficient;
|
|
|
+ }
|
|
|
+ if(sjglPoints.stream().max(Comparator.comparing(PointVo::getY)).isPresent())
|
|
|
+ {
|
|
|
+ maxval = sjglPoints.stream().max(Comparator.comparing(PointVo::getY)).get().getY();
|
|
|
+ }
|
|
|
|
|
|
- double maxval = sjglPoints.stream().max((a, b) -> a.getY().compareTo(b.getY())).get().getY();
|
|
|
|
|
|
for (double i = 0; i < min; i += 1) {
|
|
|
PointVo point = new PointVo();
|