From 5210bcdd588e13647b1d80fffd8334365ca266b0 Mon Sep 17 00:00:00 2001 From: 25604 Date: Tue, 1 Jul 2025 15:35:18 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=8A=A5=E8=AD=A6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mh-admin/src/main/resources/application-dev.yml | 6 +++--- mh-admin/src/main/resources/application-prod.yml | 16 ++++++++-------- mh-admin/src/main/resources/application.yml | 2 +- .../common/core/domain/entity/AlarmRecords.java | 6 +++--- .../com/mh/quartz/task/PushDataToWechatTask.java | 4 ++-- .../impl/CollectionParamsManageServiceImpl.java | 3 +++ .../operation/impl/AlarmRecordsServiceImpl.java | 6 ++++-- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/mh-admin/src/main/resources/application-dev.yml b/mh-admin/src/main/resources/application-dev.yml index d1a085c..5e048f3 100644 --- a/mh-admin/src/main/resources/application-dev.yml +++ b/mh-admin/src/main/resources/application-dev.yml @@ -1,7 +1,7 @@ # 项目相关配置 mh: # 名称 - name: mz + name: MH # 版本 version: 1.0.0 # 版权年份 @@ -98,8 +98,8 @@ spring: # 主库数据源 master: #添加allowMultiQueries=true 在批量更新时才不会出错 -# url: jdbc:postgresql://127.0.0.1:5432/eemcs_hw_dev - url: jdbc:postgresql://127.0.0.1:5432/eemcs + url: jdbc:postgresql://127.0.0.1:5432/eemcs_hw_dev +# url: jdbc:postgresql://127.0.0.1:5432/eemcs username: postgres password: mh@803 # 从库数据源 diff --git a/mh-admin/src/main/resources/application-prod.yml b/mh-admin/src/main/resources/application-prod.yml index 6dbe62e..e71c0b0 100644 --- a/mh-admin/src/main/resources/application-prod.yml +++ b/mh-admin/src/main/resources/application-prod.yml @@ -1,7 +1,7 @@ # 项目相关配置 mh: # 名称 - name: mz + name: hw # 版本 version: 1.0.0 # 版权年份 @@ -16,7 +16,7 @@ mh: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8091 + port: 8090 servlet: # 应用的访问路径 context-path: / @@ -63,7 +63,7 @@ spring: # 端口,默认为6379 port: 6379 # 数据库索引 - database: 14 + database: 0 # 密码 password: # 连接超时时间 @@ -82,9 +82,9 @@ spring: rabbitmq: host: 127.0.0.1 port: 5672 - username: eemcs_mz + username: eemcs password: mh@803 - virtual-host: /eemcs_mz + virtual-host: /eemcs listener: direct: prefetch: 2 @@ -98,8 +98,8 @@ spring: # 主库数据源 master: #添加allowMultiQueries=true 在批量更新时才不会出错 - url: jdbc:postgresql://127.0.0.1:5505/eemcs -# url: jdbc:postgresql://127.0.0.1:5505/eemcs + url: jdbc:postgresql://127.0.0.1:5505/eemcs_hw + # url: jdbc:postgresql://127.0.0.1:5505/eemcs username: postgres password: mhtech@803 # 从库数据源 @@ -195,7 +195,7 @@ mqttSpring: port: 1883 username: sa password: sa123 - client-id: eemcs_mz_mqtt_pro + client-id: eemcs_hw_mqtt_pro # If the protocol is ws/wss, this value is required. path: # Topics that need to be subscribed when initially connecting to mqtt, multiple topics are divided by ",". diff --git a/mh-admin/src/main/resources/application.yml b/mh-admin/src/main/resources/application.yml index c3ae7c3..44f7920 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-common/src/main/java/com/mh/common/core/domain/entity/AlarmRecords.java b/mh-common/src/main/java/com/mh/common/core/domain/entity/AlarmRecords.java index 45d38aa..e1b5bdb 100644 --- a/mh-common/src/main/java/com/mh/common/core/domain/entity/AlarmRecords.java +++ b/mh-common/src/main/java/com/mh/common/core/domain/entity/AlarmRecords.java @@ -86,13 +86,13 @@ public class AlarmRecords implements Serializable { /** * 是否发送通知 0:未发送 1:已发送 */ - private int isSend; + private Integer isSend; - public int getIsSend() { + public Integer getIsSend() { return isSend; } - public void setIsSend(int isSend) { + public void setIsSend(Integer isSend) { this.isSend = isSend; } diff --git a/mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java b/mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java index a8438f0..0ff163c 100644 --- a/mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java +++ b/mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java @@ -92,7 +92,7 @@ public class PushDataToWechatTask { private void pushDeviceArmParams(Map map, PushMsgEntity pushMsgEntity, AlarmRecords alarmRecords2) { pushMsgEntity.setTouser(map.get("open_id").toString()); pushMsgEntity.setTemplateId(map.get("template_id").toString()); - pushMsgEntity.setUrl("http://jnd2.mhwsh.net:8765/"); + pushMsgEntity.setUrl("http://bajnd.mhwsh.net:9090/"); First first = new First(); first.setValue("设备告警通知"); pushMsgEntity.setFirst(first); @@ -135,7 +135,7 @@ public class PushDataToWechatTask { private void pushDeviceExceptionParams(Map map, PushMsgEntity pushMsgEntity, AlarmRecords alarmRecords2) { pushMsgEntity.setTouser(map.get("open_id").toString()); pushMsgEntity.setTemplateId(map.get("template_id").toString()); - pushMsgEntity.setUrl("http://jnd2.mhwsh.net:8765/"); + pushMsgEntity.setUrl("http://bajnd.mhwsh.net:9090/"); First first = new First(); first.setValue("设备异常告警提醒"); pushMsgEntity.setFirst(first); diff --git a/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java b/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java index 3120892..d648768 100644 --- a/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java +++ b/mh-system/src/main/java/com/mh/system/service/device/impl/CollectionParamsManageServiceImpl.java @@ -249,6 +249,9 @@ public class CollectionParamsManageServiceImpl implements ICollectionParamsManag deviceMonitorVO.setDeviceType(param.getMtType()); deviceMonitorVO.setCollectName(param.getOtherName()); deviceMonitorVO.setCollectTime(param.getCurTime()); + if (null == param.getCurValue()) { + param.setCurValue(new BigDecimal(0)); + } // 判断如果是压力,放大1000倍,并保留一位小数 if (param.getParamType().equals("13")) { BigDecimal bigDecimal = param.getCurValue(); diff --git a/mh-system/src/main/java/com/mh/system/service/operation/impl/AlarmRecordsServiceImpl.java b/mh-system/src/main/java/com/mh/system/service/operation/impl/AlarmRecordsServiceImpl.java index 0ceaf32..e9287bb 100644 --- a/mh-system/src/main/java/com/mh/system/service/operation/impl/AlarmRecordsServiceImpl.java +++ b/mh-system/src/main/java/com/mh/system/service/operation/impl/AlarmRecordsServiceImpl.java @@ -110,8 +110,10 @@ public class AlarmRecordsServiceImpl implements IAlarmRecordsService { // 是否已处理,0:未处理,1:已处理 queryWrapper.eq("status", alarmRecords.getStatus()); - // 是否已经发送短信,0:未发送,1:已发送 - queryWrapper.eq("is_send", alarmRecords.getIsSend()); + if (null != alarmRecords.getIsSend()) { + // 是否已经发送短信,0:未发送,1:已发送 + queryWrapper.eq("is_send", alarmRecords.getIsSend()); + } queryWrapper.orderByDesc("create_time"); return alarmRecordsMapper.selectList(queryWrapper);