|
@@ -1,5 +1,6 @@
|
|
|
package com.jiayue.biz.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.db.Entity;
|
|
@@ -96,6 +97,14 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
ArrayList<String> heightList = new ArrayList<>();
|
|
|
//循环层高
|
|
|
for (String height : heights) {
|
|
|
+ //毛武平 在2024年5月7日提出修改需求,项目2 相关的声雷达数据,首页满发小时数据显示100米层高计算结果
|
|
|
+ String xiangmu2WindTower = "202101034,202101047,202101055,202301008,202301016,202101029,202101009";
|
|
|
+ if(xiangmu2WindTower.contains(equipmentId)){
|
|
|
+ int heightTemp = Convert.toInt(height);
|
|
|
+ if(heightTemp>130){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取风速风功率的统计id
|
|
|
List<EquipmentAttribute> equipmentAttributeWpd = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "wpdMonth")).collect(Collectors.toList());
|
|
|
List<EquipmentAttribute> equipmentAttributeWs = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsMonth")).collect(Collectors.toList());
|
|
@@ -148,7 +157,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
Map<String, Long> startAndEnd = prophaseWeatherDataService.getDataTimeStartAndEnd(equipmentId);
|
|
|
|
|
|
if (beginTime.getTime() < startAndEnd.get("startTime")) {
|
|
|
- beginTime = new Date(startAndEnd.get("startTime"));
|
|
|
+ beginTime = DateUtil.parse(DateUtil.format(new Date(startAndEnd.get("startTime")),"yyyy-MM-dd 00:00:00"));
|
|
|
}
|
|
|
Date endTime = lastDataCalculation.getTime();
|
|
|
|
|
@@ -160,6 +169,14 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
ArrayList<String> timeList = new ArrayList();
|
|
|
boolean type = true;
|
|
|
for (String height : heights) {
|
|
|
+ //毛武平 在2024年5月7日提出修改需求,项目2 相关的声雷达数据,首页满发小时数据显示100米层高计算结果
|
|
|
+ String xiangmu2WindTower = "202101034,202101047,202101055,202301008,202301016,202101029,202101009";
|
|
|
+ if(xiangmu2WindTower.contains(equipmentId)){
|
|
|
+ int heightTemp = Convert.toInt(height);
|
|
|
+ if(heightTemp>130){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
List<EquipmentAttribute> equipmentAttributes = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(height + "awsDay")).collect(Collectors.toList());
|
|
|
|
|
|
ArrayList<Object> hList = new ArrayList();
|
|
@@ -183,50 +200,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
everyMap.put("chart", everyData);
|
|
|
everyMap.put("time", timeList);
|
|
|
|
|
|
-// List<ProphaseAnemometryData> mapList = new ArrayList<>();
|
|
|
-// if (!month.equals("")) {
|
|
|
-// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
|
|
-// try {
|
|
|
-// Date startDate = sdf.parse(month);
|
|
|
-// Date endDate = DateTimeUtil.endOfMonth(startDate);
|
|
|
-// mapList = prophaseAnemometryDataService.selectWsAve(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()));
|
|
|
-// mapList = prophaseAnemometryDataService.selectWsAve(equipmentId, new Timestamp(startTime.getTime()), timeEnd);
|
|
|
-//
|
|
|
-// }
|
|
|
-//// HashMap<String, Object> everyMap = new HashMap();
|
|
|
-// //获取风速层高
|
|
|
-// List<WindTowerInfo> windTowerInfos = windTowerInfoService.getByEquipmentNo(equipmentId);
|
|
|
-// String height = windTowerInfos.get(0).getHeights();
|
|
|
-// String[] heightAll = height.split(",");
|
|
|
-//
|
|
|
-// // 时间list
|
|
|
-//// ArrayList<String> timeList = new ArrayList();
|
|
|
-//// ArrayList<Object> everyData = new ArrayList<>();
|
|
|
-//
|
|
|
-// for (String h : heightAll) {
|
|
|
-// timeList = new ArrayList();
|
|
|
-// ArrayList<Object> hList = new ArrayList();
|
|
|
-// HashMap<String, Object> hMap = new HashMap();
|
|
|
-// //根据层高过滤时间和风速
|
|
|
-// TreeMap<Long, Float> heightForTimeAndWs = new TreeMap<>(mapList.stream().filter(p -> p.getLayerHeight().equals(h))
|
|
|
-// .collect(Collectors.toMap(prophaseAnemometryData -> prophaseAnemometryData != null ? prophaseAnemometryData.getTs().getTime() : null, prophaseAnemometryData1 -> prophaseAnemometryData1 != null ? prophaseAnemometryData1.getWsAve() : null)));
|
|
|
-// for (Map.Entry<Long, Float> entry : heightForTimeAndWs.entrySet()) {
|
|
|
-// String time = DateUtil.format(new Date(entry.getKey()), "yyyy-MM-dd HH:mm:ss");
|
|
|
-// timeList.add(time);
|
|
|
-// hList.add(entry.getValue());
|
|
|
-// }
|
|
|
-// hMap.put("height", h);
|
|
|
-// hMap.put("value", hList);
|
|
|
-// everyData.add(hMap);
|
|
|
-// }
|
|
|
|
|
|
|
|
|
return everyMap;
|
|
@@ -275,22 +248,6 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
StatisticsSituation statisticsSituation = statisticsSituations.get(0);
|
|
|
String[] split = statisticsSituation.getStartTimeAndEndTime().split(",");
|
|
|
info = info + "数据起止时间:" + sdf.format(new Date(Long.parseLong(split[0]))) + " - " + sdf.format(new Date(Long.parseLong(split[1])));
|
|
|
-// if (statisticsSituation.getWsAve140() != null)
|
|
|
-// info = info + ";140米风速:" + statisticsSituation.getWsAve140().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve120() != null)
|
|
|
-// info = info + ";120米风速:" + statisticsSituation.getWsAve120().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve100() != null)
|
|
|
-// info = info + ";100米风速:" + statisticsSituation.getWsAve100().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve80() != null)
|
|
|
-// info = info + ";80米风速:" + statisticsSituation.getWsAve80().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve70() != null)
|
|
|
-// info = info + ";70米风速:" + statisticsSituation.getWsAve70().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve50() != null)
|
|
|
-// info = info + ";50米风速:" + statisticsSituation.getWsAve50().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve30() != null)
|
|
|
-// info = info + ";30米风速:" + statisticsSituation.getWsAve30().setScale(2, RoundingMode.HALF_UP);
|
|
|
-// if (statisticsSituation.getWsAve10() != null)
|
|
|
-// info = info + ";10米风速:" + statisticsSituation.getWsAve10().setScale(2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
if (!maps.isEmpty()) {
|
|
|
defectCount = new BigDecimal(maps.get(0).get("num").toString()).subtract(new BigDecimal(144));
|
|
@@ -594,7 +551,7 @@ public class HomePageServiceImpl extends ServiceImpl<WindTowerDataParentTableMap
|
|
|
public BigDecimal getDataForCalculationByEb(List<EquipmentAttribute> equipmentAttributeList, List<WindTowerCalculationData> windTowerCalculationDataList, String fieldName) {
|
|
|
List<String> ebId = equipmentAttributeList.stream().filter(e -> e.getFieldName().equals(fieldName)).map(EquipmentAttribute::getId).collect(Collectors.toList());
|
|
|
|
|
|
- List<BigDecimal> dataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(ebId.get(0)) && w.getValue().doubleValue()>=0).map(WindTowerCalculationData::getValue).collect(Collectors.toList());
|
|
|
+ List<BigDecimal> dataList = windTowerCalculationDataList.stream().filter(w -> w.getEbId().equals(ebId.get(0))).map(WindTowerCalculationData::getValue).collect(Collectors.toList());
|
|
|
|
|
|
return dataList.size() > 0 ? CalculationUtil.getAvgWind(dataList) : BigDecimal.ZERO;
|
|
|
|