From 53560f0d896a4ddccb9f52bf6e5da91cc2dc98e9 Mon Sep 17 00:00:00 2001 From: "3067418132@qq.com" Date: Wed, 15 Jul 2026 10:15:28 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=9D=E5=88=A9=E5=B1=B1=E5=BA=84?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=B5=84=E6=96=99=E9=85=8D=E7=BD=AE=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E7=9B=91=E8=A7=86=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-prod.yml | 19 ++++----- mh-admin/src/main/resources/application.yml | 2 +- mh-admin/src/main/resources/logback.xml | 2 +- .../impl/CoolingSystemMonitorServiceImpl.java | 41 ++++++++++++++++++- 4 files changed, 51 insertions(+), 13 deletions(-) diff --git a/mh-admin/src/main/resources/application-prod.yml b/mh-admin/src/main/resources/application-prod.yml index 3097f3e..f304c7c 100644 --- a/mh-admin/src/main/resources/application-prod.yml +++ b/mh-admin/src/main/resources/application-prod.yml @@ -1,13 +1,13 @@ # 项目相关配置 mh: # 名称 - name: bl_eems + name: blsz_eemcs # 版本 version: 1.0.0 # 版权年份 copyrightYear: 2026 # 文件路径 示例( Windows配置D:/mh/uploadPath,Linux配置 /home/mh/uploadPath) - profile: D:/mh_data/uploadPath + profile: E:/mh_data/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 @@ -63,7 +63,7 @@ spring: # 端口,默认为6379 port: 6379 # 数据库索引 - database: 1 + database: 13 # 密码 password: # 连接超时时间 @@ -82,9 +82,9 @@ spring: rabbitmq: host: 127.0.0.1 port: 5672 - username: eemcs + username: eemcs_blsz password: mh@803 - virtual-host: eems_bl + virtual-host: eemcs_blsz listener: direct: prefetch: 2 @@ -98,10 +98,9 @@ spring: # 主库数据源 master: #添加allowMultiQueries=true 在批量更新时才不会出错 - url: jdbc:postgresql://127.0.0.1:5232/bl_eems -# url: jdbc:postgresql://127.0.0.1:5505/eemcs - username: postgres - password: mhtech@803 + url: jdbc:postgresql://10.0.12.10:5505/eemcs_blsz + username: eemcs_blsz + password: mhtech@ratuo123 # 从库数据源 slave: # 从数据源开关/默认关闭 @@ -195,7 +194,7 @@ mqttSpring: protocol: MQTT host: mqtt.mhito.net port: 1883 - username: eemcs_gh_ers + username: eemcs_blsz_ers password: mhtech@ghers client-id: eemcs_gh_ers_mqtt_pro # If the protocol is ws/wss, this value is required. diff --git a/mh-admin/src/main/resources/application.yml b/mh-admin/src/main/resources/application.yml index 25d5789..9af6950 100644 --- a/mh-admin/src/main/resources/application.yml +++ b/mh-admin/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: dev + active: prod # 用户配置 user: diff --git a/mh-admin/src/main/resources/logback.xml b/mh-admin/src/main/resources/logback.xml index 5009b73..da50eb6 100644 --- a/mh-admin/src/main/resources/logback.xml +++ b/mh-admin/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + diff --git a/mh-system/src/main/java/com/mh/system/service/device/impl/CoolingSystemMonitorServiceImpl.java b/mh-system/src/main/java/com/mh/system/service/device/impl/CoolingSystemMonitorServiceImpl.java index 093b014..02eb483 100644 --- a/mh-system/src/main/java/com/mh/system/service/device/impl/CoolingSystemMonitorServiceImpl.java +++ b/mh-system/src/main/java/com/mh/system/service/device/impl/CoolingSystemMonitorServiceImpl.java @@ -239,9 +239,11 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer .filter(value -> "17".equals(value.getParamType()) && "15".equals(value.getTerminalDeviceType()) && value.getCurTime() != null) .filter(value -> DateUtils.isSameDay(new Date(), value.getCurTime())) .filter(value -> value.getGrade() == 140) - .map(CollectionParamsManage::getCurValue) + .filter(value -> value.getCurValue() != null) + .map(value -> value.getCurValue().abs()) .reduce(BigDecimal.ZERO, BigDecimal::add); + sysPerformanceDTO.setRealCold(totalRealCold); } @@ -329,6 +331,43 @@ public class CoolingSystemMonitorServiceImpl implements ICoolingSystemMonitorSer // 室外湿球温度 BigDecimal wetBulbTemp = weatherUtil.returnComputePsi(temperature, (double) humidity / 100, Double.parseDouble(pressure) * 1000); result.put("wetBulbTemp", wetBulbTemp.setScale(1, RoundingMode.HALF_UP).toString()); + } else { + // 查询跟当前时间yyyy-MM-dd HH相同的数据 + WeatherData weatherData = weatherDataMapper.selectWeatherDataByDate(DateUtils.getTime()); + if (weatherData != null) { + WeatherUtil weatherUtil = new WeatherUtil(); + // 室外温度 + int temperature = weatherData.getTemperature(); + result.putIfAbsent("temperature", temperature + ""); + + // 室外湿度 + int humidity = weatherData.getHumidity(); + result.putIfAbsent("humidity", humidity + ""); + + // 室外压力,采用标准大气压 101325 Pa + String pressure = "101.325"; +// result.putIfAbsent("pressure", new BigDecimal("101.325") + ""); + + // 室外含湿 + BigDecimal humidityRatio = weatherUtil.returnMoistureContent(String.valueOf(temperature), + String.valueOf(new BigDecimal(humidity).divide(new BigDecimal("100")).setScale(1, RoundingMode.HALF_UP)), + pressure); + result.put("humidityRatio", humidityRatio.setScale(1, RoundingMode.HALF_UP).toString()); + + // 室外焓值 + BigDecimal enthalpy = weatherUtil.returnEnthalpy(String.valueOf(temperature), + String.valueOf(new BigDecimal(humidity).divide(new BigDecimal("100")).setScale(1, RoundingMode.HALF_UP)), + pressure); + result.put("enthalpy", enthalpy.setScale(1, RoundingMode.HALF_UP).toString()); + + // 室外露点温度 + BigDecimal dewPointTemp = weatherUtil.calculateDewPoint(temperature, humidity); + result.put("dewPointTemp", dewPointTemp.setScale(1, RoundingMode.HALF_UP).toString()); + + // 室外湿球温度 + BigDecimal wetBulbTemp = weatherUtil.returnComputePsi(temperature, (double) humidity / 100, Double.parseDouble(pressure) * 1000); + result.put("wetBulbTemp", wetBulbTemp.setScale(1, RoundingMode.HALF_UP).toString()); + } } return result; }