Commit 3f5e885e82953d55cb808624800f302886a11777

Authored by 648540858
1 parent 7d888274

目录默认节点被删除时,重置默认节点为根节点

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
@@ -415,7 +415,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -415,7 +415,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
415 415
416 Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); 416 Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader);
417 transmitRequest(parentPlatform, request); 417 transmitRequest(parentPlatform, request);
418 - Thread.sleep(100); 418 + Thread.sleep(10);
419 } catch (SipException | ParseException | InvalidArgumentException e) { 419 } catch (SipException | ParseException | InvalidArgumentException e) {
420 e.printStackTrace(); 420 e.printStackTrace();
421 return false; 421 return false;
@@ -459,7 +459,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -459,7 +459,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
459 459
460 Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); 460 Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader);
461 transmitRequest(parentPlatform, request); 461 transmitRequest(parentPlatform, request);
462 - Thread.sleep(100); 462 + Thread.sleep(200);
463 } catch (SipException | ParseException | InvalidArgumentException e) { 463 } catch (SipException | ParseException | InvalidArgumentException e) {
464 e.printStackTrace(); 464 e.printStackTrace();
465 return false; 465 return false;
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -407,6 +407,17 @@ public class PlatformController { @@ -407,6 +407,17 @@ public class PlatformController {
407 if (logger.isDebugEnabled()) { 407 if (logger.isDebugEnabled()) {
408 logger.debug("删除目录,{}", id); 408 logger.debug("删除目录,{}", id);
409 } 409 }
  410 + // 如果删除的是默认目录则根目录设置为默认目录
  411 + PlatformCatalog catalog = storager.getCatalog(id);
  412 + if (catalog != null) {
  413 + ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(catalog.getPlatformId());
  414 + if (parentPlatform != null) {
  415 + if (id.equals(parentPlatform.getCatalogId())) {
  416 + storager.setDefaultCatalog(parentPlatform.getServerGBId(), parentPlatform.getServerGBId());
  417 + }
  418 + }
  419 + }
  420 +
410 int delResult = storager.delCatalog(id); 421 int delResult = storager.delCatalog(id);
411 WVPResult<List<PlatformCatalog>> result = new WVPResult<>(); 422 WVPResult<List<PlatformCatalog>> result = new WVPResult<>();
412 result.setCode(0); 423 result.setCode(0);
src/main/resources/application-dev.yml
1 spring: 1 spring:
  2 + # 上传文件大小限制
  3 + servlet:
  4 + multipart:
  5 + max-file-size: 10MB
  6 + max-request-size: 100MB
2 # REDIS数据库配置 7 # REDIS数据库配置
3 redis: 8 redis:
4 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1 9 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
src/main/resources/application-docker.yml
1 spring: 1 spring:
  2 + # 上传文件大小限制
  3 + servlet:
  4 + multipart:
  5 + max-file-size: 10MB
  6 + max-request-size: 100MB
2 # REDIS数据库配置 7 # REDIS数据库配置
3 redis: 8 redis:
4 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1 9 # [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -161,6 +161,9 @@ export default { @@ -161,6 +161,9 @@ export default {
161 console.log("移除成功") 161 console.log("移除成功")
162 node.parent.loaded = false 162 node.parent.loaded = false
163 node.parent.expand(); 163 node.parent.expand();
  164 + if(this.defaultCatalogId === id) {
  165 + this.defaultCatalogId = this.platformId;
  166 + }
164 } 167 }
165 }) 168 })
166 .catch(function (error) { 169 .catch(function (error) {