From 9b4d5faf18f8daca5882b3a8f13ed547ae6fd6cd Mon Sep 17 00:00:00 2001 From: 25604 Date: Mon, 28 Jul 2025 15:34:32 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E7=94=9F=E6=88=90=EF=BC=9B2=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=A8=E9=80=81=E5=BC=82=E5=B8=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mh/quartz/task/CreateAlarmTask.java | 2 ++ .../java/com/mh/quartz/task/PushDataToWechatTask.java | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mh-quartz/src/main/java/com/mh/quartz/task/CreateAlarmTask.java b/mh-quartz/src/main/java/com/mh/quartz/task/CreateAlarmTask.java index 8ffac85..f022b27 100644 --- a/mh-quartz/src/main/java/com/mh/quartz/task/CreateAlarmTask.java +++ b/mh-quartz/src/main/java/com/mh/quartz/task/CreateAlarmTask.java @@ -104,6 +104,8 @@ public class CreateAlarmTask { // 更新报警记录 isExits.setContent(content); isExits.setCreateTime(collectionParamsManage.getCurTime()); + isExits.setStatus(0); + isExits.setIsSend(0); alarmRecordService.updateAlarmRecord(isExits); } } 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..46e7ee2 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://jnd2.mhwsh.net:8765/"); First first = new First(); first.setValue("设备告警通知"); pushMsgEntity.setFirst(first); @@ -117,7 +117,8 @@ public class PushDataToWechatTask { // 异常原因 Key4 key4 = new Key4(); - key4.setValue(alarmRecords2.getContent().substring(0, 20)); + String content = alarmRecords2.getContent(); + key4.setValue(content.length() > 20 ? content.substring(0, 20) : content); pushMsgEntity.setKey4(key4); // 发生时间 @@ -135,7 +136,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://jnd2.mhwsh.net:8765/"); First first = new First(); first.setValue("设备异常告警提醒"); pushMsgEntity.setFirst(first); @@ -158,7 +159,8 @@ public class PushDataToWechatTask { pushMsgEntity.setKey3(key3); Key4 key4 = new Key4(); - key4.setValue(alarmRecords2.getContent().substring(0, 20)); + String content = alarmRecords2.getContent(); + key4.setValue(content.length() > 20 ? content.substring(0, 20) : content); pushMsgEntity.setKey4(key4); Key5 key5 = new Key5();