修复数据错误导致无法转成JSON返回 #919

pull/939/head
648540858 2023-07-06 15:35:59 +08:00
parent e163cf4d20
commit e4754af417
3 changed files with 31 additions and 5 deletions

View File

@ -244,6 +244,9 @@ public class Device {
}
public Integer getStreamModeForParam() {
if (streamMode == null) {
return 0;
}
if (streamMode.equalsIgnoreCase("UDP")) {
return 0;
}else if (streamMode.equalsIgnoreCase("TCP-PASSIVE")) {

View File

@ -166,7 +166,18 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
device.setGeoCoordSys("WGS84");
device.setDeviceId(deviceId);
device.setOnLine(false);
}else {
if (ObjectUtils.isEmpty(device.getStreamMode())) {
device.setStreamMode("UDP");
}
if (ObjectUtils.isEmpty(device.getCharset())) {
device.setCharset("GB2312");
}
if (ObjectUtils.isEmpty(device.getGeoCoordSys())) {
device.setGeoCoordSys("WGS84");
}
}
device.setIp(remoteAddressInfo.getIp());
device.setPort(remoteAddressInfo.getPort());
device.setHostAddress(remoteAddressInfo.getIp().concat(":").concat(String.valueOf(remoteAddressInfo.getPort())));

View File

@ -493,8 +493,12 @@ public class DeviceServiceImpl implements IDeviceService {
if (!ObjectUtils.isEmpty(device.getMediaServerId())) {
deviceInStore.setMediaServerId(device.getMediaServerId());
}
deviceInStore.setSdpIp(device.getSdpIp());
if (!ObjectUtils.isEmpty(device.getCharset())) {
deviceInStore.setCharset(device.getCharset());
}
if (!ObjectUtils.isEmpty(device.getSdpIp())) {
deviceInStore.setSdpIp(device.getSdpIp());
}
// 目录订阅相关的信息
if (device.getSubscribeCycleForCatalog() > 0) {
@ -525,10 +529,18 @@ public class DeviceServiceImpl implements IDeviceService {
removeMobilePositionSubscribe(deviceInStore);
}
}
if (deviceInStore.getGeoCoordSys() != null) {
// 坐标系变化需要重新计算GCJ02坐标和WGS84坐标
if (!deviceInStore.getGeoCoordSys().equals(device.getGeoCoordSys())) {
updateDeviceChannelGeoCoordSys(device);
}
}else {
device.setGeoCoordSys("WGS84");
}
if (device.getCharset() == null) {
device.setCharset("GB2312");
}
// 更新redis
redisCatchStorage.updateDevice(device);
deviceMapper.updateCustom(device);