[集群] 支持国标级联更新

This commit is contained in:
648540858
2025-01-02 18:34:22 +08:00
parent 7fb07848ab
commit b0b3f32e03
6 changed files with 77 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ import com.genersoft.iot.vmp.media.event.mediaServer.MediaSendRtpStoppedEvent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.service.ISendRtpServerService;
import com.genersoft.iot.vmp.service.bean.*;
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.github.pagehelper.PageHelper;
@@ -87,6 +88,9 @@ public class PlatformServiceImpl implements IPlatformService {
@Autowired
private UserSetting userSetting;
@Autowired
private IRedisRpcService redisRpcService;
@Autowired
private SipConfig sipConfig;
@@ -286,6 +290,11 @@ public class PlatformServiceImpl implements IPlatformService {
log.info("[国标级联] 更新平台 {}({})", platform.getName(), platform.getDeviceGBId());
platform.setCharacterSet(platform.getCharacterSet().toUpperCase());
Platform platformInDb = platformMapper.query(platform.getId());
Assert.notNull(platformInDb, "平台不存在");
if (!userSetting.getServerId().equals(platformInDb.getServerId())) {
return redisRpcService.updatePlatform(platformInDb.getServerId(), platform);
}
PlatformCatch platformCatchOld = redisCatchStorage.queryPlatformCatchInfo(platformInDb.getServerGBId());
platform.setUpdateTime(DateUtil.getNow());