|
@@ -122,63 +122,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-// //风速数据
|
|
|
-// List<ProphaseAnemometryData> prophaseAnemometryDataList = new ArrayList<>();
|
|
|
-// //空气密度
|
|
|
-// List<ProphaseWeatherData> weatherDataList = new ArrayList<>();
|
|
|
-// if (!month.equals("")) {
|
|
|
-// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
-// try {
|
|
|
-// Date startDate = sdf.parse(month);
|
|
|
-// Date endDate = DateTimeUtil.endOfMonth(startDate);
|
|
|
-// prophaseAnemometryDataList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startDate.getTime()), new Timestamp(endDate.getTime()));
|
|
|
-// weatherDataList = prophaseWeatherDataService.selectAir(equipmentId, new Timestamp(startDate.getTime()), new Timestamp(endDate.getTime()));
|
|
|
-// } catch (ParseException e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// // 最新一天数据
|
|
|
-// List<Entity> lastData = prophaseWeatherDataService.getLastData(equipmentId);
|
|
|
-// Timestamp timeEnd = (Timestamp) lastData.get(0).get("last (ts)");
|
|
|
-// DateTime startTime = DateUtil.beginOfDay(new Date(timeEnd.getTime()));
|
|
|
-// prophaseAnemometryDataList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startTime.getTime()), timeEnd);
|
|
|
-// weatherDataList = prophaseWeatherDataService.selectAir(equipmentId, new Timestamp(startTime.getTime()), timeEnd);
|
|
|
-//
|
|
|
-// }
|
|
|
-// //时间和空气密度map
|
|
|
-// Map<Timestamp, Float> timeAndAirMap = weatherDataList.stream().collect(Collectors.toMap(ProphaseWeatherData::getTs, ProphaseWeatherData::getAirDensity));
|
|
|
-//
|
|
|
-//
|
|
|
-// for (String height : heights) {
|
|
|
-// //根据层高获取时间和风速map
|
|
|
-// Map<Timestamp, Float> timeAndWsMap = prophaseAnemometryDataList.stream().filter(p -> p.getLayerHeight().equals(height)).collect(Collectors.toMap(ProphaseAnemometryData::getTs, ProphaseAnemometryData::getWsAve));
|
|
|
-//
|
|
|
-// if (!timeAndWsMap.isEmpty() && !timeAndAirMap.isEmpty()) {
|
|
|
-// ArrayList<BigDecimal> wsSumList = new ArrayList<>();
|
|
|
-// ArrayList<BigDecimal> wpdSumList = new ArrayList<>();
|
|
|
-// //遍历空气密度
|
|
|
-// for (Map.Entry<Timestamp, Float> airAndTime : timeAndAirMap.entrySet()) {
|
|
|
-// //过滤风速map
|
|
|
-// Map<Timestamp, Float> map = timeAndWsMap.entrySet().stream().filter(t -> t.getKey().getTime() == airAndTime.getKey().getTime()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
|
|
-// if (!map.isEmpty()) {
|
|
|
-// BigDecimal wpdCalculate = CalculationUtil.getWpdCalculate(BigDecimal.valueOf(airAndTime.getValue()), BigDecimal.valueOf(map.get(airAndTime.getKey())));
|
|
|
-// wpdSumList.add(wpdCalculate);
|
|
|
-// wsSumList.add(BigDecimal.valueOf(map.get(airAndTime.getKey())));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (wsSumList.size() > 0) {
|
|
|
-// BigDecimal wpdAve = BigDecimal.valueOf(wsSumList.stream().collect(Collectors.averagingDouble(BigDecimal::doubleValue))).setScale(2, RoundingMode.HALF_UP);
|
|
|
-// wsList.add(wpdAve);
|
|
|
-// }
|
|
|
-// if (wpdSumList.size() > 0) {
|
|
|
-// BigDecimal wpdAve = BigDecimal.valueOf(wpdSumList.stream().collect(Collectors.averagingDouble(BigDecimal::doubleValue))).setScale(2, RoundingMode.HALF_UP);
|
|
|
-// wpdList.add(wpdAve);
|
|
|
-// }
|
|
|
-// heightList.add(height + "m");
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
dataMap.put("ws", wsList);
|
|
|
dataMap.put("wpd", wpdList);
|
|
|
dataMap.put("height", heightList);
|