From 0a380c6ff916015b434c398448ae08746b6b0a4b Mon Sep 17 00:00:00 2001
From: gaoxun250@sina.com <gaoxun250@sina.com>
Date: 星期五, 03 二月 2023 14:19:10 +0800
Subject: [PATCH] 解决截图被占用无法打开问题
---
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
index 733f78a..35d563d 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -1,7 +1,7 @@
package com.genersoft.iot.vmp.gb28181.utils;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
+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;
@@ -211,17 +211,26 @@
ChannelType channelType = ChannelType.Other;
if (channelId.length() <= 8) {
channelType = ChannelType.CivilCode;
+ deviceChannel.setHasAudio(false);
}else {
if (channelId.length() == 20) {
int code = Integer.parseInt(channelId.substring(10, 13));
switch (code){
case 215:
channelType = ChannelType.BusinessGroup;
+ deviceChannel.setHasAudio(false);
break;
case 216:
channelType = ChannelType.VirtualOrganization;
+ deviceChannel.setHasAudio(false);
+ break;
+ case 136:
+ case 137:
+ case 138:
+ deviceChannel.setHasAudio(true);
break;
default:
+ deviceChannel.setHasAudio(false);
break;
}
@@ -288,6 +297,10 @@
deviceChannel.setParentId(lastParentId);
}else {
deviceChannel.setParentId(parentId);
+ }
+ // 鍏煎璁惧閫氶亾淇℃伅涓嚜宸变负鑷繁鐖惰妭鐐圭殑鎯呭喌
+ if (deviceChannel.getParentId().equals(deviceChannel.getChannelId())) {
+ deviceChannel.setParentId(null);
}
}
deviceChannel.setBusinessGroupId(businessGroupID);
@@ -396,7 +409,6 @@
} else {
deviceChannel.setPTZType(Integer.parseInt(XmlUtil.getText(itemDevice, "PTZType")));
}
- deviceChannel.setHasAudio(true); // 榛樿鍚湁闊抽锛屾挱鏀炬椂鍐嶆鏌ユ槸鍚︽湁闊抽鍙婃槸鍚AC
return deviceChannel;
}
}
\ No newline at end of file
--
Gitblit v1.8.0