|
@@ -51,7 +51,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> generatePDF(String equipmentId, String height, Date startDay, Date endDay) {
|
|
|
+ public Map<String, Object> generatePDF(String equipmentId, Date startDay, Date endDay) {
|
|
|
//如果结束时间大于现在时间
|
|
|
if (DateUtil.date().getTime() < endDay.getTime()) {
|
|
|
//将结束时间设置为昨天结束时间
|
|
@@ -81,7 +81,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
ArrayList<Map<String, Object>> statisticsDataFen = statisticsWindTowerStatusDataFeng(windTowerCalculationDatas, equipmentAttributeList, windTowerInfos);
|
|
|
map.put("statisticsDataFen", statisticsDataFen);
|
|
|
//风速每月平均
|
|
|
- ArrayList<Map<String, Object>> statisticsWindTowerStatusDataFenMonth = statisticsWindTowerStatusDataFenMonth(windTowerCalculationDatas, equipmentAttributeList, windTowerInfos, startDay, endDay);
|
|
|
+ Map<String, Object> statisticsWindTowerStatusDataFenMonth = statisticsWindTowerStatusDataFenMonth(windTowerCalculationDatas, equipmentAttributeList, windTowerInfos, startDay, endDay);
|
|
|
map.put("statisticsWindTowerStatusDataFenMonth", statisticsWindTowerStatusDataFenMonth);
|
|
|
//风功率密度每月平均
|
|
|
ArrayList<Map<String, Object>> statisticsWindTowerStatusDataFenWpd = statisticsWindTowerStatusDataWpd(windTowerCalculationDatas, equipmentAttributeList, windTowerInfos);
|
|
@@ -164,7 +164,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
map.put("endTime", DateUtil.format(new Date(dataTimeStartAndEnd.get("endTime")), "yyyy-MM-dd"));
|
|
|
map.put("count", count.get(0).get("count(*)"));
|
|
|
map.put("allCount", allCount);
|
|
|
- map.put("percentage", percentage);
|
|
|
+ map.put("percentage", percentage.multiply(new BigDecimal(100)));
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
@@ -180,7 +180,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
public Map<String, Object> statisticsWindTowerStatusData(List<WindTowerCalculationData> windTowerCalculationDatas, List<EquipmentAttribute> equipmentAttributeList) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try {
|
|
|
- List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
+// List<Map<String, Object>> dataList = new ArrayList<>();
|
|
|
/*环境数据*/
|
|
|
//从数据库属性表里查出环境数据的属性
|
|
|
List<EquipmentAttribute> paMax = equipmentAttributeList.stream().filter(w -> w.getFieldName().equals("paMAX")).collect(Collectors.toList());
|
|
@@ -241,7 +241,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
environmentData.add(rhMap);
|
|
|
environmentData.add(tMap);
|
|
|
environmentData.add(airDensityMap);
|
|
|
- map.put("dataList", dataList);
|
|
|
+// map.put("dataList", dataList);
|
|
|
map.put("environment", environmentData);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@@ -292,10 +292,10 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
* @param equipmentAttributeList 属性数据
|
|
|
* @return
|
|
|
*/
|
|
|
- public ArrayList<Map<String, Object>> statisticsWindTowerStatusDataFenMonth(List<WindTowerCalculationData> windTowerCalculationDatas, List<EquipmentAttribute> equipmentAttributeList, List<WindTowerInfo> windTowerInfos, Date startDay, Date endDay) {
|
|
|
+ public Map<String, Object> statisticsWindTowerStatusDataFenMonth(List<WindTowerCalculationData> windTowerCalculationDatas, List<EquipmentAttribute> equipmentAttributeList, List<WindTowerInfo> windTowerInfos, Date startDay, Date endDay) {
|
|
|
+ Map<String, Object> objectMap = new HashMap<>();
|
|
|
ArrayList<Map<String, Object>> heightAndWsList = new ArrayList<>();
|
|
|
- HashMap<String, Object> timeMap = new HashMap<>();
|
|
|
- ArrayList<String> timeList = new ArrayList<>();
|
|
|
+ ArrayList<Map<String, Object>> timeList = new ArrayList<>();
|
|
|
String[] heights = windTowerInfos.get(0).getHeights().split(",");
|
|
|
int i = 0;
|
|
|
for (String height : heights) {
|
|
@@ -313,18 +313,21 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
if (wsDayList.size() > 0) {
|
|
|
wsAve = wsDayList.stream().map(WindTowerCalculationData::getValue).reduce(BigDecimal::add).get().divide(BigDecimal.valueOf(wsDayList.size()), 2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
- heightMap.put(DateUtil.format(startTime, "yyyy.M"), wsAve);
|
|
|
+ heightMap.put(DateUtil.format(startTime, "yyyyMM"), wsAve);
|
|
|
if (i == 0) {
|
|
|
- timeList.add(DateUtil.format(startTime, "yyyy.M"));
|
|
|
+ HashMap<String, Object> timeMap = new HashMap<>();
|
|
|
+ timeMap.put("value",DateUtil.format(startTime, "yyyyMM"));
|
|
|
+ timeMap.put("label",DateUtil.format(startTime, "yyyy.M"));
|
|
|
+ timeList.add(timeMap);
|
|
|
}
|
|
|
}
|
|
|
heightMap.put("height", height);
|
|
|
heightAndWsList.add(heightMap);
|
|
|
i++;
|
|
|
}
|
|
|
- timeMap.put("timeTable", timeList);
|
|
|
- heightAndWsList.add(timeMap);
|
|
|
- return heightAndWsList;
|
|
|
+ objectMap.put("timeTable", timeList);
|
|
|
+ objectMap.put("mainData",heightAndWsList);
|
|
|
+ return objectMap;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -350,13 +353,13 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
List<WindTowerCalculationData> dayList = windTowerCalculationDatas.stream().filter(w -> w.getEbId().equals(equipmentAttributes.get(0).getId())).collect(Collectors.toList());
|
|
|
if (dayList.size() > 0) {
|
|
|
wpdAve = dayList.stream().map(WindTowerCalculationData::getValue).reduce(BigDecimal::add).get().divide(BigDecimal.valueOf(dayList.size()), 2, RoundingMode.HALF_UP);
|
|
|
- wpdMax = dayList.stream().map(WindTowerCalculationData::getValue).min(BigDecimal::compareTo).get();
|
|
|
- wpdMin = dayList.stream().map(WindTowerCalculationData::getValue).max((x1, x2) -> x1.compareTo(x2)).get();
|
|
|
+// wpdMax = dayList.stream().map(WindTowerCalculationData::getValue).min(BigDecimal::compareTo).get();
|
|
|
+// wpdMin = dayList.stream().map(WindTowerCalculationData::getValue).max((x1, x2) -> x1.compareTo(x2)).get();
|
|
|
}
|
|
|
|
|
|
map.put("wpdAve", wpdAve);
|
|
|
- map.put("wpdMin", wpdMax);
|
|
|
- map.put("wpdMax", wpdMin);
|
|
|
+// map.put("wpdMin", wpdMax);
|
|
|
+// map.put("wpdMax", wpdMin);
|
|
|
map.put("height", height);
|
|
|
heightAndWpdList.add(map);
|
|
|
|
|
@@ -1148,7 +1151,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
proportionWd = BigDecimal.valueOf(filterWdList.size()).divide(BigDecimal.valueOf(wdList.size()), 2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
|
|
|
- wdMap.put(value.name(), proportionWd);
|
|
|
+ wdMap.put(value.name(), proportionWd.multiply(new BigDecimal(100)));
|
|
|
list.add(wdMap);
|
|
|
}
|
|
|
return list;
|
|
@@ -1177,7 +1180,7 @@ public class PdfServiceImpl extends ServiceImpl<WindTowerDataParentTableMapper,
|
|
|
if (sumPower.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
proportionPower = sumPowerForWd.divide(sumPower, 2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
- powerMap.put(value.name(), proportionPower);
|
|
|
+ powerMap.put(value.name(), proportionPower.multiply(new BigDecimal(100)));
|
|
|
list.add(powerMap);
|
|
|
}
|
|
|
return list;
|