Commit 3f5e885e82953d55cb808624800f302886a11777
1 parent
7d888274
目录默认节点被删除时,重置默认节点为根节点
Showing
5 changed files
with
26 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| ... | ... | @@ -415,7 +415,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 415 | 415 | |
| 416 | 416 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); |
| 417 | 417 | transmitRequest(parentPlatform, request); |
| 418 | - Thread.sleep(100); | |
| 418 | + Thread.sleep(10); | |
| 419 | 419 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 420 | 420 | e.printStackTrace(); |
| 421 | 421 | return false; |
| ... | ... | @@ -459,7 +459,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 459 | 459 | |
| 460 | 460 | Request request = headerProviderPlarformProvider.createNotifyRequest(parentPlatform, catalogXml.toString(), subscribeInfo.getToTag(), subscribeInfo.getFromTag(), callIdHeader); |
| 461 | 461 | transmitRequest(parentPlatform, request); |
| 462 | - Thread.sleep(100); | |
| 462 | + Thread.sleep(200); | |
| 463 | 463 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 464 | 464 | e.printStackTrace(); |
| 465 | 465 | return false; | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
| ... | ... | @@ -407,6 +407,17 @@ public class PlatformController { |
| 407 | 407 | if (logger.isDebugEnabled()) { |
| 408 | 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 | 421 | int delResult = storager.delCatalog(id); |
| 411 | 422 | WVPResult<List<PlatformCatalog>> result = new WVPResult<>(); |
| 412 | 423 | result.setCode(0); | ... | ... |
src/main/resources/application-dev.yml
src/main/resources/application-docker.yml
web_src/src/components/dialog/chooseChannelForCatalog.vue