From 3dc1e0368e63a40131afb10ab0c7e26f651d220b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 04 三月 2022 15:59:29 +0800
Subject: [PATCH] 修复合并分支造成的bug

---
 src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
index c41c1e1..8fed6dd 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -137,6 +137,11 @@
             wvpResult.setMsg("missing parameters");
             return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST);
         }
+        if (parentPlatform.getServerPort()< 0 || parentPlatform.getServerPort() > 65535){
+            wvpResult.setCode(-1);
+            wvpResult.setMsg("error severPort");
+            return new ResponseEntity<>(wvpResult, HttpStatus.BAD_REQUEST);
+        }
 
         ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
         if (parentPlatformOld != null) {
@@ -211,26 +216,21 @@
         if (updateResult) {
             // 淇濆瓨鏃跺惎鐢ㄥ氨鍙戦�佹敞鍐�
             if (parentPlatform.isEnable()) {
-                // 淇濆瓨鏃跺惎鐢ㄥ氨鍙戦�佹敞鍐�
-                if (parentPlatform.isEnable()) {
-                    if (parentPlatformOld.isStatus()) {
-                        commanderForPlatform.unregister(parentPlatformOld, null, null);
-                        try {
-                            Thread.sleep(500);
-                        } catch (InterruptedException e) {
-                            e.printStackTrace();
-                        }
-                        //  鍙淇濆瓨灏卞彂閫佹敞鍐�
-                        commanderForPlatform.register(parentPlatform, null, null);
-                    }else {
-                        //  鍙淇濆瓨灏卞彂閫佹敞鍐�
-                        commanderForPlatform.register(parentPlatform, null, null);
-                    }
-                } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 鍏抽棴鍚敤鏃舵敞閿�
+                if (parentPlatformOld.isStatus()) {
                     commanderForPlatform.unregister(parentPlatformOld, null, null);
+                    try {
+                        Thread.sleep(500);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                    //  鍙淇濆瓨灏卞彂閫佹敞鍐�
+                    commanderForPlatform.register(parentPlatform, null, null);
+                }else {
+                    //  鍙淇濆瓨灏卞彂閫佹敞鍐�
+                    commanderForPlatform.register(parentPlatform, null, null);
                 }
             } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 鍏抽棴鍚敤鏃舵敞閿�
-                commanderForPlatform.unregister(parentPlatform, null, null);
+                commanderForPlatform.unregister(parentPlatformOld, null, null);
             }
             wvpResult.setCode(0);
             wvpResult.setMsg("success");

--
Gitblit v1.8.0