Merge pull request #360 from TristingChen/alarm-test

告警信息上报过程中,AlarmType存储失败的解决
This commit is contained in:
648540858 2022-03-02 09:22:20 +08:00 committed by GitHub
commit 8f9a530296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
import javax.sip.RequestEvent;
import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText;
import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.*;
@Component
public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler {
@ -105,6 +105,11 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
storager.insertMobilePosition(mobilePosition);
}
}
if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) {
if (deviceAlarm.getAlarmMethod().equals("5")) {
deviceAlarm.setAlarmType(getText(rootElement.element("Info"), "AlarmType"));
}
}
logger.debug("存储报警信息、报警分类");
// 存储报警信息报警分类
deviceAlarmService.add(deviceAlarm);