mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-26 23:17:50 +08:00
Compare commits
4 Commits
79da97f2ba
...
527a19b8f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
527a19b8f4 | ||
|
|
30aa3192d0 | ||
|
|
fea157436b | ||
|
|
34d1dbb399 |
@ -8,9 +8,6 @@ public class ServerInfo {
|
|||||||
|
|
||||||
private String ip;
|
private String ip;
|
||||||
private int port;
|
private int port;
|
||||||
/**
|
|
||||||
* 现在使用的线程数
|
|
||||||
*/
|
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
public static ServerInfo create(String ip, int port) {
|
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.Group;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.RedisGroupMessage;
|
import com.genersoft.iot.vmp.gb28181.bean.RedisGroupMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGroupService;
|
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.streamPush.service.IStreamPushService;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -37,7 +38,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
|||||||
private IGroupService groupService;
|
private IGroupService groupService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IStreamPushService streamPushService;
|
private IRedisCatchStorage redisCatchStorage;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
@ -49,6 +50,10 @@ public class RedisGroupMsgListener implements MessageListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(Message message, byte[] bytes) {
|
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()));
|
log.info("[REDIS: 业务分组同步回复] key: {}, : {}", VideoManagerConstants.VM_MSG_GROUP_LIST_RESPONSE, new String(message.getBody()));
|
||||||
taskQueue.offer(message);
|
taskQueue.offer(message);
|
||||||
}
|
}
|
||||||
@ -77,7 +82,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
|||||||
List<RedisGroupMessage> groupMessages = JSON.parseArray(new String(msg.getBody()), RedisGroupMessage.class);
|
List<RedisGroupMessage> groupMessages = JSON.parseArray(new String(msg.getBody()), RedisGroupMessage.class);
|
||||||
for (int i = 0; i < groupMessages.size(); i++) {
|
for (int i = 0; i < groupMessages.size(); i++) {
|
||||||
RedisGroupMessage groupMessage = groupMessages.get(i);
|
RedisGroupMessage groupMessage = groupMessages.get(i);
|
||||||
log.info("[REDIS消息-业务分组同步回复] {}", groupMessage.toString());
|
log.info("[REDIS消息-业务分组同步回复] 处理数据: {}", groupMessage.toString());
|
||||||
if (!userSetting.isUseAliasForGroupSync()) {
|
if (!userSetting.isUseAliasForGroupSync()) {
|
||||||
if (groupMessage.getGroupGbId() == null) {
|
if (groupMessage.getGroupGbId() == null) {
|
||||||
log.warn("[REDIS消息-业务分组同步回复] 分组编号未设置,{}", groupMessage.toString());
|
log.warn("[REDIS消息-业务分组同步回复] 分组编号未设置,{}", groupMessage.toString());
|
||||||
@ -156,11 +161,12 @@ public class RedisGroupMsgListener implements MessageListener {
|
|||||||
|
|
||||||
group.setUpdateTime(DateUtil.getNow());
|
group.setUpdateTime(DateUtil.getNow());
|
||||||
if (group.getId() > 0) {
|
if (group.getId() > 0) {
|
||||||
|
log.info("[REDIS消息-业务分组同步回复] 更新入库, {}", JSON.toJSONString(group));
|
||||||
groupService.update(group);
|
groupService.update(group);
|
||||||
}else {
|
}else {
|
||||||
|
log.info("[REDIS消息-业务分组同步回复] 新增入库, {}", JSON.toJSONString(group));
|
||||||
groupService.add(group);
|
groupService.add(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,9 @@ package com.genersoft.iot.vmp.service.redisMsg;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
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.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.RedisPushStreamMessage;
|
||||||
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
|
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
|
||||||
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
|
import com.genersoft.iot.vmp.streamPush.service.IStreamPushService;
|
||||||
@ -36,10 +38,20 @@ public class RedisPushStreamListMsgListener implements MessageListener {
|
|||||||
@Resource
|
@Resource
|
||||||
private IStreamPushService streamPushService;
|
private IStreamPushService streamPushService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IRedisCatchStorage redisCatchStorage;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserSetting userSetting;
|
||||||
|
|
||||||
private final ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();
|
private final ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(Message message, byte[] bytes) {
|
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()));
|
log.info("[REDIS: 推流设备列表更新]: {}", new String(message.getBody()));
|
||||||
taskQueue.offer(message);
|
taskQueue.offer(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -521,7 +521,9 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
|||||||
@Override
|
@Override
|
||||||
public String chooseOneServer(String serverId) {
|
public String chooseOneServer(String serverId) {
|
||||||
String key = VideoManagerConstants.WVP_SERVER_LIST;
|
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);
|
Set<Object> range = redisTemplate.opsForZSet().range(key, 0, 0);
|
||||||
if (range == null || range.isEmpty()) {
|
if (range == null || range.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -182,10 +182,13 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
case VLOST:
|
case VLOST:
|
||||||
for (CommonGBChannel channel : channels) {
|
for (CommonGBChannel channel : channels) {
|
||||||
if (channel.getGbPtzType() != null && channel.getGbPtzType() == 99) {
|
if (channel.getGbPtzType() != null && channel.getGbPtzType() == 99) {
|
||||||
|
CameraChannel cameraChannel = channelMapper.queryCameraChannelById(channel.getGbId());
|
||||||
if (event.getMessageType() == ChannelEvent.ChannelEventMessageType.ON) {
|
if (event.getMessageType() == ChannelEvent.ChannelEventMessageType.ON) {
|
||||||
resultListForOnline.add(channel);
|
cameraChannel.setGbStatus("ON");
|
||||||
|
resultListForOnline.add(cameraChannel);
|
||||||
}else {
|
}else {
|
||||||
resultListForOffline.add(channel);
|
cameraChannel.setGbStatus("OFF");
|
||||||
|
resultListForOffline.add(cameraChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,10 @@
|
|||||||
<div id="shared" style="margin-right: 20px;">
|
<div id="shared" style="margin-right: 20px;">
|
||||||
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
|
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
|
||||||
<el-form-item label="新密码" prop="newPassword">
|
<el-form-item label="新密码" prop="newPassword">
|
||||||
<el-input v-model="newPassword" autocomplete="off" />
|
<el-input v-model="newPassword" autocomplete="off" type="password" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确认密码" prop="confirmPassword">
|
<el-form-item label="确认密码" prop="confirmPassword">
|
||||||
<el-input v-model="confirmPassword" autocomplete="off" />
|
<el-input v-model="confirmPassword" autocomplete="off" type="password" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@ -88,6 +88,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSubmit: function() {
|
onSubmit: function() {
|
||||||
|
if (this.newPassword !== this.confirmPassword) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '两次输入密码不一致!',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$store.dispatch('user/changePasswordForAdmin', {
|
this.$store.dispatch('user/changePasswordForAdmin', {
|
||||||
password: this.newPassword,
|
password: this.newPassword,
|
||||||
userId: this.form.id
|
userId: this.form.id
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user