|
@@ -76,6 +76,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
//计算完整性
|
|
//计算完整性
|
|
List<Entity> entities = prophaseWeatherDataService.selectCount(equipmentId);
|
|
List<Entity> entities = prophaseWeatherDataService.selectCount(equipmentId);
|
|
|
|
|
|
|
|
+ log.info("设备:{} 生成报告,数据查询完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
for (Entity entity : entities) {
|
|
for (Entity entity : entities) {
|
|
//过滤非时间区间的数据累加;只要时间范围内的
|
|
//过滤非时间区间的数据累加;只要时间范围内的
|
|
if (((Timestamp) entity.get("_wstart")).compareTo(startDay) > -1 && ((Timestamp) entity.get("_wstart")).compareTo(endDay) <= 0) {
|
|
if (((Timestamp) entity.get("_wstart")).compareTo(startDay) > -1 && ((Timestamp) entity.get("_wstart")).compareTo(endDay) <= 0) {
|
|
@@ -85,57 +86,83 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
}
|
|
}
|
|
//按照设备编号分组
|
|
//按照设备编号分组
|
|
Map<String, List<WindTowerCalculationData>> weatherCollectMonthMap = windTowerCalculationDatas.stream().collect(Collectors.groupingBy(x -> x.getEbId()));
|
|
Map<String, List<WindTowerCalculationData>> weatherCollectMonthMap = windTowerCalculationDatas.stream().collect(Collectors.groupingBy(x -> x.getEbId()));
|
|
|
|
+ //如果查询月份等于当前时间月份就拿数据库最后一天数据的时间作为结束时间
|
|
|
|
+ if (endDay.getMonth() == new Date().getMonth()) {
|
|
|
|
+ List<Entity> lastData = prophaseWeatherDataService.getLastData(windTowerInfos.get(0).getEquipmentNo());
|
|
|
|
+ Timestamp timestamp = new Timestamp(new Date().getTime());
|
|
|
|
+ if (lastData != null && lastData.size() > 0) {
|
|
|
|
+ timestamp = (Timestamp) lastData.get(0).get("last (ts)");
|
|
|
|
+ }
|
|
|
|
+ endDay = new Date(timestamp.getTime());
|
|
|
|
+ }
|
|
//测风塔信息概要
|
|
//测风塔信息概要
|
|
Map<String, Object> windTowerInfo = getWindTowerInfo(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, height, realityCount, startDay, endDay);
|
|
Map<String, Object> windTowerInfo = getWindTowerInfo(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, height, realityCount, startDay, endDay);
|
|
map.put("windTowerInfo", windTowerInfo);
|
|
map.put("windTowerInfo", windTowerInfo);
|
|
|
|
+ log.info("设备:{} 生成报告,测风塔信息概要 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//测风塔统计概要概要
|
|
//测风塔统计概要概要
|
|
Map<String, Object> statisticsData = statisticsWindTowerStatusData(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, realityCount, startDay, endDay);
|
|
Map<String, Object> statisticsData = statisticsWindTowerStatusData(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, realityCount, startDay, endDay);
|
|
map.put("statisticsData", statisticsData);
|
|
map.put("statisticsData", statisticsData);
|
|
|
|
+ log.info("设备:{} 生成报告,测风塔统计概要概要 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风功率密度时间曲线图 (时间序列)
|
|
//风速和风功率密度时间曲线图 (时间序列)
|
|
Map<String, Object> wsAndWpd = getWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
Map<String, Object> wsAndWpd = getWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
map.put("wsAndWpd", wsAndWpd);
|
|
map.put("wsAndWpd", wsAndWpd);
|
|
|
|
+ log.info("设备:{} 生成报告,风速和风功率密度时间曲线图 (时间序列) 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风速标准差时间曲线图
|
|
//风速和风速标准差时间曲线图
|
|
Map<String, Object> wsAndWsStaData = wsAndWsSta(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
Map<String, Object> wsAndWsStaData = wsAndWsSta(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
map.put("wsAndWsStaData", wsAndWsStaData);
|
|
map.put("wsAndWsStaData", wsAndWsStaData);
|
|
|
|
+ log.info("设备:{} 生成报告,风速和风速标准差时间曲线图 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风速密度日变化
|
|
//风速和风速密度日变化
|
|
Map<String, Object> windPowerDensityAndAverageWindSpeed = getWindPowerDensityAndAverageWindSpeed(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, height);
|
|
Map<String, Object> windPowerDensityAndAverageWindSpeed = getWindPowerDensityAndAverageWindSpeed(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, height);
|
|
map.put("windPowerDensityAndAverageWindSpeed", windPowerDensityAndAverageWindSpeed);
|
|
map.put("windPowerDensityAndAverageWindSpeed", windPowerDensityAndAverageWindSpeed);
|
|
|
|
+ log.info("设备:{} 生成报告,速和风速密度日变化 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风速密度各月日变化
|
|
//风速和风速密度各月日变化
|
|
List<Map<String, Object>> MonthWsAndWpd = getMonthWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
List<Map<String, Object>> MonthWsAndWpd = getMonthWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
map.put("MonthWsAndWpd", MonthWsAndWpd);
|
|
map.put("MonthWsAndWpd", MonthWsAndWpd);
|
|
|
|
+ log.info("设备:{} 生成报告,风速和风速密度各月日变化 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风速密度年变化曲线
|
|
//风速和风速密度年变化曲线
|
|
Map<String, Object> yearWsAndWpd = getYearWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
Map<String, Object> yearWsAndWpd = getYearWsAndWpd(weatherCollectMonthMap, equipmentAttributeMap, height, startDay, endDay);
|
|
map.put("yearWsAndWpd", yearWsAndWpd);
|
|
map.put("yearWsAndWpd", yearWsAndWpd);
|
|
|
|
+ log.info("设备:{} 生成报告,风速和风速密度年变化曲线 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风速和风速密度各月日变化表格
|
|
//风速和风速密度各月日变化表格
|
|
Map<String, Object> monthWpdTable = getMonthWpdTable(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, startDay, endDay);
|
|
Map<String, Object> monthWpdTable = getMonthWpdTable(weatherCollectMonthMap, equipmentAttributeMap, windTowerInfos, startDay, endDay);
|
|
map.put("monthWpdTable", monthWpdTable);
|
|
map.put("monthWpdTable", monthWpdTable);
|
|
|
|
+ log.info("设备:{} 生成报告,风速和风速密度各月日变化表格 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//pdf威布尔
|
|
//pdf威布尔
|
|
Map<String, Object> weibull = pdfWeibull(equipmentAttributeMap, equipmentId, weatherCollectMonthMap, height);
|
|
Map<String, Object> weibull = pdfWeibull(equipmentAttributeMap, equipmentId, weatherCollectMonthMap, height);
|
|
map.put("weibull", weibull);
|
|
map.put("weibull", weibull);
|
|
|
|
+ log.info("设备:{} 生成报告,pdf威布尔 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//一年玫瑰图
|
|
//一年玫瑰图
|
|
Map<String, Object> roseChart = roseCharts(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
Map<String, Object> roseChart = roseCharts(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
map.put("roseChart", roseChart);
|
|
map.put("roseChart", roseChart);
|
|
|
|
+ log.info("设备:{} 生成报告,一年玫瑰图 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//各月玫瑰图
|
|
//各月玫瑰图
|
|
Map<String, Object> monthRoseCharts = getMonthRoseCharts(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
Map<String, Object> monthRoseCharts = getMonthRoseCharts(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
map.put("monthRoseCharts", monthRoseCharts);
|
|
map.put("monthRoseCharts", monthRoseCharts);
|
|
|
|
+ log.info("设备:{} 生成报告,各月玫瑰图 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//空气密度
|
|
//空气密度
|
|
Map<String, Object> airDensity = getAirDensity(weatherCollectMonthMap, equipmentAttributeMap, startDay, endDay);
|
|
Map<String, Object> airDensity = getAirDensity(weatherCollectMonthMap, equipmentAttributeMap, startDay, endDay);
|
|
map.put("airDensity", airDensity);
|
|
map.put("airDensity", airDensity);
|
|
|
|
+ log.info("设备:{} 生成报告,空气密度 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//获取风切变指数(风向玫瑰图)
|
|
//获取风切变指数(风向玫瑰图)
|
|
List<Map<String, Object>> windShearRose = getWindShearRose(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
List<Map<String, Object>> windShearRose = getWindShearRose(windDirectionStatisticsDataList, equipmentAttributeMap, height);
|
|
map.put("windShearRose", windShearRose);
|
|
map.put("windShearRose", windShearRose);
|
|
|
|
+ log.info("设备:{} 生成报告,获取风切变指数(风向玫瑰图) 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//风切变日/年变化
|
|
//风切变日/年变化
|
|
Map<String, Object> windShear = getWindShear(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
Map<String, Object> windShear = getWindShear(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
map.put("windShear", windShear);
|
|
map.put("windShear", windShear);
|
|
|
|
+ log.info("设备:{} 生成报告,风切变日/年变化 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//湍流曲线
|
|
//湍流曲线
|
|
List<List<BigDecimal>> turIntensityCharts = getTurIntensityCharts(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
List<List<BigDecimal>> turIntensityCharts = getTurIntensityCharts(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
map.put("turIntensityCharts", turIntensityCharts);
|
|
map.put("turIntensityCharts", turIntensityCharts);
|
|
|
|
+ log.info("设备:{} 生成报告,湍流曲线 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//湍流日/年变化
|
|
//湍流日/年变化
|
|
Map<String, Object> turIntensity = getTurIntensity(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
Map<String, Object> turIntensity = getTurIntensity(weatherCollectMonthMap, equipmentAttributeMap, height);
|
|
map.put("turIntensity", turIntensity);
|
|
map.put("turIntensity", turIntensity);
|
|
|
|
+ log.info("设备:{} 生成报告,湍流日/年变化 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
//获取湍流(风向玫瑰图)
|
|
//获取湍流(风向玫瑰图)
|
|
Map<String, Object> turIntensityRose = getTurIntensityRose(windDirectionStatisticsDataList, equipmentAttributeMap, windTowerInfos.get(0), height);
|
|
Map<String, Object> turIntensityRose = getTurIntensityRose(windDirectionStatisticsDataList, equipmentAttributeMap, windTowerInfos.get(0), height);
|
|
map.put("turIntensityRose", turIntensityRose);
|
|
map.put("turIntensityRose", turIntensityRose);
|
|
|
|
+ log.info("设备:{} 生成报告,获取湍流(风向玫瑰图) 完成时间:{}", equipmentId, cn.hutool.core.date.DateUtil.now());
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -156,15 +183,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
/*数据记录信息*/
|
|
/*数据记录信息*/
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
- //如果查询月份等于当前时间月份就拿数据库最后一天数据的时间作为结束时间
|
|
|
|
- if (endDay.getMonth() == new Date().getMonth()) {
|
|
|
|
- List<Entity> lastData = prophaseWeatherDataService.getLastData(windTowerInfos.get(0).getEquipmentNo());
|
|
|
|
- Timestamp timestamp = new Timestamp(new Date().getTime());
|
|
|
|
- if (lastData != null && lastData.size() > 0) {
|
|
|
|
- timestamp = (Timestamp) lastData.get(0).get("last (ts)");
|
|
|
|
- }
|
|
|
|
- endDay = new Date(timestamp.getTime());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
Date dayLastTime = DateTimeUtil.getDayLastTime(endDay.getTime());
|
|
Date dayLastTime = DateTimeUtil.getDayLastTime(endDay.getTime());
|
|
long count = (dayLastTime.getTime() + 1000 - startDay.getTime()) / (86400000);
|
|
long count = (dayLastTime.getTime() + 1000 - startDay.getTime()) / (86400000);
|
|
long totalCount = count * 144;//时间范围内的总条数
|
|
long totalCount = count * 144;//时间范围内的总条数
|
|
@@ -218,15 +237,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
try {
|
|
try {
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
|
- //如果查询月份等于当前时间月份就拿数据库最后一天数据的时间作为结束时间
|
|
|
|
- if (endDay.getMonth() == new Date().getMonth()) {
|
|
|
|
- List<Entity> lastData = prophaseWeatherDataService.getLastData(windTowerInfos.get(0).getEquipmentNo());
|
|
|
|
- Timestamp timestamp = new Timestamp(new Date().getTime());
|
|
|
|
- if (lastData != null && lastData.size() > 0) {
|
|
|
|
- timestamp = (Timestamp) lastData.get(0).get("last (ts)");
|
|
|
|
- }
|
|
|
|
- endDay = new Date(timestamp.getTime());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
Date dayLastTime = DateTimeUtil.getDayLastTime(endDay.getTime());
|
|
Date dayLastTime = DateTimeUtil.getDayLastTime(endDay.getTime());
|
|
long count = (dayLastTime.getTime() + 1000 - startDay.getTime()) / (86400000);
|
|
long count = (dayLastTime.getTime() + 1000 - startDay.getTime()) / (86400000);
|
|
long totalCount = count * 144;//时间范围内的总条数
|
|
long totalCount = count * 144;//时间范围内的总条数
|
|
@@ -236,7 +247,6 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
heights = "10,30,50,60,70,80,90,100,110,120,140,150";
|
|
heights = "10,30,50,60,70,80,90,100,110,120,140,150";
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
String[] heightStrs = heights.split(",");
|
|
String[] heightStrs = heights.split(",");
|
|
for (String height : heightStrs) {
|
|
for (String height : heightStrs) {
|
|
|
|
|
|
@@ -333,12 +343,12 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
//做平均值
|
|
//做平均值
|
|
if (null != paMaxData && paMaxData.size() > 0) {
|
|
if (null != paMaxData && paMaxData.size() > 0) {
|
|
BigDecimal paMaxDataMax = paMaxData.stream().map(WindTowerCalculationData::getValue).max((x1, x2) -> x1.compareTo(x2)).get();
|
|
BigDecimal paMaxDataMax = paMaxData.stream().map(WindTowerCalculationData::getValue).max((x1, x2) -> x1.compareTo(x2)).get();
|
|
- BigDecimal paMaxDataMax1 = paMaxData.stream().max(Comparator.comparing(x -> x.getValue())).orElse(null).getValue();
|
|
|
|
|
|
+ // BigDecimal paMaxDataMax1 = paMaxData.stream().max(Comparator.comparing(x -> x.getValue())).orElse(null).getValue();
|
|
paMap.put("max", paMaxDataMax);
|
|
paMap.put("max", paMaxDataMax);
|
|
}
|
|
}
|
|
if (null != paMinData && paMinData.size() > 0) {
|
|
if (null != paMinData && paMinData.size() > 0) {
|
|
BigDecimal paMinDataMin = paMinData.stream().map(WindTowerCalculationData::getValue).min((x1, x2) -> x1.compareTo(x2)).get();
|
|
BigDecimal paMinDataMin = paMinData.stream().map(WindTowerCalculationData::getValue).min((x1, x2) -> x1.compareTo(x2)).get();
|
|
- BigDecimal paMinDataMin1 = paMaxData.stream().min(Comparator.comparing(x -> x.getValue())).orElse(null).getValue();
|
|
|
|
|
|
+ //BigDecimal paMinDataMin1 = paMaxData.stream().min(Comparator.comparing(x -> x.getValue())).orElse(null).getValue();
|
|
paMap.put("min", paMinDataMin);
|
|
paMap.put("min", paMinDataMin);
|
|
}
|
|
}
|
|
if (null != paAveData && paAveData.size() > 0) {
|
|
if (null != paAveData && paAveData.size() > 0) {
|
|
@@ -481,18 +491,26 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
String wsEbId = wsDayAtt.getId();
|
|
String wsEbId = wsDayAtt.getId();
|
|
-
|
|
|
|
|
|
+ List<WindTowerCalculationData> wsListValue = weatherCollectMonthMap.get(wsEbId);
|
|
|
|
+ Map<Date, List<WindTowerCalculationData>> windTowerCalculationDataMap = wsListValue.stream().collect(Collectors.groupingBy(x -> x.getTime()));
|
|
// 过滤一周数据
|
|
// 过滤一周数据
|
|
List<List<Object>> wsDataList = new ArrayList<>();
|
|
List<List<Object>> wsDataList = new ArrayList<>();
|
|
List<List<Object>> wpdDataList = new ArrayList<>();
|
|
List<List<Object>> wpdDataList = new ArrayList<>();
|
|
-
|
|
|
|
|
|
+ String wpdFieldName = height + "wpdDay";
|
|
|
|
+ EquipmentAttribute wpdMonthAtt = equipmentAttributeMap.get(wpdFieldName);
|
|
|
|
+ if (null == wpdMonthAtt) {
|
|
|
|
+ log.error("未查询到属性:{} ", wpdFieldName);
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+ String wpdEbId = wpdMonthAtt.getId();
|
|
|
|
+ List<WindTowerCalculationData> wpdListValue = weatherCollectMonthMap.get(wpdEbId);
|
|
|
|
+ Map<Date, List<WindTowerCalculationData>> wpdDataMap = wpdListValue.stream().collect(Collectors.groupingBy(x -> x.getTime()));
|
|
for (Long l = startDay.getTime(); l <= endDay.getTime(); l += 86400000L) {
|
|
for (Long l = startDay.getTime(); l <= endDay.getTime(); l += 86400000L) {
|
|
Date finalL = DateTimeUtil.getDayStartTime(l);
|
|
Date finalL = DateTimeUtil.getDayStartTime(l);
|
|
- List<WindTowerCalculationData> wsListValue = weatherCollectMonthMap.get(wsEbId);
|
|
|
|
if (null != wsListValue && wsListValue.size() > 0) {
|
|
if (null != wsListValue && wsListValue.size() > 0) {
|
|
- List<WindTowerCalculationData> wsList = wsListValue.stream().filter(w -> w.getTime().equals(finalL)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<WindTowerCalculationData> wsList = windTowerCalculationDataMap.get(finalL);
|
|
List<Object> list = new ArrayList<>();
|
|
List<Object> list = new ArrayList<>();
|
|
- if (!wsList.isEmpty()) {
|
|
|
|
|
|
+ if (null != wsList && !wsList.isEmpty()) {
|
|
list.add(sdf.format(wsList.get(0).getTime()));
|
|
list.add(sdf.format(wsList.get(0).getTime()));
|
|
list.add(wsList.get(0).getValue());
|
|
list.add(wsList.get(0).getValue());
|
|
wsDataList.add(list);
|
|
wsDataList.add(list);
|
|
@@ -502,18 +520,12 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
wsDataList.add(list);
|
|
wsDataList.add(list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String wpdFieldName = height + "wpdDay";
|
|
|
|
- EquipmentAttribute wpdMonthAtt = equipmentAttributeMap.get(wpdFieldName);
|
|
|
|
- if (null == wpdMonthAtt) {
|
|
|
|
- log.error("未查询到属性:{} ", wpdFieldName);
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
- String wpdEbId = wpdMonthAtt.getId();
|
|
|
|
- List<WindTowerCalculationData> wpdListValue = weatherCollectMonthMap.get(wpdEbId);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if (null != wpdListValue && wpdListValue.size() > 0) {
|
|
if (null != wpdListValue && wpdListValue.size() > 0) {
|
|
- List<WindTowerCalculationData> wpdList = wpdListValue.stream().filter(w -> w.getTime().equals(finalL)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<WindTowerCalculationData> wpdList = wpdDataMap.get(finalL);
|
|
List<Object> listWpd = new ArrayList<>();
|
|
List<Object> listWpd = new ArrayList<>();
|
|
- if (!wpdList.isEmpty()) {
|
|
|
|
|
|
+ if (null != wpdList && !wpdList.isEmpty()) {
|
|
listWpd.add(sdf.format(wpdList.get(0).getTime()));
|
|
listWpd.add(sdf.format(wpdList.get(0).getTime()));
|
|
listWpd.add(wpdList.get(0).getValue());
|
|
listWpd.add(wpdList.get(0).getValue());
|
|
wpdDataList.add(listWpd);
|
|
wpdDataList.add(listWpd);
|
|
@@ -555,6 +567,9 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
String wsEbId = wsEquipmentAttribute.getId();
|
|
String wsEbId = wsEquipmentAttribute.getId();
|
|
|
|
+ List<WindTowerCalculationData> wsListValue = weatherCollectMonthMap.get(wsEbId);
|
|
|
|
+ Map<Date, List<WindTowerCalculationData>> windTowerCalculationDataMap = wsListValue.stream().collect(Collectors.groupingBy(x -> x.getTime()));
|
|
|
|
+
|
|
//取出heigth层高的平均风速标差属性
|
|
//取出heigth层高的平均风速标差属性
|
|
EquipmentAttribute staEquipmentAttribute = equipmentAttributeMap.get(height + "staDay");
|
|
EquipmentAttribute staEquipmentAttribute = equipmentAttributeMap.get(height + "staDay");
|
|
if (null == staEquipmentAttribute) {
|
|
if (null == staEquipmentAttribute) {
|
|
@@ -562,16 +577,17 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
String staEbId = equipmentAttributeMap.get(height + "staDay").getId();
|
|
String staEbId = equipmentAttributeMap.get(height + "staDay").getId();
|
|
-
|
|
|
|
|
|
+ List<WindTowerCalculationData> wsStaListValue = weatherCollectMonthMap.get(staEbId);
|
|
|
|
+ Map<Date, List<WindTowerCalculationData>> wsStaListValueMap = wsListValue.stream().collect(Collectors.groupingBy(x -> x.getTime()));
|
|
List<List<Object>> wsDataList = new ArrayList<>();
|
|
List<List<Object>> wsDataList = new ArrayList<>();
|
|
List<List<Object>> wsStaDataList = new ArrayList<>();
|
|
List<List<Object>> wsStaDataList = new ArrayList<>();
|
|
for (Long l = startDay.getTime(); l <= endDay.getTime(); l += 86400000L) {
|
|
for (Long l = startDay.getTime(); l <= endDay.getTime(); l += 86400000L) {
|
|
Date finalL = DateTimeUtil.getDayStartTime(l);
|
|
Date finalL = DateTimeUtil.getDayStartTime(l);
|
|
- List<WindTowerCalculationData> wsListValue = weatherCollectMonthMap.get(wsEbId);
|
|
|
|
|
|
+
|
|
if (null != wsListValue && wsListValue.size() > 0) {
|
|
if (null != wsListValue && wsListValue.size() > 0) {
|
|
- List<WindTowerCalculationData> wsList = wsListValue.stream().filter(w -> w.getTime().equals(finalL)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<WindTowerCalculationData> wsList = windTowerCalculationDataMap.get(finalL);
|
|
List<Object> list = new ArrayList<>();
|
|
List<Object> list = new ArrayList<>();
|
|
- if (!wsList.isEmpty()) {
|
|
|
|
|
|
+ if (null != wsList && !wsList.isEmpty()) {
|
|
list.add(sdf.format(wsList.get(0).getTime()));
|
|
list.add(sdf.format(wsList.get(0).getTime()));
|
|
list.add(wsList.get(0).getValue());
|
|
list.add(wsList.get(0).getValue());
|
|
wsDataList.add(list);
|
|
wsDataList.add(list);
|
|
@@ -582,11 +598,11 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//计算风速标准差
|
|
//计算风速标准差
|
|
- List<WindTowerCalculationData> wsStaListValue = weatherCollectMonthMap.get(staEbId);
|
|
|
|
|
|
+
|
|
if (null != wsStaListValue && wsStaListValue.size() > 0) {
|
|
if (null != wsStaListValue && wsStaListValue.size() > 0) {
|
|
- List<WindTowerCalculationData> wsStaList = wsStaListValue.stream().filter(w -> w.getTime().equals(finalL)).collect(Collectors.toList());
|
|
|
|
|
|
+ List<WindTowerCalculationData> wsStaList = wsStaListValueMap.get(finalL);
|
|
List<Object> listSta = new ArrayList<>();
|
|
List<Object> listSta = new ArrayList<>();
|
|
- if (!wsStaList.isEmpty()) {
|
|
|
|
|
|
+ if (null != wsStaList && !wsStaList.isEmpty()) {
|
|
listSta.add(sdf.format(wsStaList.get(0).getTime()));
|
|
listSta.add(sdf.format(wsStaList.get(0).getTime()));
|
|
listSta.add(wsStaList.get(0).getValue());
|
|
listSta.add(wsStaList.get(0).getValue());
|
|
wsStaDataList.add(listSta);
|
|
wsStaDataList.add(listSta);
|
|
@@ -752,6 +768,9 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
}
|
|
}
|
|
|
|
|
|
List<Long> intervalTimeByMonth = DateTimeUtil.getIntervalTimeByMonth(startDay, endDay);
|
|
List<Long> intervalTimeByMonth = DateTimeUtil.getIntervalTimeByMonth(startDay, endDay);
|
|
|
|
+ Map<String, List<WindTowerCalculationData>> awsAllListMMMap = awsAllList.stream().collect(Collectors.groupingBy(x -> DateTimeUtil.getFormatDateStrForMonth(x.getTime().getTime())));
|
|
|
|
+ Map<String, List<WindTowerCalculationData>> wpdAllListMMMap = wpdAllList.stream().collect(Collectors.groupingBy(x -> DateTimeUtil.getFormatDateStrForMonth(x.getTime().getTime())));
|
|
|
|
+
|
|
for (int i = 1; i <= 12; i++) {
|
|
for (int i = 1; i <= 12; i++) {
|
|
//平均风速集合
|
|
//平均风速集合
|
|
List<WindTowerCalculationData> awsList = new ArrayList<>();
|
|
List<WindTowerCalculationData> awsList = new ArrayList<>();
|
|
@@ -761,19 +780,16 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
for (Long l : intervalTimeByMonth) {
|
|
for (Long l : intervalTimeByMonth) {
|
|
//判断月份是否相等
|
|
//判断月份是否相等
|
|
if (String.valueOf(i).equals(sdf.format(new Date(l)))) {
|
|
if (String.valueOf(i).equals(sdf.format(new Date(l)))) {
|
|
- Date monthStartTime = DateTimeUtil.beginOfMonth(new Date(l));
|
|
|
|
- Date monthendTime = DateTimeUtil.endOfMonth(new Date(l));
|
|
|
|
-
|
|
|
|
- awsList = awsAllList.stream().filter(w -> w.getTime().compareTo(monthStartTime) >= 0 && w.getTime().compareTo(monthendTime) < 0).collect(Collectors.toList());
|
|
|
|
- wpdList = wpdAllList.stream().filter(w -> w.getTime().compareTo(monthStartTime) >= 0 && w.getTime().compareTo(monthendTime) < 0).collect(Collectors.toList());
|
|
|
|
|
|
+ awsList = awsAllListMMMap.get(DateTimeUtil.getFormatDateStrForMonth(l));
|
|
|
|
+ wpdList = wpdAllListMMMap.get(DateTimeUtil.getFormatDateStrForMonth(l));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (!awsList.isEmpty()) {
|
|
|
|
|
|
+ if (null != awsList && !awsList.isEmpty()) {
|
|
dataMap.put("ws", CalculationUtil.getData24(awsList));
|
|
dataMap.put("ws", CalculationUtil.getData24(awsList));
|
|
} else {
|
|
} else {
|
|
dataMap.put("ws", nullList);
|
|
dataMap.put("ws", nullList);
|
|
}
|
|
}
|
|
- if (!wpdList.isEmpty()) {
|
|
|
|
|
|
+ if (null != wpdList && !wpdList.isEmpty()) {
|
|
dataMap.put("wpd", CalculationUtil.getData24(wpdList));
|
|
dataMap.put("wpd", CalculationUtil.getData24(wpdList));
|
|
} else {
|
|
} else {
|
|
dataMap.put("wpd", nullList);
|
|
dataMap.put("wpd", nullList);
|