mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-23 05:37:48 +08:00
Compare commits
4 Commits
fd4fd5df82
...
9ed5c3bc72
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ed5c3bc72 | ||
|
|
30aa3192d0 | ||
|
|
fea157436b | ||
|
|
da98101aac |
@ -8,9 +8,6 @@ public class ServerInfo {
|
||||
|
||||
private String ip;
|
||||
private int port;
|
||||
/**
|
||||
* 现在使用的线程数
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
public static ServerInfo create(String ip, int port) {
|
||||
|
||||
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Group;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.RedisGroupMessage;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IGroupService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -37,7 +38,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
private IGroupService groupService;
|
||||
|
||||
@Resource
|
||||
private IStreamPushService streamPushService;
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Autowired
|
||||
private UserSetting userSetting;
|
||||
@ -49,6 +50,10 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] bytes) {
|
||||
String serverId = redisCatchStorage.chooseOneServer(null);
|
||||
if (!userSetting.getServerId().equals(serverId)) {
|
||||
return;
|
||||
}
|
||||
log.info("[REDIS: 业务分组同步回复] key: {}, : {}", VideoManagerConstants.VM_MSG_GROUP_LIST_RESPONSE, new String(message.getBody()));
|
||||
taskQueue.offer(message);
|
||||
}
|
||||
@ -77,7 +82,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
List<RedisGroupMessage> groupMessages = JSON.parseArray(new String(msg.getBody()), RedisGroupMessage.class);
|
||||
for (int i = 0; i < groupMessages.size(); i++) {
|
||||
RedisGroupMessage groupMessage = groupMessages.get(i);
|
||||
log.info("[REDIS消息-业务分组同步回复] {}", groupMessage.toString());
|
||||
log.info("[REDIS消息-业务分组同步回复] 处理数据: {}", groupMessage.toString());
|
||||
if (!userSetting.isUseAliasForGroupSync()) {
|
||||
if (groupMessage.getGroupGbId() == null) {
|
||||
log.warn("[REDIS消息-业务分组同步回复] 分组编号未设置,{}", groupMessage.toString());
|
||||
@ -156,11 +161,12 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
|
||||
group.setUpdateTime(DateUtil.getNow());
|
||||
if (group.getId() > 0) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 更新入库, {}", JSON.toJSONString(group));
|
||||
groupService.update(group);
|
||||
}else {
|
||||
log.info("[REDIS消息-业务分组同步回复] 新增入库, {}", JSON.toJSONString(group));
|
||||
groupService.add(group);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,9 @@ package com.genersoft.iot.vmp.service.redisMsg;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.streamPush.bean.RedisPushStreamMessage;
|
||||
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
|
||||
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
|
||||
@ -36,10 +38,20 @@ public class RedisPushStreamListMsgListener implements MessageListener {
|
||||
@Resource
|
||||
private IStreamPushService streamPushService;
|
||||
|
||||
@Resource
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Resource
|
||||
private UserSetting userSetting;
|
||||
|
||||
private final ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] bytes) {
|
||||
String serverId = redisCatchStorage.chooseOneServer(null);
|
||||
if (!userSetting.getServerId().equals(serverId)) {
|
||||
return;
|
||||
}
|
||||
log.info("[REDIS: 推流设备列表更新]: {}", new String(message.getBody()));
|
||||
taskQueue.offer(message);
|
||||
}
|
||||
|
||||
@ -521,7 +521,9 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
@Override
|
||||
public String chooseOneServer(String serverId) {
|
||||
String key = VideoManagerConstants.WVP_SERVER_LIST;
|
||||
redisTemplate.opsForZSet().remove(key, serverId);
|
||||
if (serverId != null) {
|
||||
redisTemplate.opsForZSet().remove(key, serverId);
|
||||
}
|
||||
Set<Object> range = redisTemplate.opsForZSet().range(key, 0, 0);
|
||||
if (range == null || range.isEmpty()) {
|
||||
return null;
|
||||
|
||||
@ -182,10 +182,13 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
case VLOST:
|
||||
for (CommonGBChannel channel : channels) {
|
||||
if (channel.getGbPtzType() != null && channel.getGbPtzType() == 99) {
|
||||
CameraChannel cameraChannel = channelMapper.queryCameraChannelById(channel.getGbId());
|
||||
if (event.getMessageType() == ChannelEvent.ChannelEventMessageType.ON) {
|
||||
resultListForOnline.add(channel);
|
||||
cameraChannel.setGbStatus("ON");
|
||||
resultListForOnline.add(cameraChannel);
|
||||
}else {
|
||||
resultListForOffline.add(channel);
|
||||
cameraChannel.setGbStatus("OFF");
|
||||
resultListForOffline.add(cameraChannel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -861,7 +861,7 @@
|
||||
320623,如东县,3206
|
||||
320681,启东市,3206
|
||||
320682,如皋市,3206
|
||||
320684,海门市,3206
|
||||
320684,海门区,3206
|
||||
320685,海安市,3206
|
||||
3207,连云港市,32
|
||||
320703,连云区,3207
|
||||
@ -918,8 +918,6 @@
|
||||
33,浙江省,
|
||||
3301,杭州市,33
|
||||
330102,上城区,3301
|
||||
330103,下城区,3301
|
||||
330104,江干区,3301
|
||||
330105,拱墅区,3301
|
||||
330106,西湖区,3301
|
||||
330108,滨江区,3301
|
||||
@ -927,6 +925,8 @@
|
||||
330110,余杭区,3301
|
||||
330111,富阳区,3301
|
||||
330112,临安区,3301
|
||||
330113,临平区,3301
|
||||
330114,钱塘区,3301
|
||||
330122,桐庐县,3301
|
||||
330127,淳安县,3301
|
||||
330182,建德市,3301
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user