648540858
2020-10-16 1947edb69af115eed2cbb4b2b9f60075fce18cbb
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -145,7 +145,7 @@
      try {
         Element rootElement = getRootElement(evt);
         Element deviceIdElement = rootElement.element("DeviceID");
         String deviceId = deviceIdElement.getText().toString();
         String deviceId = deviceIdElement.getText();
         Element deviceListElement = rootElement.element("DeviceList");
         if (deviceListElement == null) {
            return;
@@ -163,18 +163,18 @@
               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();
               deviceChannel.setName(channelName);
               deviceChannel.setChannelId(channelDeviceId);
               if(status.equals("ON")) {
               if(status.equals("ON") || status.equals("On")) {
                  deviceChannel.setStatus(1);
               }
               if(status.equals("OFF")) {
               if(status.equals("OFF") || status.equals("Off")) {
                  deviceChannel.setStatus(0);
               }
@@ -185,7 +185,7 @@
               deviceChannel.setBlock(XmlUtil.getText(itemDevice,"Block"));
               deviceChannel.setAddress(XmlUtil.getText(itemDevice,"Address"));
               deviceChannel.setParental(itemDevice.element("Parental") == null? 0:Integer.parseInt(XmlUtil.getText(itemDevice,"Parental")));
               deviceChannel.setParentId(XmlUtil.getText(itemDevice,"ParentId"));
               deviceChannel.setParentId(XmlUtil.getText(itemDevice,"ParentID"));
               deviceChannel.setSafetyWay(itemDevice.element("SafetyWay") == null? 0:Integer.parseInt(XmlUtil.getText(itemDevice,"SafetyWay")));
               deviceChannel.setRegisterWay(itemDevice.element("RegisterWay") == null? 1:Integer.parseInt(XmlUtil.getText(itemDevice,"RegisterWay")));
               deviceChannel.setCertNum(XmlUtil.getText(itemDevice,"CertNum"));
@@ -199,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); // 默认含有音频为false
               storager.updateChannel(device.getDeviceId(), deviceChannel);
            }
            // 更新
@@ -209,8 +210,15 @@
            msg.setType(DeferredResultHolder.CALLBACK_CMD_CATALOG);
            msg.setData(device);
            deferredResultHolder.invokeResult(msg);
            // 回复200
            if (offLineDetector.isOnline(deviceId)) {
               responseAck(evt);
               publisher.onlineEventPublish(deviceId, VideoManagerConstants.EVENT_ONLINE_KEEPLIVE);
            }
         }
      } catch (DocumentException e) {
      } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
         e.printStackTrace();
      }
   }
@@ -300,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);