|
@@ -5,6 +5,7 @@ import com.gyee.frame.common.spring.InitialRunner;
|
|
import com.gyee.frame.model.auto.*;
|
|
import com.gyee.frame.model.auto.*;
|
|
import com.gyee.frame.model.custom.*;
|
|
import com.gyee.frame.model.custom.*;
|
|
import com.gyee.frame.service.*;
|
|
import com.gyee.frame.service.*;
|
|
|
|
+import com.gyee.frame.service.weather.WeatherDay5Service;
|
|
import com.gyee.frame.service.weather.WeatherService;
|
|
import com.gyee.frame.service.weather.WeatherService;
|
|
import com.gyee.frame.util.*;
|
|
import com.gyee.frame.util.*;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -29,7 +30,8 @@ public class HealthMainService {
|
|
private WindPowerstationTestingPointService windPowerstationTestingPointService;
|
|
private WindPowerstationTestingPointService windPowerstationTestingPointService;
|
|
@Resource
|
|
@Resource
|
|
private WeatherService weatherService;
|
|
private WeatherService weatherService;
|
|
-
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private WeatherDay5Service weatherDay5Service;
|
|
|
|
|
|
private final int digit = 2;
|
|
private final int digit = 2;
|
|
private final double NUM = 3.6;
|
|
private final double NUM = 3.6;
|
|
@@ -594,32 +596,58 @@ 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);
|
|
|
|
|
|
- List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wpId);
|
|
|
|
- if (!wfhls.isEmpty()) {
|
|
|
|
|
|
+ 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<Double, Integer> speedmap = new HashMap<Double, Integer>();
|
|
|
|
- for (Weatherfh wh : wfhls) {
|
|
|
|
- cal.setTime(wh.getRecodedata());
|
|
|
|
- int hourtemp = cal.get(Calendar.HOUR_OF_DAY);
|
|
|
|
- if (hourtemp == hour) {
|
|
|
|
- ycdl15minute = StringUtils.round(getPowerByWp(wh.getSpeed(), wpId, 1) * 0.25, 2);
|
|
|
|
- }
|
|
|
|
- if (hourtemp == hour + 1) {
|
|
|
|
- ycdl1hour = getPowerByWp(wh.getSpeed(), wpId, 1);
|
|
|
|
- }
|
|
|
|
|
|
+ Map<String,Object> wh=weatherls.get(i);
|
|
|
|
+
|
|
|
|
+ double fs=(double)wh.get("fs");
|
|
|
|
+ ycdl15minute = StringUtils.round(getPowerByWp(fs, wpId, 1) * 0.25, 2);
|
|
|
|
+ ycdl1hour = getPowerByWp(fs, wpId, 1);
|
|
|
|
|
|
- if (speedmap.containsKey(wh.getSpeed())) {
|
|
|
|
- int temp = speedmap.get(wh.getSpeed()) + 1;
|
|
|
|
- speedmap.put(wh.getSpeed(), temp);
|
|
|
|
|
|
+ if (speedmap.containsKey(fs)) {
|
|
|
|
+ int temp = speedmap.get(fs) + 1;
|
|
|
|
+ speedmap.put(fs, temp);
|
|
} else {
|
|
} else {
|
|
- speedmap.put(wh.getSpeed(), 1);
|
|
|
|
|
|
+ speedmap.put(fs, 1);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
ycdl1day = getPowerByWp(speedmap, wpId, 1);
|
|
ycdl1day = getPowerByWp(speedmap, wpId, 1);
|
|
-
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+// List<Weatherfh> wfhls = weatherfhService.findWeatherfh(beginDate, endDate, wpId);
|
|
|
|
+// if (!wfhls.isEmpty()) {
|
|
|
|
+//
|
|
|
|
+// Map<Double, Integer> speedmap = new HashMap<Double, Integer>();
|
|
|
|
+// for (Weatherfh wh : wfhls) {
|
|
|
|
+// cal.setTime(wh.getRecodedata());
|
|
|
|
+// int hourtemp = cal.get(Calendar.HOUR_OF_DAY);
|
|
|
|
+// if (hourtemp == hour) {
|
|
|
|
+// ycdl15minute = StringUtils.round(getPowerByWp(wh.getSpeed(), wpId, 1) * 0.25, 2);
|
|
|
|
+// }
|
|
|
|
+// if (hourtemp == hour + 1) {
|
|
|
|
+// ycdl1hour = getPowerByWp(wh.getSpeed(), wpId, 1);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// if (speedmap.containsKey(wh.getSpeed())) {
|
|
|
|
+// int temp = speedmap.get(wh.getSpeed()) + 1;
|
|
|
|
+// speedmap.put(wh.getSpeed(), temp);
|
|
|
|
+// } else {
|
|
|
|
+// speedmap.put(wh.getSpeed(), 1);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// ycdl1day = getPowerByWp(speedmap, wpId, 1);
|
|
|
|
+//
|
|
|
|
+// }
|
|
cal = Calendar.getInstance();
|
|
cal = Calendar.getInstance();
|
|
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
|
|
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
|
|
cal.set(Calendar.HOUR_OF_DAY, 0);
|
|
cal.set(Calendar.HOUR_OF_DAY, 0);
|