Browse Source

1、优化报警生成;2、优化微信推送异常功能;

dev_mz
25604 4 weeks ago
parent
commit
9b4d5faf18
  1. 2
      mh-quartz/src/main/java/com/mh/quartz/task/CreateAlarmTask.java
  2. 10
      mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java

2
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);
}
}

10
mh-quartz/src/main/java/com/mh/quartz/task/PushDataToWechatTask.java

@ -92,7 +92,7 @@ public class PushDataToWechatTask {
private void pushDeviceArmParams(Map<String, Object> 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<String, Object> 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();

Loading…
Cancel
Save