From a0f00fe8ba4f59d03df71e89cb2b7cfa9e9c606f Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Fri, 15 Jan 2021 00:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E4=B8=8A=E7=BA=A7=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E6=94=B9=E4=B8=BAserverGBId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/storager/dao/ParentPlatformMapper.java | 2 +- .../iot/vmp/storager/impl/VideoManagerStoragerImpl.java | 6 +++--- .../iot/vmp/vmanager/platform/PlatformController.java | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java index 70757576..6d5d83b2 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java @@ -51,7 +51,7 @@ public interface ParentPlatformMapper { @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") List getEnableParentPlatformList(boolean enable); - @Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}") + @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}") ParentPlatform getParentPlatById(String platformGbId); @Update("UPDATE parent_platform SET status=false" ) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 93d8c837..4547d76c 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -231,14 +231,14 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { @Override public boolean updateParentPlatform(ParentPlatform parentPlatform) { int result = 0; - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId()); - if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) { + ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); + if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) { result = platformMapper.addParentPlatform(parentPlatform); if (parentPlatformCatch == null) { parentPlatformCatch = new ParentPlatformCatch(); parentPlatformCatch.setParentPlatform(parentPlatform); - parentPlatformCatch.setId(parentPlatform.getDeviceGBId()); + parentPlatformCatch.setId(parentPlatform.getServerGBId()); } }else { result = platformMapper.updateParentPlatform(parentPlatform); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java index a75d753b..031fb09f 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java @@ -82,7 +82,8 @@ public class PlatformController { } // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 - ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); + // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); + ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId()); boolean updateResult = storager.updateParentPlatform(parentPlatform);