mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-25 06:27:50 +08:00
修复位置消息发送的BUG
This commit is contained in:
parent
e453b3b394
commit
7b4c8881aa
@ -20,6 +20,11 @@ public class MobilePosition {
|
|||||||
*/
|
*/
|
||||||
private Integer channelId;
|
private Integer channelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通道国标编号
|
||||||
|
*/
|
||||||
|
private String channelDeviceId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备名称
|
* 设备名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -371,8 +371,6 @@ public interface DeviceChannelMapper {
|
|||||||
" SET update_time=#{item.updateTime}" +
|
" SET update_time=#{item.updateTime}" +
|
||||||
"<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" +
|
"<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" +
|
||||||
"<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
|
"<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
|
||||||
"<if test='item.gbLongitude != null'>, gb_longitude=#{item.gbLongitude}</if>" +
|
|
||||||
"<if test='item.gbLatitude != null'>, gb_latitude=#{item.gbLatitude}</if>" +
|
|
||||||
"<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" +
|
"<if test='item.gpsTime != null'>, gps_time=#{item.gpsTime}</if>" +
|
||||||
"<if test='item.id > 0'>WHERE id=#{item.id}</if>" +
|
"<if test='item.id > 0'>WHERE id=#{item.id}</if>" +
|
||||||
"<if test='item.id == 0'>WHERE data_type = #{item.dataType} and data_device_id=#{item.dataDeviceId} AND device_id=#{item.deviceId}</if>" +
|
"<if test='item.id == 0'>WHERE data_type = #{item.dataType} and data_device_id=#{item.dataDeviceId} AND device_id=#{item.deviceId}</if>" +
|
||||||
|
|||||||
@ -361,6 +361,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
|||||||
for (DeviceChannel channel : deviceChannels) {
|
for (DeviceChannel channel : deviceChannels) {
|
||||||
// 向关联了该通道并且开启移动位置订阅的上级平台发送移动位置订阅消息
|
// 向关联了该通道并且开启移动位置订阅的上级平台发送移动位置订阅消息
|
||||||
mobilePosition.setChannelId(channel.getId());
|
mobilePosition.setChannelId(channel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(channel.getDeviceId());
|
||||||
try {
|
try {
|
||||||
eventPublisher.mobilePositionEventPublish(mobilePosition);
|
eventPublisher.mobilePositionEventPublish(mobilePosition);
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
|
|||||||
@ -180,6 +180,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
|||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
mobilePosition.setDeviceId(newChannel.getGbDeviceId());
|
mobilePosition.setDeviceId(newChannel.getGbDeviceId());
|
||||||
mobilePosition.setChannelId(newChannel.getGbId());
|
mobilePosition.setChannelId(newChannel.getGbId());
|
||||||
|
mobilePosition.setChannelDeviceId(newChannel.getGbDeviceId());
|
||||||
mobilePosition.setDeviceName(newChannel.getGbName());
|
mobilePosition.setDeviceName(newChannel.getGbName());
|
||||||
mobilePosition.setCreateTime(DateUtil.getNow());
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
mobilePosition.setTime(DateUtil.getNow());
|
mobilePosition.setTime(DateUtil.getNow());
|
||||||
|
|||||||
@ -106,6 +106,7 @@ public class NotifyRequestForMobilePositionProcessor extends SIPRequestProcessor
|
|||||||
deviceChannel = deviceChannelService.getOne(device.getDeviceId(), channelId);
|
deviceChannel = deviceChannelService.getOne(device.getDeviceId(), channelId);
|
||||||
if (deviceChannel != null) {
|
if (deviceChannel != null) {
|
||||||
mobilePosition.setChannelId(deviceChannel.getId());
|
mobilePosition.setChannelId(deviceChannel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(deviceChannel.getDeviceId());
|
||||||
}else {
|
}else {
|
||||||
log.error("[notify-移动位置] 未找到通道 {}/{}", device.getDeviceId(), channelId);
|
log.error("[notify-移动位置] 未找到通道 {}/{}", device.getDeviceId(), channelId);
|
||||||
break readDocument;
|
break readDocument;
|
||||||
@ -165,7 +166,7 @@ public class NotifyRequestForMobilePositionProcessor extends SIPRequestProcessor
|
|||||||
try {
|
try {
|
||||||
eventPublisher.mobilePositionEventPublish(mobilePosition);
|
eventPublisher.mobilePositionEventPublish(mobilePosition);
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
log.error("[向上级转发移动位置失败] ", e);
|
log.error("[MobilePositionEvent] 发送失败: ", e);
|
||||||
}
|
}
|
||||||
} catch (DocumentException e) {
|
} catch (DocumentException e) {
|
||||||
log.error("[收到移动位置订阅通知] 文档解析异常: \r\n{}", evt.getRequest(), e);
|
log.error("[收到移动位置订阅通知] 文档解析异常: \r\n{}", evt.getRequest(), e);
|
||||||
|
|||||||
@ -154,6 +154,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
}else {
|
}else {
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
mobilePosition.setChannelId(deviceChannel.getId());
|
mobilePosition.setChannelId(deviceChannel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(deviceChannel.getDeviceId());
|
||||||
mobilePosition.setCreateTime(DateUtil.getNow());
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
||||||
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
||||||
|
|||||||
@ -153,6 +153,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
|
|||||||
mobilePosition.setCreateTime(DateUtil.getNow());
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
||||||
mobilePosition.setChannelId(deviceChannel.getId());
|
mobilePosition.setChannelId(deviceChannel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(deviceChannel.getDeviceId());
|
||||||
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
||||||
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
||||||
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
||||||
|
|||||||
@ -90,6 +90,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
|
|||||||
mobilePosition.setDeviceId(sipMsgInfo.getDevice().getDeviceId());
|
mobilePosition.setDeviceId(sipMsgInfo.getDevice().getDeviceId());
|
||||||
|
|
||||||
mobilePosition.setChannelId(deviceChannel.getId());
|
mobilePosition.setChannelId(deviceChannel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(deviceChannel.getDeviceId());
|
||||||
String time = getText(rootElementAfterCharset, "Time");
|
String time = getText(rootElementAfterCharset, "Time");
|
||||||
if (ObjectUtils.isEmpty(time)){
|
if (ObjectUtils.isEmpty(time)){
|
||||||
mobilePosition.setTime(DateUtil.getNow());
|
mobilePosition.setTime(DateUtil.getNow());
|
||||||
|
|||||||
@ -81,6 +81,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
|
|||||||
}
|
}
|
||||||
mobilePosition.setDeviceId(device.getDeviceId());
|
mobilePosition.setDeviceId(device.getDeviceId());
|
||||||
mobilePosition.setChannelId(deviceChannel.getId());
|
mobilePosition.setChannelId(deviceChannel.getId());
|
||||||
|
mobilePosition.setChannelDeviceId(deviceChannel.getDeviceId());
|
||||||
//兼容ISO 8601格式时间
|
//兼容ISO 8601格式时间
|
||||||
String time = getText(rootElement, "Time");
|
String time = getText(rootElement, "Time");
|
||||||
if (ObjectUtils.isEmpty(time)){
|
if (ObjectUtils.isEmpty(time)){
|
||||||
|
|||||||
@ -237,13 +237,13 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
CameraChannel cameraChannel = channelMapper.queryCameraChannelById(channelId);
|
CameraChannel cameraChannel = channelMapper.queryCameraChannelById(channelId);
|
||||||
|
|
||||||
// 非移动设备类型 不发送
|
// 非移动设备类型 不发送
|
||||||
if (cameraChannel == null || cameraChannel.getGbPtzType() != 99) {
|
if (cameraChannel == null || cameraChannel.getGbPtzType() == null || cameraChannel.getGbPtzType() != 99) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 发送redis消息
|
// 发送redis消息
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("time", mobilePosition.getTime());
|
jsonObject.put("time", mobilePosition.getTime());
|
||||||
jsonObject.put("deviceId", mobilePosition.getDeviceId());
|
jsonObject.put("deviceId", mobilePosition.getChannelDeviceId());
|
||||||
jsonObject.put("longitude", mobilePosition.getLongitude());
|
jsonObject.put("longitude", mobilePosition.getLongitude());
|
||||||
jsonObject.put("latitude", mobilePosition.getLatitude());
|
jsonObject.put("latitude", mobilePosition.getLatitude());
|
||||||
jsonObject.put("altitude", mobilePosition.getAltitude());
|
jsonObject.put("altitude", mobilePosition.getAltitude());
|
||||||
@ -251,7 +251,7 @@ public class CameraChannelService implements CommandLineRunner {
|
|||||||
jsonObject.put("speed", mobilePosition.getSpeed());
|
jsonObject.put("speed", mobilePosition.getSpeed());
|
||||||
jsonObject.put("topGroupGAlias", cameraChannel.getTopGroupGAlias());
|
jsonObject.put("topGroupGAlias", cameraChannel.getTopGroupGAlias());
|
||||||
jsonObject.put("groupAlias", cameraChannel.getGroupAlias());
|
jsonObject.put("groupAlias", cameraChannel.getGroupAlias());
|
||||||
log.debug("[redis发送通知] 发送 移动设备位置信息移动位置 {}: {}", REDIS_GPS_MESSAGE, jsonObject.toString());
|
log.info("[redis发送通知] 发送 移动设备位置信息移动位置 {}: {}", REDIS_GPS_MESSAGE, jsonObject.toString());
|
||||||
redisTemplate.convertAndSend(REDIS_GPS_MESSAGE, jsonObject);
|
redisTemplate.convertAndSend(REDIS_GPS_MESSAGE, jsonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user