临时提交
This commit is contained in:
@@ -319,7 +319,7 @@ public class ChannelController {
|
||||
Assert.notNull(channelId,"参数异常");
|
||||
CommonGBChannel channel = channelService.getOne(channelId);
|
||||
Assert.notNull(channel, "通道不存在");
|
||||
channelPlayService.stopPlay(channel, channel.getStreamId());
|
||||
channelPlayService.stopPlay(channel);
|
||||
}
|
||||
|
||||
@Operation(summary = "录像查询", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
|
||||
@@ -611,6 +611,6 @@ public interface CommonGBChannelMapper {
|
||||
@Param("groupDeviceId") String groupDeviceId, @Param("online") Boolean online, @Param("containMobileDevice") Boolean containMobileDevice);
|
||||
|
||||
|
||||
CommonGBChannel queryByDataIdAndDeviceID(Integer deviceDbId, String deviceId);
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryGbChannelByChannelDeviceIdAndGbDeviceId")
|
||||
CommonGBChannel queryGbChannelByChannelDeviceIdAndGbDeviceId(String deviceId, String deviceCode);
|
||||
}
|
||||
|
||||
@@ -148,6 +148,55 @@ public class ChannelProvider {
|
||||
" left join wvp_platform_channel wpgc on wdc.id = wpgc.device_channel_id"
|
||||
;
|
||||
|
||||
private final static String BASE_SQL_FOR_CAMERA_DEVICE =
|
||||
"select\n" +
|
||||
" wdc.id as gb_id,\n" +
|
||||
" wdc.data_type,\n" +
|
||||
" wdc.data_device_id,\n" +
|
||||
" wdc.create_time,\n" +
|
||||
" wdc.update_time,\n" +
|
||||
" wdc.stream_id,\n" +
|
||||
" wdc.record_plan_id,\n" +
|
||||
" wdc.enable_broadcast,\n" +
|
||||
" wd.device_id as deviceCode,\n" +
|
||||
" coalesce(wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
||||
" coalesce(wdc.gb_name, wdc.name) as gb_name,\n" +
|
||||
" coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||
" coalesce(wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||
" coalesce(wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||
" coalesce(wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||
" coalesce(wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||
" coalesce(wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||
" coalesce(wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||
" coalesce(wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
||||
" coalesce(wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
||||
" coalesce(wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
||||
" coalesce(wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
||||
" coalesce(wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
||||
" coalesce(wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
||||
" coalesce(wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
||||
" coalesce(wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
||||
" coalesce(wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
||||
" coalesce(wdc.gb_port, wdc.port) as gb_port,\n" +
|
||||
" coalesce(wdc.gb_password, wdc.password) as gb_password,\n" +
|
||||
" coalesce(wdc.gb_status, wdc.status) as gb_status,\n" +
|
||||
" coalesce(wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
||||
" coalesce(wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
||||
" coalesce(wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
||||
" coalesce(wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
||||
" coalesce(wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
||||
" coalesce(wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
||||
" coalesce(wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
||||
" coalesce(wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
||||
" coalesce(wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
||||
" coalesce(wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
||||
" coalesce(wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
||||
" coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||
" coalesce(wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
||||
" from wvp_device_channel wdc\n" +
|
||||
" left join wvp_device wd on wdc.data_type = 1 wd.id = wdc.data_device_id"
|
||||
;
|
||||
|
||||
public String queryByDeviceId(Map<String, Object> params ){
|
||||
return BASE_SQL + " where channel_type = 0 and coalesce(gb_device_id, device_id) = #{gbDeviceId}";
|
||||
}
|
||||
@@ -511,4 +560,31 @@ public class ChannelProvider {
|
||||
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
public String queryGbChannelByChannelDeviceIdAndGbDeviceId(Map<String, Object> params ){
|
||||
StringBuilder sqlBuild = new StringBuilder();
|
||||
sqlBuild.append(BASE_SQL_FOR_CAMERA_DEVICE);
|
||||
sqlBuild.append(" where channel_type = 0 ");
|
||||
if (params.get("query") != null) {
|
||||
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%') escape '/'" +
|
||||
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') escape '/' )")
|
||||
;
|
||||
}
|
||||
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||
}
|
||||
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||
}
|
||||
if (params.get("containMobileDevice") != null && !(Boolean)params.get("containMobileDevice")) {
|
||||
sqlBuild.append(" AND gb_ptz_type != 99");
|
||||
}
|
||||
if (params.get("groupDeviceId") != null) {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{groupDeviceId}");
|
||||
}else {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) is null");
|
||||
}
|
||||
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CameraChannelController {
|
||||
private UserSetting userSetting;
|
||||
|
||||
|
||||
@GetMapping(value = "/camera/list/group")
|
||||
@GetMapping(value = "/camera/list")
|
||||
@ResponseBody
|
||||
@Operation(summary = "查询摄像机列表, 只查询当前虚拟组织下的", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "page", description = "当前页")
|
||||
@@ -82,7 +82,7 @@ public class CameraChannelController {
|
||||
return channelService.queryList(page, count, query, sortName, order, groupAlias, status, containMobileDevice);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/camera/list")
|
||||
@GetMapping(value = "/camera/list-with-child")
|
||||
@ResponseBody
|
||||
@Operation(summary = "查询摄像机列表, 查询当前虚拟组织下以及全部子节点", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "page", description = "当前页")
|
||||
@@ -139,17 +139,19 @@ public class CameraChannelController {
|
||||
@Parameter(name = "latitude", description = "纬度")
|
||||
@Parameter(name = "geoCoordSys", description = "坐标系类型:WGS84,GCJ02、BD09")
|
||||
public CameraChannel updateCamera(String deviceId,
|
||||
@RequestParam(required = false) String deviceCode,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) Double longitude,
|
||||
@RequestParam(required = false) Double latitude) {
|
||||
return null;
|
||||
@RequestParam(required = false) Double latitude,
|
||||
@RequestParam(required = false) String geoCoordSys) {
|
||||
return channelService.updateCamera(deviceId, deviceCode, name, longitude, latitude, geoCoordSys);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/camera/list/ids")
|
||||
@ResponseBody
|
||||
@Operation(summary = "根据编号查询多个摄像头信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public List<CameraChannel> queryListByNos(@RequestBody IdsQueryParam param) {
|
||||
return null;
|
||||
return channelService.queryListByNos(deviceId, deviceCode, name, longitude, latitude, geoCoordSys);;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/camera/list/box")
|
||||
|
||||
@@ -94,10 +94,10 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
private CommonGBChannel queryChannelByDeviceIdAndDeviceCode(String deviceId, String deviceCode) {
|
||||
CommonGBChannel channel = null;
|
||||
if (deviceCode != null) {
|
||||
Device device = deviceMapper.getDeviceByDeviceId(deviceId);
|
||||
Assert.notNull(device, "设备不存在:" + deviceCode);
|
||||
Integer deviceDbId = device.getId();
|
||||
channel = channelMapper.queryByDataIdAndDeviceID(deviceDbId, deviceId);
|
||||
// Device device = deviceMapper.getDeviceByDeviceId(deviceId);
|
||||
// Assert.notNull(device, "设备不存在:" + deviceCode);
|
||||
// Integer deviceDbId = device.getId();
|
||||
channel = channelMapper.queryGbChannelByChannelDeviceIdAndGbDeviceId(deviceId, deviceCode);
|
||||
}else {
|
||||
channel = channelMapper.queryByDeviceId(deviceId);
|
||||
}
|
||||
@@ -206,4 +206,7 @@ public class CameraChannelService implements CommandLineRunner {
|
||||
|
||||
channelControlService.ptz(channel, controlCode, callback);
|
||||
}
|
||||
|
||||
public CameraChannel updateCamera(String deviceId, String deviceCode, String name, Double longitude, Double latitude, String geoCoordSys) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user