From 1947edb69af115eed2cbb4b2b9f60075fce18cbb Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 16 十月 2020 11:24:36 +0800 Subject: [PATCH] 引入lombok框架 优化redis存储结构 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java index 774cd60..73f2dc5 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java @@ -144,9 +144,8 @@ private void processMessageCatalogList(RequestEvent evt) { try { Element rootElement = getRootElement(evt); - String s = rootElement.toString(); Element deviceIdElement = rootElement.element("DeviceID"); - String deviceId = deviceIdElement.getText().toString(); + String deviceId = deviceIdElement.getText(); Element deviceListElement = rootElement.element("DeviceList"); if (deviceListElement == null) { return; @@ -164,9 +163,9 @@ if (channelDeviceElement == null) { continue; } - String channelDeviceId = channelDeviceElement.getText().toString(); + String channelDeviceId = channelDeviceElement.getText(); Element channdelNameElement = itemDevice.element("Name"); - String channelName = channdelNameElement != null ? channdelNameElement.getText().toString() : ""; + String channelName = channdelNameElement != null ? channdelNameElement.getTextTrim().toString() : ""; Element statusElement = itemDevice.element("Status"); String status = statusElement != null ? statusElement.getText().toString() : "ON"; DeviceChannel deviceChannel = new DeviceChannel(); @@ -200,6 +199,7 @@ deviceChannel.setLongitude(itemDevice.element("Longitude") == null? 0.00:Double.parseDouble(XmlUtil.getText(itemDevice,"Longitude"))); deviceChannel.setLatitude(itemDevice.element("Latitude") == null? 0.00:Double.parseDouble(XmlUtil.getText(itemDevice,"Latitude"))); deviceChannel.setPTZType(itemDevice.element("PTZType") == null? 0:Integer.parseInt(XmlUtil.getText(itemDevice,"PTZType"))); + deviceChannel.setHasAudio(false); // 榛樿鍚湁闊抽涓篺alse storager.updateChannel(device.getDeviceId(), deviceChannel); } // 鏇存柊 @@ -212,7 +212,11 @@ deferredResultHolder.invokeResult(msg); // 鍥炲200 - responseAck(evt); + if (offLineDetector.isOnline(deviceId)) { + responseAck(evt); + publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE); + } + } } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) { e.printStackTrace(); @@ -304,7 +308,7 @@ record.setEndTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(XmlUtil.getText(itemRecord,"EndTime"))); record.setSecrecy(itemRecord.element("Secrecy") == null? 0:Integer.parseInt(XmlUtil.getText(itemRecord,"Secrecy"))); record.setType(XmlUtil.getText(itemRecord,"Type")); - record.setRecordId(XmlUtil.getText(itemRecord,"RecorderID")); + record.setRecorderId(XmlUtil.getText(itemRecord,"RecorderID")); recordList.add(record); } recordInfo.setRecordList(recordList); -- Gitblit v1.8.0