From 91b0ba4d5e9588bd0015b93c5d22708147315e46 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 2 Jan 2025 16:30:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=9B=86=E7=BE=A4-=E8=87=AA=E5=8A=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=BF=87=E5=9B=BD=E6=A0=87=E7=BA=A7=E8=81=94]=20?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E8=87=AA=E5=8A=A8=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E4=B8=8A=E7=BA=A7=E5=8F=AA=E6=B3=A8=E5=86=8C=E6=9C=AC=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=9A=84=E4=B8=8A=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java | 5 ++++- .../com/genersoft/iot/vmp/gb28181/dao/PlatformMapper.java | 4 ++-- .../genersoft/iot/vmp/gb28181/service/IPlatformService.java | 2 +- .../iot/vmp/gb28181/service/impl/PlatformServiceImpl.java | 4 ++-- .../iot/vmp/service/redisMsg/RedisAlarmMsgListener.java | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) 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 {