From e4e6209835eaae8eab9e6210f3bdf52b23de4c7a Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 16 Nov 2020 12:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=A4=84=E7=90=86Catalog?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=B6=E9=81=87=E5=88=B0=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/impl/MessageRequestProcessor.java | 27 ++++++++++++++----- 1 file changed, 21 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 06afc352..b976f3b7 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 @@ -215,12 +215,27 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { deviceChannel.setPort(itemDevice.element("Port") == null ? 0 : Integer.parseInt(XmlUtil.getText(itemDevice, "Port"))); deviceChannel.setPassword(XmlUtil.getText(itemDevice, "Password")); - 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"))); + if (itemDevice.element("Longitute")==null) { + deviceChannel.setLongitude(0.00); + } else { + deviceChannel.setLongitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Longitude"))); + } + if (itemDevice.element("Latitute") == null) { + deviceChannel.setLatitude(0.00); + } else { + deviceChannel.setLatitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Latitude"))); + } + if (itemDevice.element("PTZType") == null) { + deviceChannel.setPTZType(0); + } else { + deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType"))); + } + // 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(true); // 默认含有音频,播放时再检查是否有音频及是否AAC storager.updateChannel(device.getDeviceId(), deviceChannel); }