临时提交

This commit is contained in:
lin
2025-09-30 23:17:40 +08:00
parent 4aeca7f5dd
commit 61c64589b2
7 changed files with 51 additions and 94 deletions

View File

@@ -45,7 +45,7 @@ public class CameraChannelController {
@RequestParam(required = false) String query,
@RequestParam(required = false) String sortName,
@RequestParam(required = false) String order,
@RequestParam(required = false) String groupAlias,
@RequestParam(required = true) String groupAlias,
@RequestParam(required = false) Boolean status,
@RequestParam(required = false) Boolean containMobileDevice){
if (ObjectUtils.isEmpty(query)) {
@@ -106,9 +106,9 @@ public class CameraChannelController {
@Parameter(name = "deviceId", description = "通道编号")
@Parameter(name = "deviceCode", description = "摄像头设备国标编号, 对于非国标摄像头可以不设置此参数")
@Parameter(name = "geoCoordSys", description = "坐标系类型WGS84,GCJ02、BD09")
public CameraChannel getOne(@RequestParam(required = true) String deviceId,
public CameraChannel getOne(@RequestParam(required = true) String deviceId, @RequestParam(required = true) String deviceCode,
@RequestParam(required = false) String geoCoordSys) {
return null;
return channelService.queryOne(deviceId, deviceCode, geoCoordSys);
}
@GetMapping(value = "/camera/update")

View File

@@ -2,8 +2,11 @@ package com.genersoft.iot.vmp.web.custom.bean;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
import lombok.Getter;
import lombok.Setter;
@
@Getter
@Setter
public class CameraStreamContent extends StreamContent {
public CameraStreamContent(StreamInfo streamInfo) {

View File

@@ -1,8 +1,14 @@
package com.genersoft.iot.vmp.web.custom.service;
import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.Group;
import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
import com.genersoft.iot.vmp.gb28181.dao.GroupMapper;
import com.genersoft.iot.vmp.utils.Coordtransform;
import com.genersoft.iot.vmp.web.custom.bean.CameraChannel;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -22,6 +28,9 @@ public class CameraChannelService implements CommandLineRunner {
@Autowired
private CommonGBChannelMapper channelMapper;
@Autowired
private DeviceMapper deviceMapper;
@Autowired
private GroupMapper groupMapper;
@@ -62,4 +71,34 @@ public class CameraChannelService implements CommandLineRunner {
private List<CameraChannel> addIconPathForCameraChannelList(List<CameraChannel> channels) {
return channels;
}
public CameraChannel queryOne(String deviceId, String deviceCode, String geoCoordSys) {
CommonGBChannel channel = null;
if (deviceCode != null) {
Device device = deviceMapper.getDeviceByDeviceId(deviceId);
Assert.notNull(device, "设备不存在:" + deviceCode);
Integer deviceDbId = device.getId();
channel = channelMapper.queryByDataIdAndDeviceID(deviceDbId, deviceId);
}else {
channel = channelMapper.queryByDeviceId(deviceId);
}
if (deviceDbId != null) {
channel.setDeviceCode(deviceCode);
}
if (geoCoordSys != null && channel.getGbLongitude() != null && channel.getGbLatitude() != null
&& channel.getGbLongitude() > 0 && channel.getGbLatitude() > 0) {
if (geoCoordSys.equalsIgnoreCase("GCJ02")) {
Double[] position = Coordtransform.WGS84ToGCJ02(channel.getGbLongitude(), channel.getGbLatitude());
channel.setGbLongitude(position[0]);
channel.setGbLatitude(position[1]);
}else if (geoCoordSys.equalsIgnoreCase("BD09")) {
Double[] gcj02Position = Coordtransform.WGS84ToGCJ02(channel.getGbLongitude(), channel.getGbLatitude());
Double[] position = Coordtransform.GCJ02ToBD09(gcj02Position[0], gcj02Position[1]);
channel.setGbLongitude(position[0]);
channel.setGbLatitude(position[1]);
}
}
return channel;
}
}