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();