Commit 8f9a53029632f258bbafa8f6dc2c896759206695

Authored by 648540858
Committed by GitHub
2 parents 298d104f fe0b5c33

Merge pull request #360 from TristingChen/alarm-test

告警信息上报过程中,AlarmType存储失败的解决
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java
@@ -22,7 +22,7 @@ import org.springframework.util.StringUtils; @@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
22 22
23 import javax.sip.RequestEvent; 23 import javax.sip.RequestEvent;
24 24
25 -import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText; 25 +import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.*;
26 26
27 @Component 27 @Component
28 public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { 28 public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler {
@@ -105,6 +105,11 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @@ -105,6 +105,11 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
105 storager.insertMobilePosition(mobilePosition); 105 storager.insertMobilePosition(mobilePosition);
106 } 106 }
107 } 107 }
  108 + if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) {
  109 + if (deviceAlarm.getAlarmMethod().equals("5")) {
  110 + deviceAlarm.setAlarmType(getText(rootElement.element("Info"), "AlarmType"));
  111 + }
  112 + }
108 logger.debug("存储报警信息、报警分类"); 113 logger.debug("存储报警信息、报警分类");
109 // 存储报警信息、报警分类 114 // 存储报警信息、报警分类
110 deviceAlarmService.add(deviceAlarm); 115 deviceAlarmService.add(deviceAlarm);