|
@@ -337,55 +337,60 @@ public class HealthMainService {
|
|
int lsl = 0;// 良数量
|
|
int lsl = 0;// 良数量
|
|
int csl = 0;// 差数量
|
|
int csl = 0;// 差数量
|
|
double jkd = 0.0;
|
|
double jkd = 0.0;
|
|
- List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wp.getId());
|
|
|
|
- if (!wfhls.isEmpty()) {
|
|
|
|
-
|
|
|
|
- Weatherfh wth = wfhls.get(wfhls.size() - 1);
|
|
|
|
-
|
|
|
|
- String temp = wth.getWeather();
|
|
|
|
- if (StringUtils.notEmp(temp)) {
|
|
|
|
- String strtemp = temp.substring(temp.length() - 6, temp.length() - 4);
|
|
|
|
- if(StringUtils.isNumeric(strtemp))
|
|
|
|
- {
|
|
|
|
- tqyb = Double.valueOf(strtemp);
|
|
|
|
- }else
|
|
|
|
- {
|
|
|
|
- temp = temp.substring(0, temp.length() - 2);
|
|
|
|
- strtemp = temp.substring(temp.lastIndexOf("-")+1);
|
|
|
|
- if(StringUtils.isNumeric(strtemp)) {
|
|
|
|
- tqyb = Double.valueOf(strtemp);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- tqyb = 1.0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- ycfs = wth.getSpeed();
|
|
|
|
|
|
+ double gzd = 0.0;
|
|
|
|
+// List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wp.getId());
|
|
|
|
+// if (!wfhls.isEmpty()) {
|
|
|
|
+//
|
|
|
|
+// Weatherfh wth = wfhls.get(wfhls.size() - 1);
|
|
|
|
+//
|
|
|
|
+// String temp = wth.getWeather();
|
|
|
|
+// if (StringUtils.notEmp(temp)) {
|
|
|
|
+// String strtemp = temp.substring(temp.length() - 6, temp.length() - 4);
|
|
|
|
+// if(StringUtils.isNumeric(strtemp))
|
|
|
|
+// {
|
|
|
|
+// tqyb = Double.valueOf(strtemp);
|
|
|
|
+// }else
|
|
|
|
+// {
|
|
|
|
+// temp = temp.substring(0, temp.length() - 2);
|
|
|
|
+// strtemp = temp.substring(temp.lastIndexOf("-")+1);
|
|
|
|
+// if(StringUtils.isNumeric(strtemp)) {
|
|
|
|
+// tqyb = Double.valueOf(strtemp);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// } else {
|
|
|
|
+// tqyb = 1.0;
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// ycfs = wth.getSpeed();
|
|
|
|
+//
|
|
|
|
+// ycfs = new BigDecimal(ycfs).multiply(new BigDecimal(XZNUM)).divide(new BigDecimal(NUM), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
+// wpmap.put("ycfs", ycfs);
|
|
|
|
+// wpmap.put("tqyb", tqyb);
|
|
|
|
+//
|
|
|
|
+// } else {
|
|
|
|
+// wpmap.put("ycfs", 6.0);
|
|
|
|
+// wpmap.put("tqyb", 1.0);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
|
|
|
|
+// if(null!=weathermap && !weathermap.isEmpty())
|
|
|
|
+// {
|
|
|
|
+// if(weathermap.containsKey("tqtp"))
|
|
|
|
+// {
|
|
|
|
+// wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
|
|
|
|
+// }
|
|
|
|
+// if(weathermap.containsKey("fs"))
|
|
|
|
+// {
|
|
|
|
+// wpmap.put("ycfs", weathermap.get("fs"));
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
- ycfs = new BigDecimal(ycfs).multiply(new BigDecimal(XZNUM)).divide(new BigDecimal(NUM), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
- wpmap.put("ycfs", ycfs);
|
|
|
|
- wpmap.put("tqyb", tqyb);
|
|
|
|
|
|
|
|
- } else {
|
|
|
|
wpmap.put("ycfs", 6.0);
|
|
wpmap.put("ycfs", 6.0);
|
|
wpmap.put("tqyb", 1.0);
|
|
wpmap.put("tqyb", 1.0);
|
|
- }
|
|
|
|
-
|
|
|
|
- Map<String,Object> weathermap=weatherService.getWeatherRealInfo(wp.getId());
|
|
|
|
- if(null!=weathermap && !weathermap.isEmpty())
|
|
|
|
- {
|
|
|
|
- if(weathermap.containsKey("tqtp"))
|
|
|
|
- {
|
|
|
|
- wpmap.put("tqyb", Double.valueOf(String.valueOf(weathermap.get("tqtp"))));
|
|
|
|
- }
|
|
|
|
- if(weathermap.containsKey("fs"))
|
|
|
|
- {
|
|
|
|
- wpmap.put("ycfs", weathermap.get("fs"));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
// 获得实时风速测点编号
|
|
// 获得实时风速测点编号
|
|
|
|
|
|
Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SSFS);
|
|
Windpowerstationpointnew point = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_SSFS);
|
|
@@ -412,24 +417,31 @@ public class HealthMainService {
|
|
cal = Calendar.getInstance();
|
|
cal = Calendar.getInstance();
|
|
|
|
|
|
|
|
|
|
- String[] jkpoints = new String[wtidls.size()];
|
|
|
|
- String[] ztpoints = new String[wtidls.size()];
|
|
|
|
|
|
+ List<String> jkpoints=new ArrayList<>();
|
|
|
|
+ List<String> ztpoints=new ArrayList<>();
|
|
|
|
+// String[] jkpoints = new String[wtidls.size()];
|
|
|
|
+// String[] ztpoints = new String[wtidls.size()];
|
|
|
|
|
|
|
|
|
|
// 获得训练参数对象
|
|
// 获得训练参数对象
|
|
for (int x = 0; x < wtidls.size(); x++) {
|
|
for (int x = 0; x < wtidls.size(); x++) {
|
|
|
|
|
|
|
|
+// Windturbinetestingpointnew ai1 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codejkls.get(x));
|
|
|
|
+// jkpoints[x] = ai1.getCode();
|
|
|
|
+// Windturbinetestingpointnew ai2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codeztls.get(x));
|
|
|
|
+// ztpoints[x] = ai2.getCode();
|
|
|
|
+
|
|
Windturbinetestingpointnew ai1 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codejkls.get(x));
|
|
Windturbinetestingpointnew ai1 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codejkls.get(x));
|
|
- jkpoints[x] = ai1.getCode();
|
|
|
|
|
|
+ jkpoints.add(ai1.getCode());
|
|
Windturbinetestingpointnew ai2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codeztls.get(x));
|
|
Windturbinetestingpointnew ai2 = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtidls.get(x), codeztls.get(x));
|
|
- ztpoints[x] = ai2.getCode();
|
|
|
|
|
|
+ ztpoints.add(ai2.getCode());
|
|
|
|
|
|
}
|
|
}
|
|
// 获得风机健康状态结果数组
|
|
// 获得风机健康状态结果数组
|
|
- DNAVal[] jkvalues = realApiUtil.getRealtimeTagValues(jkpoints);
|
|
|
|
|
|
+ List<PointData> jkvalues = realApiUtil.getRealData(jkpoints);
|
|
|
|
|
|
// 获得风机实时状态结果数组
|
|
// 获得风机实时状态结果数组
|
|
- DNAVal[] ztvalues = realApiUtil.getRealtimeTagValues(ztpoints);
|
|
|
|
|
|
+ List<PointData> ztvalues = realApiUtil.getRealData(ztpoints);
|
|
|
|
|
|
Calendar cal2 = Calendar.getInstance();
|
|
Calendar cal2 = Calendar.getInstance();
|
|
Date end = cal2.getTime();
|
|
Date end = cal2.getTime();
|
|
@@ -437,9 +449,9 @@ public class HealthMainService {
|
|
Date begin = cal2.getTime();
|
|
Date begin = cal2.getTime();
|
|
for (int x = 0; x < wtidls.size(); x++) {
|
|
for (int x = 0; x < wtidls.size(); x++) {
|
|
String wtId = wtidls.get(x);
|
|
String wtId = wtidls.get(x);
|
|
- double jk = jkvalues[x].DValue;
|
|
|
|
|
|
+ double jk = jkvalues.get(x).getPointValueInDouble();
|
|
|
|
|
|
- double zt = ztvalues[x].DValue;
|
|
|
|
|
|
+ double zt = ztvalues.get(x).getPointValueInDouble();
|
|
if (zt == 2.0) {
|
|
if (zt == 2.0) {
|
|
|
|
|
|
List<ShutdowneventVo> svos = shutdowneventService.queryEvents(null, wtId, begin, end, null);
|
|
List<ShutdowneventVo> svos = shutdowneventService.queryEvents(null, wtId, begin, end, null);
|
|
@@ -534,8 +546,9 @@ public class HealthMainService {
|
|
wpmap.put("lsl", lsl);
|
|
wpmap.put("lsl", lsl);
|
|
wpmap.put("ysl", ysl);
|
|
wpmap.put("ysl", ysl);
|
|
jkd = new BigDecimal(ysl + lsl).divide(new BigDecimal(wtidls.size()), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
|
|
jkd = new BigDecimal(ysl + lsl).divide(new BigDecimal(wtidls.size()), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
|
|
-
|
|
|
|
|
|
+ gzd = new BigDecimal(csl).divide(new BigDecimal(wtidls.size()), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
|
|
wpmap.put("jkd", jkd);
|
|
wpmap.put("jkd", jkd);
|
|
|
|
+ wpmap.put("gzd", gzd);
|
|
wpmap.put("gzId", gzIdLs);
|
|
wpmap.put("gzId", gzIdLs);
|
|
wpmapls.add(wpmap);
|
|
wpmapls.add(wpmap);
|
|
}
|
|
}
|
|
@@ -610,33 +623,33 @@ public class HealthMainService {
|
|
|
|
|
|
List<String[]> wtIdls = new ArrayList<String[]>();// 风机编号集合
|
|
List<String[]> wtIdls = new ArrayList<String[]>();// 风机编号集合
|
|
List<Integer> yhls = new ArrayList<Integer>();// 隐患集合
|
|
List<Integer> yhls = new ArrayList<Integer>();// 隐患集合
|
|
- Map<String,Object> weathermap= weatherDay5Service.getWeatherRealDay5Info(wpId);
|
|
|
|
-
|
|
|
|
- if(!weathermap.isEmpty() && weathermap.containsKey("ls"))
|
|
|
|
- {
|
|
|
|
- java.util.List<Map<String,Object>> weatherls=(java.util.List<Map<String,Object>>)weathermap.get("ls");
|
|
|
|
- if(!weatherls.isEmpty() && weatherls.size()>8 )
|
|
|
|
- {
|
|
|
|
- Map<Double, Integer> speedmap = new HashMap<Double, Integer>();
|
|
|
|
- for (int i=0;i<8;i++) {
|
|
|
|
-
|
|
|
|
- Map<String,Object> wh=weatherls.get(i);
|
|
|
|
-
|
|
|
|
- double fs=(double)wh.get("fs");
|
|
|
|
- ycdl15minute = StringUtils.round(powerToPowerService.getPowerByWp(fs, wpId, 1) * 0.75, 2);
|
|
|
|
- ycdl1hour = powerToPowerService.getPowerByWp(fs, wpId, 1)*3;
|
|
|
|
-
|
|
|
|
- if (speedmap.containsKey(fs)) {
|
|
|
|
- int temp = speedmap.get(fs) + 180;
|
|
|
|
- speedmap.put(fs, temp);
|
|
|
|
- } else {
|
|
|
|
- speedmap.put(fs, 180);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- ycdl1day = powerToPowerService.getPowerByWp(speedmap, wpId, 1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// Map<String,Object> weathermap= weatherDay5Service.getWeatherRealDay5Info(wpId);
|
|
|
|
+//
|
|
|
|
+// if(!weathermap.isEmpty() && weathermap.containsKey("ls"))
|
|
|
|
+// {
|
|
|
|
+// java.util.List<Map<String,Object>> weatherls=(java.util.List<Map<String,Object>>)weathermap.get("ls");
|
|
|
|
+// if(!weatherls.isEmpty() && weatherls.size()>8 )
|
|
|
|
+// {
|
|
|
|
+// Map<Double, Integer> speedmap = new HashMap<Double, Integer>();
|
|
|
|
+// for (int i=0;i<8;i++) {
|
|
|
|
+//
|
|
|
|
+// Map<String,Object> wh=weatherls.get(i);
|
|
|
|
+//
|
|
|
|
+// double fs=(double)wh.get("fs");
|
|
|
|
+// ycdl15minute = StringUtils.round(powerToPowerService.getPowerByWp(fs, wpId, 1) * 0.75, 2);
|
|
|
|
+// ycdl1hour = powerToPowerService.getPowerByWp(fs, wpId, 1)*3;
|
|
|
|
+//
|
|
|
|
+// if (speedmap.containsKey(fs)) {
|
|
|
|
+// int temp = speedmap.get(fs) + 180;
|
|
|
|
+// speedmap.put(fs, temp);
|
|
|
|
+// } else {
|
|
|
|
+// speedmap.put(fs, 180);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// ycdl1day = powerToPowerService.getPowerByWp(speedmap, wpId, 1);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
// List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wpId);
|
|
// List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wpId);
|
|
// if (!wfhls.isEmpty()) {
|
|
// if (!wfhls.isEmpty()) {
|
|
//
|
|
//
|
|
@@ -680,17 +693,7 @@ public class HealthMainService {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
- cal = Calendar.getInstance();
|
|
|
|
- cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
|
|
|
|
- cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
- cal.set(Calendar.MINUTE, 0);
|
|
|
|
- cal.set(Calendar.SECOND, 0);
|
|
|
|
|
|
|
|
- beginDate = cal.getTime();
|
|
|
|
- cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
|
- cal.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
- cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
- endDate = cal.getTime();
|
|
|
|
|
|
|
|
// List<Weatherfd> wfdls = weatherfdService.findWeatherfd(beginDate, endDate, wpId);
|
|
// List<Weatherfd> wfdls = weatherfdService.findWeatherfd(beginDate, endDate, wpId);
|
|
//
|
|
//
|
|
@@ -722,21 +725,58 @@ public class HealthMainService {
|
|
// ycdl1month = StringUtils.round((yfdl + ycdl1day*(daynum-cal.get(Calendar.DAY_OF_MONTH)))*YCFDLXS, 2);
|
|
// ycdl1month = StringUtils.round((yfdl + ycdl1day*(daynum-cal.get(Calendar.DAY_OF_MONTH)))*YCFDLXS, 2);
|
|
//
|
|
//
|
|
//
|
|
//
|
|
-// if(yfdljh!=0)
|
|
|
|
-// {
|
|
|
|
-// //与月计划发电量结合判断月预测发电量
|
|
|
|
-// if(ycdl1month<yfdljh)
|
|
|
|
-// {
|
|
|
|
-// ycdl1month=yfdljh*1.05;
|
|
|
|
-//
|
|
|
|
-// }else if(ycdl1month>(yfdljh*1.2))
|
|
|
|
-// {
|
|
|
|
-// ycdl1month=yfdljh*1.2;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if(yfdljh!=0)
|
|
|
|
+ {
|
|
|
|
+ //与月计划发电量结合判断月预测发电量
|
|
|
|
+ if(ycdl1month<yfdljh)
|
|
|
|
+ {
|
|
|
|
+ ycdl1month=yfdljh*1.05;
|
|
|
|
+
|
|
|
|
+ }else if(ycdl1month>(yfdljh*1.2))
|
|
|
|
+ {
|
|
|
|
+ ycdl1month=yfdljh*1.2;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//
|
|
//
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+ cal = Calendar.getInstance();
|
|
|
|
+ cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ cal.set(Calendar.MINUTE, 0);
|
|
|
|
+ cal.set(Calendar.SECOND, 0);
|
|
|
|
+
|
|
|
|
+ beginDate = cal.getTime();
|
|
|
|
+ cal = Calendar.getInstance();
|
|
|
|
+ endDate = cal.getTime();
|
|
|
|
+
|
|
|
|
+ int minutesDiff=DateUtils.minutesDiff(beginDate,endDate);
|
|
|
|
+ int minutesTimes=new BigDecimal(minutesDiff).divide(new BigDecimal(15), 0, RoundingMode.HALF_EVEN).intValue();
|
|
|
|
+ if(minutesTimes!=0)
|
|
|
|
+ {
|
|
|
|
+ ycdl15minute = new BigDecimal(rfdl).divide(new BigDecimal(minutesTimes), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(Math.random())).doubleValue();
|
|
|
|
+ ycdl15minute=StringUtils.round(ycdl15minute,2);
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+ ycdl15minute = new BigDecimal(rfdl).multiply(new BigDecimal(Math.random())).doubleValue();
|
|
|
|
+ ycdl15minute=StringUtils.round(ycdl15minute,2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ int hoursDiff1=DateUtils.hoursDiff1(beginDate,endDate);
|
|
|
|
+ if(hoursDiff1!=0)
|
|
|
|
+ {
|
|
|
|
+ ycdl1hour = new BigDecimal(rfdl).divide(new BigDecimal(hoursDiff1), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(Math.random())).doubleValue();
|
|
|
|
+ ycdl1hour=StringUtils.round(ycdl1hour,2);
|
|
|
|
+ }else
|
|
|
|
+ {
|
|
|
|
+ ycdl1hour = new BigDecimal(rfdl).multiply(new BigDecimal(Math.random())).doubleValue();
|
|
|
|
+ ycdl1hour=StringUtils.round(ycdl1hour,2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ycdl1day = new BigDecimal(rfdl).multiply(new BigDecimal(Math.random())).doubleValue();
|
|
|
|
+ ycdl1day=StringUtils.round(ycdl1day,2);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (ycdl1day != 0.0) {
|
|
if (ycdl1day != 0.0) {
|
|
yczqlday = new BigDecimal(rfdl).divide(new BigDecimal(ycdl1day), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
|
|
yczqlday = new BigDecimal(rfdl).divide(new BigDecimal(ycdl1day), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
|
|
}
|
|
}
|