Browse Source

将上级平台标识改为serverGBId

pull/38/head
Lawrence 4 years ago
parent
commit
1b200bcc90
  1. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
  2. 6
      src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
  3. 3
      src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java

2
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<ParentPlatform> 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" )

6
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);

3
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);

Loading…
Cancel
Save