修复翻页未重置页码的问题
This commit is contained in:
@@ -328,11 +328,26 @@ public interface GroupMapper {
|
||||
@Delete("DELETE FROM wvp_common_group where alias is not null")
|
||||
void deleteHasAlias();
|
||||
|
||||
@Update(" UPDATE wvp_common_group g1" +
|
||||
@Update(value = " UPDATE wvp_common_group g1" +
|
||||
" JOIN wvp_common_group g2" +
|
||||
" ON g1.parent_device_id = g2.device_id" +
|
||||
" SET g1.parent_id = g2.id" +
|
||||
" WHERE g1.alias IS NOT NULL;")
|
||||
" WHERE g1.alias IS NOT NULL;", databaseId = "mysql")
|
||||
@Update(value = " UPDATE wvp_common_group g1" +
|
||||
" JOIN wvp_common_group g2" +
|
||||
" ON g1.parent_device_id = g2.device_id" +
|
||||
" SET g1.parent_id = g2.id" +
|
||||
" WHERE g1.alias IS NOT NULL;", databaseId = "h2")
|
||||
@Update(value = " UPDATE wvp_common_group AS g1" +
|
||||
" SET parent_id = g2.id" +
|
||||
" FROM wvp_common_group AS g2" +
|
||||
" WHERE g1.parent_device_id = g2.device_id" +
|
||||
" AND g1.alias IS NOT NULL;", databaseId = "kingbase")
|
||||
@Update(value = " UPDATE wvp_common_group AS g1" +
|
||||
" SET parent_id = g2.id" +
|
||||
" FROM wvp_common_group AS g2" +
|
||||
" WHERE g1.parent_device_id = g2.device_id" +
|
||||
" AND g1.alias IS NOT NULL;", databaseId = "postgresql")
|
||||
void fixParentId();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.genersoft.iot.vmp.gb28181.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper;
|
||||
@@ -322,7 +321,6 @@ public class GroupServiceImpl implements IGroupService {
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveByAlias(Collection<Group> groups) {
|
||||
log.info("[存储分组数据] {}", JSONObject.toJSONString(groups));
|
||||
// 清空别名数据
|
||||
groupManager.deleteHasAlias();
|
||||
// 写入新数据
|
||||
|
||||
@@ -671,13 +671,13 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean stopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc) {
|
||||
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaInfo.getType());
|
||||
public boolean stopSendRtp(MediaServer mediaServer, String app, String stream, String ssrc) {
|
||||
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServer.getType());
|
||||
if (mediaNodeServerService == null) {
|
||||
log.info("[stopSendRtp] 失败, mediaServer的类型: {},未找到对应的实现类", mediaInfo.getType());
|
||||
log.info("[stopSendRtp] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
||||
return false;
|
||||
}
|
||||
return mediaNodeServerService.stopSendRtp(mediaInfo, app, stream, ssrc);
|
||||
return mediaNodeServerService.stopSendRtp(mediaServer, app, stream, ssrc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,7 +104,7 @@ public class MobilePositionServiceImpl implements IMobilePositionService {
|
||||
if (userSetting.getSavePositionHistory()) {
|
||||
mobilePositionMapper.batchadd(mobilePositions);
|
||||
}
|
||||
log.info("[移动位置订阅]更新通道位置: {}", mobilePositions.size());
|
||||
log.debug("[移动位置订阅]更新通道位置: {}", mobilePositions.size());
|
||||
Map<String, Map<Integer, DeviceChannel>> updateChannelMap = new HashMap<>();
|
||||
for (MobilePosition mobilePosition : mobilePositions) {
|
||||
DeviceChannel deviceChannel = new DeviceChannel();
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RedisGpsMsgListener implements MessageListener {
|
||||
GPSMsgInfo gpsMsgInfo = JSON.parseObject(msg.getBody(), GPSMsgInfo.class);
|
||||
gpsMsgInfo.setStored(false);
|
||||
gpsMsgInfo.setTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(gpsMsgInfo.getTime()));
|
||||
log.info("[REDIS的位置变化通知], {}", JSON.toJSONString(gpsMsgInfo));
|
||||
log.debug("[REDIS的位置变化通知], {}", JSON.toJSONString(gpsMsgInfo));
|
||||
// 只是放入redis缓存起来
|
||||
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.genersoft.iot.vmp.service.redisMsg;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
@@ -10,7 +11,6 @@ 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.utils.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -35,10 +35,10 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
@Component
|
||||
public class RedisGroupMsgListener implements MessageListener {
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IGroupService groupService;
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Autowired
|
||||
@@ -109,48 +109,49 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
continue;
|
||||
}
|
||||
|
||||
Group topGroup = aliasGroupMap.get(groupMessage.getTopGroupGAlias());
|
||||
if (topGroup == null) {
|
||||
topGroup = aliasGroupToSave.get(groupMessage.getTopGroupGAlias());
|
||||
Group topGroup = aliasGroupMap.get(groupMessage.getTopGroupGAlias());
|
||||
if (topGroup == null) {
|
||||
topGroup = aliasGroupToSave.get(groupMessage.getTopGroupGAlias());
|
||||
}
|
||||
if (topGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 业务分组信息未发送或者未首先发送, {}", groupMessage.toString());
|
||||
continue;
|
||||
}
|
||||
group.setBusinessGroup(topGroup.getDeviceId());
|
||||
if (groupMessage.getParentGAlias() != null) {
|
||||
Group parentGroup = aliasGroupMap.get(groupMessage.getParentGAlias());
|
||||
if (parentGroup == null) {
|
||||
parentGroup = aliasGroupToSave.get(groupMessage.getParentGAlias());
|
||||
}
|
||||
if (topGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 业务分组信息未发送或者未首先发送, {}", groupMessage.toString());
|
||||
if (parentGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 虚拟组织父节点未发送或者未首先发送, {}", groupMessage.toString());
|
||||
continue;
|
||||
}
|
||||
group.setBusinessGroup(topGroup.getDeviceId());
|
||||
if (groupMessage.getParentGAlias() != null) {
|
||||
Group parentGroup = aliasGroupMap.get(groupMessage.getParentGAlias());
|
||||
if (parentGroup == null) {
|
||||
parentGroup = aliasGroupToSave.get(groupMessage.getParentGAlias());
|
||||
}
|
||||
if (parentGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 虚拟组织父节点未发送或者未首先发送, {}", groupMessage.toString());
|
||||
continue;
|
||||
}
|
||||
group.setParentId(null);
|
||||
group.setParentDeviceId(parentGroup.getDeviceId());
|
||||
} else {
|
||||
group.setParentId(null);
|
||||
group.setParentDeviceId(topGroup.getDeviceId());
|
||||
}
|
||||
group.setParentId(null);
|
||||
group.setParentDeviceId(parentGroup.getDeviceId());
|
||||
} else {
|
||||
group.setParentId(null);
|
||||
group.setBusinessGroup(group.getDeviceId());
|
||||
group.setParentDeviceId(null);
|
||||
group.setParentDeviceId(topGroup.getDeviceId());
|
||||
}
|
||||
group.setUpdateTime(DateUtil.getNow());
|
||||
aliasGroupToSave.put(group.getAlias(), group);
|
||||
} else {
|
||||
group.setParentId(null);
|
||||
group.setBusinessGroup(group.getDeviceId());
|
||||
group.setParentDeviceId(null);
|
||||
}
|
||||
// 存储分组数据
|
||||
groupService.saveByAlias(aliasGroupToSave.values());
|
||||
|
||||
} catch (ControllerException e) {
|
||||
log.warn("[REDIS消息-业务分组同步回复] 失败, \r\n{}", e.getMsg());
|
||||
} catch (Exception e) {
|
||||
log.warn("[REDIS消息-业务分组同步回复] 发现未处理的异常, \r\n{}", new String(msg.getBody()));
|
||||
log.error("[REDIS消息-业务分组同步回复] 异常内容: ", e);
|
||||
group.setUpdateTime(DateUtil.getNow());
|
||||
aliasGroupToSave.put(group.getAlias(), group);
|
||||
}
|
||||
log.info("[业务分组同步回复-存储分组数据] {}", JSONObject.toJSONString(aliasGroupToSave.values()));
|
||||
// 存储分组数据
|
||||
groupService.saveByAlias(aliasGroupToSave.values());
|
||||
|
||||
} catch (ControllerException e) {
|
||||
log.warn("[REDIS消息-业务分组同步回复] 失败, \r\n{}", e.getMsg());
|
||||
} catch (Exception e) {
|
||||
log.warn("[REDIS消息-业务分组同步回复] 发现未处理的异常, \r\n{}", new String(msg.getBody()));
|
||||
log.error("[REDIS消息-业务分组同步回复] 异常内容: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,7 +174,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
if (isTop) {
|
||||
codeType = "215";
|
||||
}
|
||||
return String.format(deviceTemplate, codeType, RandomStringUtils.secureStrong().next(6, false, true));
|
||||
return String.format(deviceTemplate, codeType, RandomStringUtils.insecure().next(6, false, true));
|
||||
}catch (Exception e) {
|
||||
log.error("[REDIS消息-业务分组同步回复] 构建新的分组编号失败", e);
|
||||
return null;
|
||||
|
||||
@@ -157,4 +157,9 @@ public interface StreamPushMapper {
|
||||
"</foreach>" +
|
||||
"</script>"})
|
||||
int batchUpdate(List<StreamPush> streamPushItemForUpdate);
|
||||
|
||||
@Delete(" DELETE FROM wvp_stream_push st " +
|
||||
" LEFT join wvp_device_channel wdc on wdc.data_type = 2 and st.id = wdc.data_device_id " +
|
||||
" where wdc.id is null and st.server_id = #{id}")
|
||||
void deleteWithoutGBId(String id);
|
||||
}
|
||||
|
||||
@@ -287,6 +287,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
}
|
||||
if (mediaServer != null) {
|
||||
mediaServerService.closeStreams(mediaServer, streamPush.getApp(), streamPush.getStream());
|
||||
mediaServerService.stopSendRtp(mediaServer, streamPush.getApp(), streamPush.getStream(), null);
|
||||
}
|
||||
streamPush.setPushing(false);
|
||||
if (userSetting.getUsePushingAsStatus()) {
|
||||
@@ -296,7 +297,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
}
|
||||
}
|
||||
sendRtpServerService.deleteByStream(streamPush.getStream());
|
||||
mediaServerService.stopSendRtp(mediaServer, streamPush.getApp(), streamPush.getStream(), null);
|
||||
streamPush.setUpdateTime(DateUtil.getNow());
|
||||
streamPushMapper.update(streamPush);
|
||||
return true;
|
||||
@@ -383,6 +383,12 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
redisCatchStorage.removePushListItem(mediaInfo.getApp(), mediaInfo.getStream(), mediaServer.getId());
|
||||
}
|
||||
}
|
||||
if (!pushItemMap.isEmpty()) {
|
||||
for (StreamPush streamPush : pushItemMap.values()) {
|
||||
// 如果没有国标编号,从数据库中删除
|
||||
delete(streamPush.getId());
|
||||
}
|
||||
}
|
||||
|
||||
Collection<StreamAuthorityInfo> streamAuthorityInfos = streamAuthorityInfoInfoMap.values();
|
||||
if (!streamAuthorityInfos.isEmpty()) {
|
||||
@@ -402,11 +408,8 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
stop(streamPushItem);
|
||||
}
|
||||
}
|
||||
// // 移除没有GBId的推流
|
||||
// streamPushMapper.deleteWithoutGBId(mediaServerId);
|
||||
// // 其他的流设置未启用
|
||||
// streamPushMapper.updateStatusByMediaServerId(mediaServerId, false);
|
||||
// streamProxyMapper.updateStatusByMediaServerId(mediaServerId, false);
|
||||
// 移除没有GBId的推流
|
||||
streamPushMapper.deleteWithoutGBId(mediaServer.getId());
|
||||
// 发送流停止消息
|
||||
String type = "PUSH";
|
||||
// 发送redis消息
|
||||
|
||||
@@ -626,5 +626,11 @@ public class CameraChannelController {
|
||||
return channelService.queryMeetingChannelList(topGroupAlias);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/test")
|
||||
@ResponseBody
|
||||
public SYMember test(String device){
|
||||
return channelService.getMember(device);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import lombok.Setter;
|
||||
public class SYMember {
|
||||
|
||||
private String no;
|
||||
private String unicodeNo;
|
||||
private String blockId;
|
||||
private Long unicodeNo;
|
||||
private Long blockId;
|
||||
private String unitNo;
|
||||
private String terminalMemberStatus;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
jsonObject.put("type", ChannelEvent.ChannelEventMessageType.DEL);
|
||||
jsonObject.put("list", resultListForDelete);
|
||||
log.info("[SY-redis发送通知-DEL] 发送 通道信息变化 {}: {}", REDIS_CHANNEL_MESSAGE, jsonObject.toString());
|
||||
redisTemplate.convertAndSend(REDIS_CHANNEL_MESSAGE, jsonObject);
|
||||
redisTemplateForString.convertAndSend(REDIS_CHANNEL_MESSAGE, jsonObject.toString());
|
||||
}
|
||||
if (!resultListForAdd.isEmpty()) {
|
||||
sendChannelMessage(resultListForAdd, ChannelEvent.ChannelEventMessageType.ADD);
|
||||
@@ -272,7 +272,7 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
private void sendMemberStatusMessage(List<SYMember> memberList) {
|
||||
String jsonString = JSONObject.toJSONString(memberList);
|
||||
log.info("[SY-redis发送通知] 发送 状态变化 {}: {}", REDIS_MEMBER_STATUS_MESSAGE, jsonString);
|
||||
redisTemplate.convertAndSend(REDIS_MEMBER_STATUS_MESSAGE, jsonString);
|
||||
redisTemplateForString.convertAndSend(REDIS_MEMBER_STATUS_MESSAGE, jsonString);
|
||||
}
|
||||
|
||||
private void sendChannelMessage(List<CommonGBChannel> channelList, ChannelEvent.ChannelEventMessageType type) {
|
||||
@@ -284,7 +284,7 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
jsonObject.put("type", type);
|
||||
jsonObject.put("list", cameraChannelList);
|
||||
log.info("[SY-redis发送通知-{}] 发送 通道信息变化 {}: {}", type, REDIS_CHANNEL_MESSAGE, jsonObject.toString());
|
||||
redisTemplate.convertAndSend(REDIS_CHANNEL_MESSAGE, jsonObject);
|
||||
redisTemplateForString.convertAndSend(REDIS_CHANNEL_MESSAGE, jsonObject.toString());
|
||||
}
|
||||
|
||||
// 监听GPS消息,如果是移动设备则发送redis消息
|
||||
@@ -312,17 +312,17 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
jsonObject.put("speed", mobilePosition.getSpeed());
|
||||
jsonObject.put("blockId", member.getBlockId());
|
||||
log.info("[SY-redis发送通知-移动设备位置信息] 发送 {}: {}", REDIS_GPS_MESSAGE, jsonObject.toString());
|
||||
redisTemplate.convertAndSend(REDIS_GPS_MESSAGE, jsonObject);
|
||||
redisTemplateForString.convertAndSend(REDIS_GPS_MESSAGE, jsonObject.toString());
|
||||
}
|
||||
|
||||
private SYMember getMember(String deviceId) {
|
||||
public SYMember getMember(String deviceId) {
|
||||
// 从redis补充信息
|
||||
String key = MOBILE_CHANNEL_PREFIX + deviceId;
|
||||
String memberJsonString = (String) redisTemplate.opsForValue().get(key);
|
||||
if (memberJsonString == null) {
|
||||
JSONObject jsonObject = (JSONObject)redisTemplate.opsForValue().get(key);
|
||||
if (jsonObject == null) {
|
||||
return null;
|
||||
}
|
||||
return JSONObject.parseObject(memberJsonString, SYMember.class);
|
||||
return JSONObject.parseObject(jsonObject.toString(), SYMember.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.initData()
|
||||
this.updateLooper = setInterval(this.initData, 10000)
|
||||
this.updateLooper = setInterval(this.getList, 10000)
|
||||
},
|
||||
destroyed() {
|
||||
this.$destroy('videojs')
|
||||
@@ -216,6 +216,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initData: function() {
|
||||
this.currentPage = 1
|
||||
this.total = 0
|
||||
this.getList()
|
||||
},
|
||||
currentChange: function(val) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
placeholder="关键字"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@input="getPlatformList"
|
||||
@input="queryList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -292,6 +292,11 @@ export default {
|
||||
this.count = val
|
||||
this.getPlatformList()
|
||||
},
|
||||
queryList: function() {
|
||||
this.currentPage = 1
|
||||
this.total = 0
|
||||
this.getPlatformList()
|
||||
},
|
||||
getPlatformList: function() {
|
||||
this.$store.dispatch('platform/query', {
|
||||
count: this.count,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
placeholder="关键字"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@input="getStreamProxyList"
|
||||
@input="queryList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流媒体">
|
||||
@@ -18,7 +18,7 @@
|
||||
style="margin-right: 1rem;"
|
||||
placeholder="请选择"
|
||||
default-first-option
|
||||
@change="getStreamProxyList"
|
||||
@change="queryList"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
@@ -35,7 +35,7 @@
|
||||
style="margin-right: 1rem;"
|
||||
placeholder="请选择"
|
||||
default-first-option
|
||||
@change="getStreamProxyList"
|
||||
@change="queryList"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="正在拉流" value="true" />
|
||||
@@ -189,6 +189,11 @@ export default {
|
||||
this.count = val
|
||||
this.getStreamProxyList()
|
||||
},
|
||||
queryList: function() {
|
||||
this.currentPage = 1
|
||||
this.total = 0
|
||||
this.getStreamProxyList()
|
||||
},
|
||||
getStreamProxyList: function() {
|
||||
this.$store.dispatch('streamProxy/queryList', {
|
||||
page: this.currentPage,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
placeholder="关键字"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@input="getPushList"
|
||||
@input="queryList"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流媒体">
|
||||
@@ -18,7 +18,7 @@
|
||||
style="margin-right: 1rem;"
|
||||
placeholder="请选择"
|
||||
default-first-option
|
||||
@change="getPushList"
|
||||
@change="queryList"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
@@ -35,7 +35,7 @@
|
||||
style="margin-right: 1rem;"
|
||||
placeholder="请选择"
|
||||
default-first-option
|
||||
@change="getPushList"
|
||||
@change="queryList"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="推流中" value="true" />
|
||||
@@ -206,6 +206,11 @@ export default {
|
||||
this.count = val
|
||||
this.getPushList()
|
||||
},
|
||||
queryList: function() {
|
||||
this.currentPage = 1
|
||||
this.total = 0
|
||||
this.getPushList()
|
||||
},
|
||||
getPushList: function() {
|
||||
this.$store.dispatch('streamPush/queryList', {
|
||||
page: this.currentPage,
|
||||
|
||||
Reference in New Issue
Block a user