|
@@ -1,22 +1,23 @@
|
|
|
package com.gyee.generation.service;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
import com.gyee.generation.init.CacheContext;
|
|
|
import com.gyee.generation.model.auto.*;
|
|
|
-import com.gyee.generation.model.vo.CureFittingVo;
|
|
|
-import com.gyee.generation.model.vo.PointVo;
|
|
|
-import com.gyee.generation.model.vo.PointfVo;
|
|
|
+import com.gyee.generation.model.vo.*;
|
|
|
import com.gyee.generation.service.auto.*;
|
|
|
import com.gyee.generation.util.DateUtils;
|
|
|
import com.gyee.generation.util.StringUtils;
|
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
import com.gyee.generation.util.realtimesource.math.LineUtil;
|
|
|
+import com.gyee.generation.util.redis.RedisService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -36,6 +37,9 @@ public class PowerCurveFittingByTimeService {
|
|
|
private String initialcode;
|
|
|
public Map<String, Double> windturbineCapacity;
|
|
|
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private RedisService redisService;
|
|
|
@Resource
|
|
|
private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
|
|
|
|
|
@@ -70,9 +74,9 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
Date begin = DateUtils.addDays(end, -6);
|
|
|
|
|
|
- proEconWtCurveFittingService.deleteProEconWtCurveFittingByDay(DateUtils.truncate(recordDate));
|
|
|
- proEconCurveFittingMainService.deleteProEconCurveFittingMainByDay(DateUtils.truncate(recordDate));
|
|
|
- proEconCurveFittingSubService.deleteProEconCurveFittingSubByDay(DateUtils.truncate(recordDate));
|
|
|
+ proEconWtCurveFittingService.deleteProEconWtCurveFittingFByDay(DateUtils.truncate(recordDate));
|
|
|
+ proEconCurveFittingMainService.deleteProEconCurveFittingMainFByDay(DateUtils.truncate(recordDate));
|
|
|
+ proEconCurveFittingSubService.deleteProEconCurveFittingSubFByDay(DateUtils.truncate(recordDate));
|
|
|
Map<String, CureFittingVo> windMap = new HashMap<>();
|
|
|
|
|
|
//初始化风机装机容量
|
|
@@ -90,33 +94,31 @@ public class PowerCurveFittingByTimeService {
|
|
|
for (ProBasicEquipment wt : CacheContext.wtls) {
|
|
|
String windturbineId = wt.getId();
|
|
|
|
|
|
+ if(wt.getWindpowerstationId().contains(WpType.GDC.id))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = CacheContext.wtpAimap.get(wt.getId());
|
|
|
//设备有功功率
|
|
|
- String pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
|
|
|
+ String pointIdGL = null;
|
|
|
//设备明细状态
|
|
|
- String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
|
|
|
-
|
|
|
- String pointIdFS;
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) { //测风塔70米风速
|
|
|
-
|
|
|
- if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
|
|
|
- ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
|
|
|
-
|
|
|
- if (StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().equals(initialcode)) {
|
|
|
- pointIdFS = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70).getNemCode();
|
|
|
- } else {
|
|
|
- pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
|
|
|
- }
|
|
|
- } else {
|
|
|
- pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
|
|
|
- }
|
|
|
+ String pointIdZT = null;
|
|
|
|
|
|
+ String pointIdFS = null;
|
|
|
+ if (windturbinetestingpointnewMap.containsKey(ContantXk.CJ_SSFS)) {
|
|
|
|
|
|
- } else { //设备风速
|
|
|
pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
|
|
|
}
|
|
|
+ if (windturbinetestingpointnewMap.containsKey(ContantXk.CJ_SSGL)) {
|
|
|
|
|
|
+ pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
|
|
|
+ }
|
|
|
+ if (windturbinetestingpointnewMap.containsKey(ContantXk.MXZT)) {
|
|
|
+
|
|
|
+ pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
|
|
|
+ }
|
|
|
|
|
|
CureFittingVo item = new CureFittingVo();
|
|
|
|
|
@@ -194,16 +196,23 @@ public class PowerCurveFittingByTimeService {
|
|
|
//*********************************************日曲线偏差上个日和上一年记录**********************************************************/
|
|
|
Date d1 = DateUtils.addDays(recordDate, -1);
|
|
|
Date d2 = DateUtils.addYears(recordDate, -1);
|
|
|
-
|
|
|
- List<ProEconWtCurveFitting> wcfls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
- i.getRecordDate().compareTo(d1) == 0).sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
+ QueryWrapper<ProEconWtCurveFitting> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("record_date",d1).eq("windturbine_id",key);
|
|
|
+ List<ProEconWtCurveFitting> wcfls = proEconWtCurveFittingService.list(queryWrapper)
|
|
|
+ .stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
+// i.getRecordDate().compareTo(d1) == 0)
|
|
|
+ .sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
dayBuildPoints(wcfls, dayLastMonthPoints);
|
|
|
|
|
|
-
|
|
|
- wcfls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
- i.getRecordDate().compareTo(d2) == 0).sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
+ QueryWrapper<ProEconWtCurveFitting> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("record_date",d2).eq("windturbine_id",key);
|
|
|
+ wcfls = proEconWtCurveFittingService.list(queryWrapper2).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
+// i.getRecordDate().compareTo(d2) == 0)
|
|
|
+ .sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
//与轶总的原始代码对比不一致,临时修改测试
|
|
|
dayBuildPoints(wcfls, dayLastMonthPoints);
|
|
@@ -227,8 +236,12 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
|
|
|
//*********************************************当日曲线偏差记录**********************************************************/
|
|
|
- Optional<ProEconCurveFittingMain> cfmdayo = proEconCurveFittingMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
- && i.getRecordDate().compareTo(recordDate) == 0).findFirst();
|
|
|
+ QueryWrapper<ProEconCurveFittingMain> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("record_date",recordDate).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittingMain> cfmdayo = proEconCurveFittingMainService.list(queryWrapper3).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getRecordDate().compareTo(recordDate) == 0)
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittingMain cfmday;
|
|
|
|
|
|
if (cfmdayo.isPresent()) {
|
|
@@ -295,9 +308,9 @@ public class PowerCurveFittingByTimeService {
|
|
|
int day_month = c.get(Calendar.MONTH) + 1;
|
|
|
|
|
|
|
|
|
- proEconWtCurveFittingMonthService.deleteProEconWtCurveFittingByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
- proEconCurveFittMonthMainService.deleteProEconCurveFittMonthMainByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
- proEconCurveFittMonthSubService.deleteProEconCurveFittMonthSubByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
+ proEconWtCurveFittingMonthService.deleteProEconWtCurveFittingFByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
+ proEconCurveFittMonthMainService.deleteProEconCurveFittMonthMainFByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
+ proEconCurveFittMonthSubService.deleteProEconCurveFittMonthSubFByMonth(String.valueOf(day_year),String.valueOf(day_month));
|
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
Date begin = c.getTime();
|
|
|
|
|
@@ -326,7 +339,10 @@ public class PowerCurveFittingByTimeService {
|
|
|
for (ProBasicEquipment wt : CacheContext.wtls) {
|
|
|
String windturbineId = wt.getId();
|
|
|
|
|
|
-
|
|
|
+ if(wt.getWindpowerstationId().contains(WpType.GDC.id))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = CacheContext.wtpAimap.get(wt.getId());
|
|
|
//设备有功功率
|
|
|
String pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
|
|
@@ -334,7 +350,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
|
|
|
|
|
|
String pointIdFS;
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) { //测风塔70米风速
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) { //测风塔70米风速
|
|
|
|
|
|
if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
|
|
|
ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
|
|
@@ -435,14 +451,20 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
|
|
|
//*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
|
-
|
|
|
- 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());
|
|
|
+ QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("year",stringyear2).eq("month",stringmonth2).eq("windturbine_id",key);
|
|
|
+ List<ProEconWtCurveFittingMonth> wcfmls = proEconWtCurveFittingMonthService.list(queryWrapper).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 = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
- i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3)).sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
|
|
|
+ QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("year",stringyear3).eq("month",stringmonth3).eq("windturbine_id",key);
|
|
|
+ wcfmls = proEconWtCurveFittingMonthService.list(queryWrapper2).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
+// i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3))
|
|
|
+ .sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
monthBuildPoints(wcfmls, monthLastYearPoints);
|
|
|
//*********************************************月曲线偏差上个月和上一年记录**********************************************************/
|
|
@@ -466,8 +488,12 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
|
|
|
//*********************************************当月曲线偏差记录**********************************************************/
|
|
|
- Optional<ProEconCurveFittMonthMain> cfmmontho = proEconCurveFittMonthMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
- && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth)).findFirst();
|
|
|
+ QueryWrapper<ProEconCurveFittMonthMain> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("year",stringyear).eq("month",stringmonth).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittMonthMain> cfmmontho = proEconCurveFittMonthMainService.list(queryWrapper3).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth))
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittMonthMain cfmmonth;
|
|
|
if (cfmmontho.isPresent()) {
|
|
|
cfmmonth = cfmmontho.get();
|
|
@@ -497,7 +523,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
cfmmonth.setStandardDeviationRate(pcl(windMap.get(key).getYsjglPoints(), monthStandardPoints, modelpower));
|
|
|
|
|
|
mainls.add(cfmmonth);
|
|
|
- // proEconCurveFittMonthMainService.save(cfmmonth);
|
|
|
+ // proEconCurveFittMonthMainService.save(cfmmonth);
|
|
|
|
|
|
//*********************************************当月曲线偏差记录**********************************************************/
|
|
|
List<ProEconCurveFittMonthSub> subls=new ArrayList<>();
|
|
@@ -542,9 +568,9 @@ public class PowerCurveFittingByTimeService {
|
|
|
int day_year = c.get(Calendar.YEAR);
|
|
|
|
|
|
|
|
|
- proEconWtCurveFittingYearService.deleteProEconWtCurveFittingByYear(String.valueOf(day_year));
|
|
|
- proEconCurveFittYearMainService.deleteProEconCurveFittYearMainByYear(String.valueOf(day_year));
|
|
|
- proEconCurveFittYearSubService.deleteProEconCurveFittYearSubByYear(String.valueOf(day_year));
|
|
|
+ proEconWtCurveFittingYearService.deleteProEconWtCurveFittingFByYear(String.valueOf(day_year));
|
|
|
+ proEconCurveFittYearMainService.deleteProEconCurveFittYearMainFByYear(String.valueOf(day_year));
|
|
|
+ proEconCurveFittYearSubService.deleteProEconCurveFittYearSubFByYear(String.valueOf(day_year));
|
|
|
c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
c.set(Calendar.MONTH, 0);
|
|
|
Date begin = c.getTime();
|
|
@@ -570,7 +596,10 @@ public class PowerCurveFittingByTimeService {
|
|
|
for (ProBasicEquipment wt : CacheContext.wtls) {
|
|
|
String windturbineId = wt.getId();
|
|
|
|
|
|
-
|
|
|
+ if(wt.getWindpowerstationId().contains(WpType.GDC.id))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = CacheContext.wtpAimap.get(wt.getId());
|
|
|
//设备有功功率
|
|
|
String pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
|
|
@@ -578,7 +607,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
|
|
|
|
|
|
String pointIdFS;
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) { //测风塔70米风速
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) { //测风塔70米风速
|
|
|
|
|
|
if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
|
|
|
ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
|
|
@@ -630,9 +659,13 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
|
|
|
//拟合年功率曲线
|
|
|
- // curveFittingBuilder(begin, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), key);
|
|
|
-
|
|
|
- List<ProEconWtPowerCurveFitting> wtpowerls= proEconWtPowerCurveFittingService.list().stream().filter(i->i.getWindturbineId().equals(key)).sorted(Comparator.comparing(ProEconWtPowerCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
+ // curveFittingBuilder(begin, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), key);
|
|
|
+ QueryWrapper<ProEconWtPowerCurveFitting> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("windturbine_id",key);
|
|
|
+ List<ProEconWtPowerCurveFitting> wtpowerls= proEconWtPowerCurveFittingService.list(queryWrapper)
|
|
|
+ .stream()
|
|
|
+// .filter(i->i.getWindturbineId().equals(key))
|
|
|
+ .sorted(Comparator.comparing(ProEconWtPowerCurveFitting::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
List<PointVo> zyglls=new ArrayList<>();
|
|
|
List<PointVo> sjglls=new ArrayList<>();
|
|
@@ -704,9 +737,12 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
// /*********************************************年曲线偏差上个月和上一年记录**********************************************************/
|
|
|
|
|
|
-
|
|
|
- List<ProEconWtCurveFittingYear> wcfyls = proEconWtCurveFittingYearService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
- i.getYear().equals(stringyear3)).sorted(Comparator.comparing(ProEconWtCurveFittingYear::getSpeed)).collect(Collectors.toList());
|
|
|
+ QueryWrapper<ProEconWtCurveFittingYear> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("year",stringyear3).eq("windturbine_id",key);
|
|
|
+ List<ProEconWtCurveFittingYear> wcfyls = proEconWtCurveFittingYearService.list(queryWrapper).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key) &&
|
|
|
+// i.getYear().equals(stringyear3))
|
|
|
+ .sorted(Comparator.comparing(ProEconWtCurveFittingYear::getSpeed)).collect(Collectors.toList());
|
|
|
|
|
|
//与轶总的原始代码对比不一致,新增代码修改测试
|
|
|
yearBuildPoints(wcfyls, yearLastMonthPoints);
|
|
@@ -732,8 +768,13 @@ public class PowerCurveFittingByTimeService {
|
|
|
//*********************************************年曲线偏差记录**********************************************************/
|
|
|
|
|
|
//*********************************************当年曲线偏差记录**********************************************************/
|
|
|
- Optional<ProEconCurveFittYearMain> cfmyearo = proEconCurveFittYearMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
- && i.getYear().equals(stringyear)).findFirst();
|
|
|
+ QueryWrapper<ProEconCurveFittYearMain> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("year",stringyear).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittYearMain> cfmyearo = proEconCurveFittYearMainService.list(queryWrapper2)
|
|
|
+ .stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getYear().equals(stringyear))
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittYearMain cfmyear;
|
|
|
if (cfmyearo.isPresent()) {
|
|
|
cfmyear = cfmyearo.get();
|
|
@@ -763,7 +804,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
cfmyear.setStandardDeviationRate(pcl(windMap.get(key).getNsjglPoints(), yearStandardPoints, modelpower));
|
|
|
|
|
|
mainls.add(cfmyear);
|
|
|
- // proEconCurveFittYearMainService.save(cfmyear);
|
|
|
+ // proEconCurveFittYearMainService.save(cfmyear);
|
|
|
|
|
|
//*********************************************当年曲线偏差记录**********************************************************/
|
|
|
List<ProEconCurveFittYearSub> subls=new ArrayList<>();
|
|
@@ -793,14 +834,19 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
|
|
|
public ProEconCurveFittingSub pLCBuild(String key, Date current, Map<String, CureFittingVo> windMap, Double modelpower, double speed,
|
|
|
- List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
+ List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
) {
|
|
|
|
|
|
- String speedStr = String.valueOf(speed);
|
|
|
+// String speedStr = String.valueOf(speed);
|
|
|
|
|
|
//*********************************************当日曲线偏差子表记录**********************************************************/
|
|
|
- Optional<ProEconCurveFittingSub> cfmso = proEconCurveFittingSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
|
|
|
- && i.getRecordDate().compareTo(current) == 0 && i.getSpeed().equals(speedStr)).findFirst();
|
|
|
+ QueryWrapper<ProEconCurveFittingSub> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("record_date",current).eq("speed",speed).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittingSub> cfmso = proEconCurveFittingSubService.list(queryWrapper2)
|
|
|
+ .stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getRecordDate().compareTo(current) == 0 && i.getSpeed().equals(speedStr))
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittingSub cfms;
|
|
|
|
|
|
if (cfmso.isPresent()) {
|
|
@@ -813,7 +859,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
cfms = new ProEconCurveFittingSub();
|
|
|
cfms.setWindturbineId(key);
|
|
|
- cfms.setSpeed(String.valueOf(speed));
|
|
|
+ cfms.setSpeed(speed);
|
|
|
cfms.setRecordDate(DateUtils.truncate(current));
|
|
|
|
|
|
|
|
@@ -836,14 +882,17 @@ public class PowerCurveFittingByTimeService {
|
|
|
}
|
|
|
|
|
|
public ProEconCurveFittMonthSub pLCBuild(String key, String stringyear, String stringmonth, Map<String, CureFittingVo> windMap, Double modelpower, double speed,
|
|
|
- List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
+ List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
) {
|
|
|
- String speedStr = String.valueOf(speed);
|
|
|
+// String speedStr = String.valueOf(speed);
|
|
|
|
|
|
//*********************************************当月曲线偏差子表记录**********************************************************/
|
|
|
-
|
|
|
- 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();
|
|
|
+ QueryWrapper<ProEconCurveFittMonthSub> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("year",stringyear).eq("month",stringmonth).eq("speed",speed).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list(queryWrapper2).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth) && i.getSpeed().equals(speedStr))
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittMonthSub cfmsmonth;
|
|
|
|
|
|
if (cfmsmontho.isPresent()) {
|
|
@@ -859,7 +908,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
cfmsmonth.setWindturbineId(key);
|
|
|
cfmsmonth.setYear(stringyear);
|
|
|
cfmsmonth.setMonth(stringmonth);
|
|
|
- cfmsmonth.setSpeed(String.valueOf(speed));
|
|
|
+ cfmsmonth.setSpeed(speed);
|
|
|
|
|
|
|
|
|
|
|
@@ -883,14 +932,17 @@ public class PowerCurveFittingByTimeService {
|
|
|
}
|
|
|
|
|
|
public ProEconCurveFittYearSub pLCBuild(String key, String stringyear, Map<String, CureFittingVo> windMap, Double modelpower, double speed,
|
|
|
- List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
+ List<PointVo> bzglpowerPoints, List<PointVo> lastMonthPoints, List<PointVo> lastYearPoints, List<PointVo> lastStandardPoints
|
|
|
) {
|
|
|
- String speedStr = String.valueOf(speed);
|
|
|
+// 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();
|
|
|
+ QueryWrapper<ProEconCurveFittYearSub> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("year",stringyear).eq("speed",speed).eq("windturbine_id",key);
|
|
|
+ Optional<ProEconCurveFittYearSub> cfmsyearo = proEconCurveFittYearSubService.list(queryWrapper).stream()
|
|
|
+// .filter(i -> i.getWindturbineId().equals(key)
|
|
|
+// && i.getYear().equals(stringyear) && i.getSpeed().equals(speedStr))
|
|
|
+ .findFirst();
|
|
|
ProEconCurveFittYearSub cfmsyear;
|
|
|
|
|
|
if (cfmsyearo.isPresent()) {
|
|
@@ -904,22 +956,22 @@ public class PowerCurveFittingByTimeService {
|
|
|
cfmsyear = new ProEconCurveFittYearSub();
|
|
|
cfmsyear.setWindturbineId(key);
|
|
|
cfmsyear.setYear(stringyear);
|
|
|
- cfmsyear.setSpeed(String.valueOf(speed));
|
|
|
+ cfmsyear.setSpeed(speed);
|
|
|
|
|
|
- // proEconCurveFittYearSubService.save(cfmsyear);
|
|
|
+ // proEconCurveFittYearSubService.save(cfmsyear);
|
|
|
|
|
|
//年---实际/最优
|
|
|
- cfmsyear.setDeviationRate1(pcl2(windMap.get(key).getYsjglPoints(), windMap.get(key).getYzyglPoints(), modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate1(pcl2(windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), modelpower, speed));
|
|
|
//年---实际/保证
|
|
|
- cfmsyear.setDeviationRate2(pcl2(windMap.get(key).getYsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate2(pcl2(windMap.get(key).getNsjglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//年---最优/保证
|
|
|
- cfmsyear.setDeviationRate3(pcl2(windMap.get(key).getYzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
+ cfmsyear.setDeviationRate3(pcl2(windMap.get(key).getNzyglPoints(), bzglpowerPoints, modelpower, speed));
|
|
|
//年---实际/上月实际
|
|
|
- cfmsyear.setMonthDeviationRate(pcl2(windMap.get(key).getYsjglPoints(), lastMonthPoints, modelpower, speed));
|
|
|
+ cfmsyear.setMonthDeviationRate(pcl2(windMap.get(key).getNsjglPoints(), lastMonthPoints, modelpower, speed));
|
|
|
//年---实际/同期实际
|
|
|
- cfmsyear.setYearDeviationRate(pcl2(windMap.get(key).getYsjglPoints(), lastYearPoints, modelpower, speed));
|
|
|
+ cfmsyear.setYearDeviationRate(pcl2(windMap.get(key).getNsjglPoints(), lastYearPoints, modelpower, speed));
|
|
|
//年---实际/标杆实际
|
|
|
- cfmsyear.setStandardDeviationRate(pcl2(windMap.get(key).getYsjglPoints(), lastStandardPoints, modelpower, speed));
|
|
|
+ cfmsyear.setStandardDeviationRate(pcl2(windMap.get(key).getNsjglPoints(), lastStandardPoints, modelpower, speed));
|
|
|
|
|
|
// proEconCurveFittYearSubService.save(cfmsyear);
|
|
|
return cfmsyear;
|
|
@@ -946,7 +998,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
// item.SPEED = Double.Truncate(pointsF2[i].X);
|
|
|
} else {
|
|
@@ -978,7 +1030,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
//item.SPEED = Double.Truncate(pointsF2[i].X);
|
|
|
} else {
|
|
@@ -1009,6 +1061,8 @@ public class PowerCurveFittingByTimeService {
|
|
|
//*********************************************当日曲线偏差记录**********************************************************/
|
|
|
}
|
|
|
proEconWtCurveFittingService.saveBatch(wtcfls);
|
|
|
+ String s = JSONObject.toJSONString(wtcfls);
|
|
|
+ redisService.set(CurveType.dayCurve.id+"_"+windturbineId, s);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1031,7 +1085,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
item.setWindturbineId(windturbineId);
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
// item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1043,7 +1097,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
item.setYear(String.valueOf(year));
|
|
|
item.setMonth(String.valueOf(month));
|
|
|
wtcfls.add(item);
|
|
|
- // proEconWtCurveFittingMonthService.save(item);
|
|
|
+ // proEconWtCurveFittingMonthService.save(item);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1057,7 +1111,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
//item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1086,6 +1140,8 @@ public class PowerCurveFittingByTimeService {
|
|
|
//*********************************************当月曲线偏差记录**********************************************************/
|
|
|
|
|
|
proEconWtCurveFittingMonthService.saveBatch(wtcfls);
|
|
|
+ String s = JSONObject.toJSONString(wtcfls);
|
|
|
+ redisService.set(CurveType.monthCurve.id+"_"+windturbineId, s);
|
|
|
}
|
|
|
|
|
|
private void insertPoints(String year, List<PointVo> sjglls, List<PointVo> zyglls, String windturbineId) {
|
|
@@ -1104,7 +1160,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
item.setWindturbineId(windturbineId);
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
// item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1115,7 +1171,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
item.setOptimalPower(zyglls.get(i).getY());
|
|
|
item.setYear(String.valueOf(year));
|
|
|
wtcfls.add(item);
|
|
|
- // proEconWtCurveFittingYearService.save(item);
|
|
|
+ // proEconWtCurveFittingYearService.save(item);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1129,7 +1185,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
//item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1157,6 +1213,8 @@ public class PowerCurveFittingByTimeService {
|
|
|
//*********************************************当年曲线偏差记录**********************************************************/
|
|
|
|
|
|
proEconWtCurveFittingYearService.saveBatch(wtcfls);
|
|
|
+ String s = JSONObject.toJSONString(wtcfls);
|
|
|
+ redisService.set(CurveType.yearCurve.id+"_"+windturbineId, s);
|
|
|
}
|
|
|
private void insertPoints2(List<PointVo> monthSjglls, List<PointVo> monthZyglls, String windturbineId) {
|
|
|
|
|
@@ -1182,7 +1240,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
// item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1214,7 +1272,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
continue;
|
|
|
//item.SPEED = Double.Truncate(pointsF1[i].X);
|
|
|
} else {
|
|
@@ -1356,99 +1414,99 @@ public class PowerCurveFittingByTimeService {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //判定状态不为运行的进行过滤
|
|
|
- if (zt.getPointValueInDouble() != 2) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //设置时间为10分钟前,10钟前有停机事件数据进行过滤
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
- c.setTimeInMillis(zt.getPointTime());
|
|
|
- Date end = c.getTime();
|
|
|
- c.add(Calendar.MINUTE, -10);
|
|
|
- Date bedin = c.getTime();
|
|
|
- List<PointData> points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
|
|
|
- if (!points.isEmpty()) {
|
|
|
- for (PointData p : points) {
|
|
|
- if (p.getPointValueInDouble() == 4) {
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //设置时间为10分钟后,运行后10分钟数据进行过滤
|
|
|
-
|
|
|
- points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
|
|
|
- if (!points.isEmpty()) {
|
|
|
- for (PointData p : points) {
|
|
|
- if (p.getPointValueInDouble() != 2) {
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
|
|
|
- Map<String, ProBasicEquipmentPoint> wtpointmap = wtpAimap.get(windturbineId);
|
|
|
-
|
|
|
-
|
|
|
- List<PointVo> bzPointls=new ArrayList<>();
|
|
|
- List<PointVo> sjPointls=new ArrayList<>();
|
|
|
-
|
|
|
- double modelpower=0.0;
|
|
|
- if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
- String modelid = CacheContext.wtmap.get(windturbineId).getModelId();
|
|
|
- if (StringUtils.notEmp(modelid)) {
|
|
|
- //获取保证功率曲线中的风速和功率
|
|
|
- if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
|
|
|
- Map<Double,ProBasicModelPowerRd> theoreticalMap= CacheContext.theoreticalPowerMap.get(modelid);
|
|
|
-
|
|
|
- PointVo point = new PointVo();
|
|
|
- double speed=StringUtils.round(fs.getPointValueInDouble(),2);
|
|
|
- point.setX(speed);
|
|
|
- point.setY(theoreticalMap.get(speed).getEnsurePower());
|
|
|
- modelpower=point.getY();
|
|
|
- bzPointls.add(point);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- PointVo point = new PointVo();
|
|
|
- double speed=StringUtils.round(fs.getPointValueInDouble(),2);
|
|
|
- double power=StringUtils.round(gl.getPointValueInDouble(),2);
|
|
|
- point.setX(speed);
|
|
|
- point.setY(power);
|
|
|
- sjPointls.add(point);
|
|
|
-
|
|
|
- //与保证功率进行对比,偏差大于25%的进行过滤
|
|
|
- double value= pcl2( sjPointls, bzPointls, modelpower, speed);
|
|
|
-
|
|
|
- if (value > Math.abs(0.25)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- List<String> pointid = new ArrayList<>();
|
|
|
- //欠发状态大于2过滤掉
|
|
|
- pointid.add(wtpointmap.get(ContantXk.LSQFZT).getNemCode());
|
|
|
- List<PointData> values = edosUtil.getHistMatrix(pointid, gl.getPointTime() / 1000);
|
|
|
- if (null != values && values.size() > 0) {
|
|
|
- double qfzt = values.get(0).getPointValueInDouble();
|
|
|
-
|
|
|
- return !(qfzt > 2);
|
|
|
- }
|
|
|
+//
|
|
|
+// //判定状态不为运行的进行过滤
|
|
|
+// if (zt.getPointValueInDouble() != 2) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //设置时间为10分钟前,10钟前有停机事件数据进行过滤
|
|
|
+// Calendar c = Calendar.getInstance();
|
|
|
+// c.setTimeInMillis(zt.getPointTime());
|
|
|
+// Date end = c.getTime();
|
|
|
+// c.add(Calendar.MINUTE, -10);
|
|
|
+// Date bedin = c.getTime();
|
|
|
+// List<PointData> points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
|
|
|
+// if (!points.isEmpty()) {
|
|
|
+// for (PointData p : points) {
|
|
|
+// if (p.getPointValueInDouble() == 4) {
|
|
|
+//
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// //设置时间为10分钟后,运行后10分钟数据进行过滤
|
|
|
+//
|
|
|
+// points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
|
|
|
+// if (!points.isEmpty()) {
|
|
|
+// for (PointData p : points) {
|
|
|
+// if (p.getPointValueInDouble() != 2) {
|
|
|
+// return false;
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
|
|
|
+// Map<String, ProBasicEquipmentPoint> wtpointmap = wtpAimap.get(windturbineId);
|
|
|
+//
|
|
|
+//
|
|
|
+// List<PointVo> bzPointls=new ArrayList<>();
|
|
|
+// List<PointVo> sjPointls=new ArrayList<>();
|
|
|
+//
|
|
|
+// double modelpower=0.0;
|
|
|
+// if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
+// String modelid = CacheContext.wtmap.get(windturbineId).getModelId();
|
|
|
+// if (StringUtils.notEmp(modelid)) {
|
|
|
+// //获取保证功率曲线中的风速和功率
|
|
|
+// if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
|
|
|
+// Map<Double,ProBasicModelPowerRd> theoreticalMap= CacheContext.theoreticalPowerMap.get(modelid);
|
|
|
+//
|
|
|
+// PointVo point = new PointVo();
|
|
|
+// double speed=StringUtils.round(fs.getPointValueInDouble(),2);
|
|
|
+// point.setX(speed);
|
|
|
+// point.setY(theoreticalMap.get(speed).getEnsurePower());
|
|
|
+// modelpower=point.getY();
|
|
|
+// bzPointls.add(point);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// PointVo point = new PointVo();
|
|
|
+// double speed=StringUtils.round(fs.getPointValueInDouble(),2);
|
|
|
+// double power=StringUtils.round(gl.getPointValueInDouble(),2);
|
|
|
+// point.setX(speed);
|
|
|
+// point.setY(power);
|
|
|
+// sjPointls.add(point);
|
|
|
+//
|
|
|
+// //与保证功率进行对比,偏差大于25%的进行过滤
|
|
|
+// double value= pcl2( sjPointls, bzPointls, modelpower, speed);
|
|
|
+//
|
|
|
+// if (value > Math.abs(0.25)) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// List<String> pointid = new ArrayList<>();
|
|
|
+// //欠发状态大于2过滤掉
|
|
|
+// pointid.add(wtpointmap.get(ContantXk.LSQFZT).getNemCode());
|
|
|
+// List<PointData> values = edosUtil.getHistMatrix(pointid, gl.getPointTime() / 1000);
|
|
|
+// if (null != values && values.size() > 0) {
|
|
|
+// double qfzt = values.get(0).getPointValueInDouble();
|
|
|
+//
|
|
|
+// 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 {
|
|
|
+ private 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 = windturbineCapacity.get(windturbineId) * 1.3;
|
|
|
double maxSpeed = 25;
|
|
|
List<PointfVo> sjglnhpoints = new ArrayList<>();
|
|
@@ -1505,7 +1563,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
b = (x >= 0 && y > 0);
|
|
|
} else {
|
|
|
if (z == 2) {
|
|
@@ -1561,7 +1619,7 @@ public class PowerCurveFittingByTimeService {
|
|
|
if (CacheContext.wtmap.containsKey(windturbineId)) {
|
|
|
|
|
|
ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
|
|
|
- if (wt.getWindpowerstationId().contains("GDC")) {
|
|
|
+ if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
|
|
|
b = (x >= 0 && y > 0);
|
|
|
} else {
|
|
|
if (z == 2) {
|