Commit fe0b5c33f92e11f51574deb2c589a31b34a6e720
1 parent
298d104f
告警信息上报过程中,AlarmType存储失败的解决
Showing
1 changed file
with
6 additions
and
1 deletions
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); |