| | |
| | | package com.genersoft.iot.vmp.gb28181.utils;
|
| | |
|
| | | import com.alibaba.fastjson2.JSON;
|
| | | import com.alibaba.fastjson2.JSONArray;
|
| | | import com.alibaba.fastjson2.JSONObject;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.Device;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.TreeType;
|
| | | import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
| | | import com.genersoft.iot.vmp.utils.DateUtil;
|
| | | import org.dom4j.Attribute;
|
| | |
| | | }
|
| | | if (channelType.equals(ChannelType.CivilCode)) {
|
| | | // 行政区划其他字段没必要识别了,默认在线即可
|
| | | deviceChannel.setStatus(1);
|
| | | deviceChannel.setStatus(true);
|
| | | deviceChannel.setParental(1);
|
| | | deviceChannel.setCreateTime(DateUtil.getNow());
|
| | | deviceChannel.setUpdateTime(DateUtil.getNow());
|
| | |
| | | deviceChannel.setBusinessGroupId(businessGroupID);
|
| | | if (channelType.equals(ChannelType.BusinessGroup) || channelType.equals(ChannelType.VirtualOrganization)) {
|
| | | // 业务分组和虚拟组织 其他字段没必要识别了,默认在线即可
|
| | | deviceChannel.setStatus(1);
|
| | | deviceChannel.setStatus(true);
|
| | | deviceChannel.setParental(1);
|
| | | deviceChannel.setCreateTime(DateUtil.getNow());
|
| | | deviceChannel.setUpdateTime(DateUtil.getNow());
|
| | |
| | | String status = statusElement.getTextTrim().trim();
|
| | | // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理
|
| | | if (status.equals("ON") || status.equals("On") || status.equals("ONLINE") || status.equals("OK")) {
|
| | | deviceChannel.setStatus(1);
|
| | | deviceChannel.setStatus(true);
|
| | | }
|
| | | if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) {
|
| | | deviceChannel.setStatus(0);
|
| | | deviceChannel.setStatus(false);
|
| | | }
|
| | | }else {
|
| | | deviceChannel.setStatus(1);
|
| | | deviceChannel.setStatus(true);
|
| | | }
|
| | | // 识别自带的目录标识
|
| | | String parental = XmlUtil.getText(itemDevice, "Parental");
|
| | |
| | | } else {
|
| | | deviceChannel.setLatitude(0.00);
|
| | | }
|
| | |
|
| | | deviceChannel.setGpsTime(DateUtil.getNow());
|
| | |
|
| | |
|
| | |
| | | } else {
|
| | | deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType")));
|
| | | }
|
| | |
|
| | | return deviceChannel;
|
| | | }
|
| | |
|