修复翻页未重置页码的问题
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user