通道编辑修复分组路径显示异常,支持行政区划路径显示
This commit is contained in:
@@ -86,7 +86,6 @@ public class MobilePositionServiceImpl implements IMobilePositionService {
|
||||
|
||||
/**
|
||||
* 查询最新移动位置
|
||||
* @param deviceId
|
||||
*/
|
||||
@Override
|
||||
public MobilePosition queryLatestPosition(String deviceId) {
|
||||
@@ -104,7 +103,7 @@ public class MobilePositionServiceImpl implements IMobilePositionService {
|
||||
if (userSetting.getSavePositionHistory()) {
|
||||
mobilePositionMapper.batchadd(mobilePositions);
|
||||
}
|
||||
log.debug("[移动位置订阅]更新通道位置: {}", mobilePositions.size());
|
||||
log.info("[移动位置订阅]更新通道位置: {}", mobilePositions.size());
|
||||
Map<String, Map<Integer, DeviceChannel>> updateChannelMap = new HashMap<>();
|
||||
for (MobilePosition mobilePosition : mobilePositions) {
|
||||
DeviceChannel deviceChannel = new DeviceChannel();
|
||||
|
||||
@@ -109,50 +109,49 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
continue;
|
||||
}
|
||||
|
||||
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());
|
||||
Group topGroup = aliasGroupMap.get(groupMessage.getTopGroupGAlias());
|
||||
if (topGroup == null) {
|
||||
topGroup = aliasGroupToSave.get(groupMessage.getTopGroupGAlias());
|
||||
}
|
||||
if (parentGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 虚拟组织父节点未发送或者未首先发送, {}", groupMessage.toString());
|
||||
if (topGroup == null) {
|
||||
log.info("[REDIS消息-业务分组同步回复] 业务分组信息未发送或者未首先发送, {}", groupMessage.toString());
|
||||
continue;
|
||||
}
|
||||
group.setParentId(null);
|
||||
group.setParentDeviceId(parentGroup.getDeviceId());
|
||||
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());
|
||||
}
|
||||
} else {
|
||||
group.setParentId(null);
|
||||
group.setParentDeviceId(topGroup.getDeviceId());
|
||||
group.setBusinessGroup(group.getDeviceId());
|
||||
group.setParentDeviceId(null);
|
||||
}
|
||||
} else {
|
||||
group.setParentId(null);
|
||||
group.setBusinessGroup(group.getDeviceId());
|
||||
group.setParentDeviceId(null);
|
||||
group.setUpdateTime(DateUtil.getNow());
|
||||
aliasGroupToSave.put(group.getAlias(), group);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -175,7 +174,7 @@ public class RedisGroupMsgListener implements MessageListener {
|
||||
codeType = "215";
|
||||
}
|
||||
return String.format(deviceTemplate, codeType, RandomStringUtils.insecure().next(6, false, true));
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("[REDIS消息-业务分组同步回复] 构建新的分组编号失败", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -48,10 +48,6 @@ public class RedisPushStreamListMsgListener implements MessageListener {
|
||||
|
||||
@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);
|
||||
}
|
||||
@@ -130,7 +126,7 @@ public class RedisPushStreamListMsgListener implements MessageListener {
|
||||
if (!streamPushItemForUpdate.isEmpty()) {
|
||||
log.info("修改{}条", streamPushItemForUpdate.size());
|
||||
log.info(JSONObject.toJSONString(streamPushItemForUpdate));
|
||||
streamPushService.batchUpdate(streamPushItemForUpdate);
|
||||
streamPushService.batchUpdateForRedisMsg(streamPushItemForUpdate);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("[REDIS消息-推流设备列表更新] 发现未处理的异常, \r\n{}", new String(msg.getBody()));
|
||||
|
||||
@@ -79,19 +79,19 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
|
||||
dynamicTask.stop(VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED);
|
||||
if (streamStatusMessage.isSetAllOffline()) {
|
||||
// 所有设备离线
|
||||
streamPushService.allOffline();
|
||||
streamPushService.allOfflineForRedisMsg();
|
||||
}
|
||||
if (streamStatusMessage.getOfflineStreams() != null
|
||||
&& !streamStatusMessage.getOfflineStreams().isEmpty()) {
|
||||
// 更新部分设备离线
|
||||
log.info("[REDIS: 推流设备状态变化] 更新部分设备离线: {}个", streamStatusMessage.getOfflineStreams().size());
|
||||
streamPushService.offline(streamStatusMessage.getOfflineStreams());
|
||||
streamPushService.offlineforRedisMsg(streamStatusMessage.getOfflineStreams());
|
||||
}
|
||||
if (streamStatusMessage.getOnlineStreams() != null &&
|
||||
!streamStatusMessage.getOnlineStreams().isEmpty()) {
|
||||
// 更新部分设备上线
|
||||
log.info("[REDIS: 推流设备状态变化] 更新部分设备上线: {}个", streamStatusMessage.getOnlineStreams().size());
|
||||
streamPushService.online(streamStatusMessage.getOnlineStreams());
|
||||
streamPushService.onlineForRedisMsg(streamStatusMessage.getOnlineStreams());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("[REDIS消息-推流设备状态变化] 发现未处理的异常, \r\n{}", JSON.parseObject(msg.getBody()));
|
||||
@@ -115,7 +115,7 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
|
||||
dynamicTask.startDelay(VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED, () -> {
|
||||
log.info("[REDIS消息]未收到redis回复推流设备状态,执行推流设备离线");
|
||||
// 五秒收不到请求就设置通道离线,然后通知上级离线
|
||||
streamPushService.allOffline();
|
||||
streamPushService.allOfflineForRedisMsg();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user