diff --git a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java index e6a9006a..cb12754e 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java @@ -31,10 +31,13 @@ public class SipPlatformRunner implements CommandLineRunner { @Autowired private ISIPCommanderForPlatform sipCommanderForPlatform; + @Autowired + private UserSetting userSetting; + @Override public void run(String... args) throws Exception { // 获取所有启用的平台 - List parentPlatforms = platformService.queryEnablePlatformList(); + List parentPlatforms = platformService.queryEnablePlatformList(userSetting.getServerId()); for (Platform platform : parentPlatforms) { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java index 5206f336..0e749891 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java @@ -77,8 +77,8 @@ public interface PlatformMapper { " ") List queryList(@Param("query") String query); - @Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ") - List queryEnableParentPlatformList(boolean enable); + @Select("SELECT * FROM wvp_platform WHERE serverId=#{serverId} and enable=#{enable} ") + List queryEnableParentPlatformList(@Param("serverId") String serverId, @Param("enable") boolean enable); @Select("SELECT * FROM wvp_platform WHERE enable=true and as_message_channel=true") List queryEnablePlatformListWithAsMessageChannel(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java index 7858269c..edaf4d9d 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IPlatformService.java @@ -82,7 +82,7 @@ public interface IPlatformService { Platform queryOne(Integer platformId); - List queryEnablePlatformList(); + List queryEnablePlatformList(String serverId); void delete(Integer platformId, CommonCallback callback); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java index 795ae13e..617e6f3b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlatformServiceImpl.java @@ -857,8 +857,8 @@ public class PlatformServiceImpl implements IPlatformService { } @Override - public List queryEnablePlatformList() { - return platformMapper.queryEnableParentPlatformList(true); + public List queryEnablePlatformList(String serverId) { + return platformMapper.queryEnableParentPlatformList(serverId,true); } @Override diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java index d4f65e13..886cd88e 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java @@ -105,7 +105,7 @@ public class RedisAlarmMsgListener implements MessageListener { if (ObjectUtils.isEmpty(gbId)) { if (userSetting.getSendToPlatformsWhenIdLost()) { // 发送给所有的上级 - List parentPlatforms = platformService.queryEnablePlatformList(); + List parentPlatforms = platformService.queryEnablePlatformList(userSetting.getServerId()); if (!parentPlatforms.isEmpty()) { for (Platform parentPlatform : parentPlatforms) { try {