|
|
|
|
@ -209,6 +209,7 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer
|
|
|
|
|
.filter(value -> "16".equals(value.getParamType()) && "5".equals(value.getMtType()) && value.getCurTime() != null) |
|
|
|
|
.filter(value -> DateUtils.isSameDay(new Date(), value.getCurTime())) |
|
|
|
|
.filter(value -> value.getGrade() == 40) |
|
|
|
|
.filter(value -> value.getTerminalDeviceType().equals("15")) |
|
|
|
|
.map(value -> value.getCurValue().subtract(value.getMtInitValue())) |
|
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
|
|
|
|
|
@ -219,6 +220,7 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer
|
|
|
|
|
.filter(value -> "16".equals(value.getParamType()) && "5".equals(value.getMtType()) && value.getCurTime() != null) |
|
|
|
|
.filter(value -> DateUtils.isSameDay(new Date(), value.getCurTime())) |
|
|
|
|
.filter(value -> value.getGrade() == 140) |
|
|
|
|
.filter(value -> value.getTerminalDeviceType().equals("15")) |
|
|
|
|
.map(CollectionParamsManage::getCurValue) |
|
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
|
|
|
|
|
|
@ -284,12 +286,12 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer
|
|
|
|
|
// 查询跟当前时间yyyy-MM-dd HH相同的数据
|
|
|
|
|
List<CollectionParamsManage> collectionParamsManages = collectionParamsManageMapper.selectList( |
|
|
|
|
new QueryWrapper<CollectionParamsManage>() |
|
|
|
|
.in("mt_num", Arrays.asList("DB200000", "DB200040")) |
|
|
|
|
.in("mt_num", Arrays.asList("DBB30", "DBB34")) |
|
|
|
|
.between("cur_time", startOfDay, endOfDay)); |
|
|
|
|
if (collectionParamsManages != null && !collectionParamsManages.isEmpty()) { |
|
|
|
|
|
|
|
|
|
// 遍历获取数据,其中mt_num为DB200000是室外温度,mt_num为DB200040是室外湿度
|
|
|
|
|
Optional<CollectionParamsManage> first = collectionParamsManages.stream().filter(value -> "DB200000".equals(value.getMtNum())).findFirst(); |
|
|
|
|
Optional<CollectionParamsManage> first = collectionParamsManages.stream().filter(value -> "DBB30".equals(value.getMtNum())).findFirst(); |
|
|
|
|
double temperature = 0.00; |
|
|
|
|
if (first.isPresent()) { |
|
|
|
|
// 室外温度
|
|
|
|
|
@ -297,13 +299,30 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer
|
|
|
|
|
result.putIfAbsent("temperature", first.get().getCurValue().setScale(1, RoundingMode.HALF_UP) + ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Optional<CollectionParamsManage> second = collectionParamsManages.stream().filter(value -> "DB200040".equals(value.getMtNum())).findFirst(); |
|
|
|
|
Optional<CollectionParamsManage> second = collectionParamsManages.stream().filter(value -> "DBB34".equals(value.getMtNum())).findFirst(); |
|
|
|
|
double humidity = 0.00; |
|
|
|
|
if (second.isPresent()) { |
|
|
|
|
// 室外湿度
|
|
|
|
|
humidity = second.get().getCurValue().doubleValue(); |
|
|
|
|
result.putIfAbsent("humidity", second.get().getCurValue().setScale(1, RoundingMode.HALF_UP) + ""); |
|
|
|
|
} |
|
|
|
|
// 判断温湿度是0,则取天气预报数据
|
|
|
|
|
if (temperature == 0.00 || humidity == 0.00) { |
|
|
|
|
// 获取天气预报数据
|
|
|
|
|
List<WeatherData> weatherData = weatherDataMapper.selectOneByReportTime(); |
|
|
|
|
if (weatherData != null && !weatherData.isEmpty()) { |
|
|
|
|
// 获取天气预报数据
|
|
|
|
|
WeatherData weatherData1 = weatherData.getFirst(); |
|
|
|
|
// 判断是否是今天的日期
|
|
|
|
|
if (DateUtils.isSameDay(weatherData1.getReportTime(), new Date())) { |
|
|
|
|
temperature = weatherData1.getTemperature().doubleValue(); |
|
|
|
|
result.put("temperature", weatherData1.getTemperature().doubleValue() + ""); |
|
|
|
|
humidity = weatherData1.getHumidity().doubleValue(); |
|
|
|
|
result.put("humidity", weatherData1.getHumidity().doubleValue() + ""); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
WeatherUtil weatherUtil = new WeatherUtil(); |
|
|
|
|
|
|
|
|
|
// 室外压力,采用标准大气压 101325 Pa
|
|
|
|
|
|