|
@ -99,8 +99,8 @@ public class VideoController extends BaseController { |
|
|
public AjaxResult synchronizeIotIds() { |
|
|
public AjaxResult synchronizeIotIds() { |
|
|
// 查询未同步物联ID的摄像头设备信息
|
|
|
// 查询未同步物联ID的摄像头设备信息
|
|
|
LambdaQueryWrapper<DcDevice> query = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<DcDevice> query = new LambdaQueryWrapper<>(); |
|
|
query.eq(DcDevice::getDeviceType, DeviceTypeConstants.CAMERA) |
|
|
query.eq(DcDevice::getDeviceType, DeviceTypeConstants.CAMERA); |
|
|
.isNull(DcDevice::getIotDeviceId); |
|
|
// .isNull(DcDevice::getIotDeviceId);
|
|
|
|
|
|
|
|
|
List<DcDevice> uninitializedCameras = iDcDeviceService.list(query); |
|
|
List<DcDevice> uninitializedCameras = iDcDeviceService.list(query); |
|
|
|
|
|
|
|
@ -164,23 +164,23 @@ public class VideoController extends BaseController { |
|
|
// 遍历并更新具备匹配IP的摄像头设备物联ID
|
|
|
// 遍历并更新具备匹配IP的摄像头设备物联ID
|
|
|
List<DcDevice> devicesToUpdate = new ArrayList<>(); |
|
|
List<DcDevice> devicesToUpdate = new ArrayList<>(); |
|
|
camType1Array.forEach(item -> { |
|
|
camType1Array.forEach(item -> { |
|
|
JSONObject cameraInfo = (JSONObject) item; |
|
|
JSONObject cameraInfo = (JSONObject) item; |
|
|
// 桩号
|
|
|
// 桩号
|
|
|
String pileNum = cameraInfo.getString("pileNum"); |
|
|
String pileNum = cameraInfo.getString("pileNum"); |
|
|
// 方向
|
|
|
// 方向
|
|
|
Integer camOrientation = cameraInfo.getInteger("camOrientation"); |
|
|
int camOrientation = Integer.valueOf(cameraInfo.getString("camOrientation")); |
|
|
LaneDirectionEnum laneDirectionEnum = CameraDirectionEnum.fromCode(camOrientation).toLaneDirection(); |
|
|
LaneDirectionEnum laneDirectionEnum = CameraDirectionEnum.fromCode(camOrientation).toLaneDirection(); |
|
|
|
|
|
|
|
|
// 是否有云台控制 0 有(球机) 1 ⽆(枪机)
|
|
|
// 是否有云台控制 0 有(球机) 1 ⽆(枪机)
|
|
|
String ptzCtrl = cameraInfo.getString("ptzCtrl"); |
|
|
String ptzCtrl = cameraInfo.getString("ptzCtrl"); |
|
|
|
|
|
|
|
|
String key = pileNum + UniversalEnum.VERTICAL_LINE.getValue() + laneDirectionEnum.getValue() + UniversalEnum.VERTICAL_LINE.getValue() + ptzCtrl; |
|
|
String key = pileNum + UniversalEnum.VERTICAL_LINE.getValue() + laneDirectionEnum.getValue() + UniversalEnum.VERTICAL_LINE.getValue() + ptzCtrl; |
|
|
|
|
|
|
|
|
if (cameraMap.containsKey(key)) { |
|
|
if (cameraMap.containsKey(key)) { |
|
|
DcDevice dcDevice = cameraMap.get(key); |
|
|
DcDevice dcDevice = cameraMap.get(key); |
|
|
dcDevice.setIotDeviceId(cameraInfo.getString("camId")); |
|
|
dcDevice.setIotDeviceId(cameraInfo.getString("camId")); |
|
|
devicesToUpdate.add(dcDevice); |
|
|
devicesToUpdate.add(dcDevice); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 批量更新摄像头设备的物联ID
|
|
|
// 批量更新摄像头设备的物联ID
|
|
@ -235,7 +235,7 @@ public class VideoController extends BaseController { |
|
|
/*** |
|
|
/*** |
|
|
* 根据相机中的设备状态,修改数据平台设备的设备状态 |
|
|
* 根据相机中的设备状态,修改数据平台设备的设备状态 |
|
|
*/ |
|
|
*/ |
|
|
@Scheduled(cron = "0 0/5 * * * ?") |
|
|
//@Scheduled(cron = "0 0/5 * * * ?")
|
|
|
@PostMapping("/updateDeviceState") |
|
|
@PostMapping("/updateDeviceState") |
|
|
public void updateDeviceState() throws HttpException, IOException { |
|
|
public void updateDeviceState() throws HttpException, IOException { |
|
|
logger.debug("开始执行:同步数据平台视频设备设备的设备状态!!"); |
|
|
logger.debug("开始执行:同步数据平台视频设备设备的设备状态!!"); |
|
@ -246,6 +246,7 @@ public class VideoController extends BaseController { |
|
|
// JSONObject qiLuGaoSu = JSONObject.parseObject(JSONArray.parseArray(dataChildren.get("children").toString()).get(UniversalEnum.ZERO.getNumber()).toString());
|
|
|
// JSONObject qiLuGaoSu = JSONObject.parseObject(JSONArray.parseArray(dataChildren.get("children").toString()).get(UniversalEnum.ZERO.getNumber()).toString());
|
|
|
// JSONObject jiHeYunGuan = JSONObject.parseObject(JSONArray.parseArray(qiLuGaoSu.get("children").toString()).get(UniversalEnum.ZERO.getNumber()).toString());
|
|
|
// JSONObject jiHeYunGuan = JSONObject.parseObject(JSONArray.parseArray(qiLuGaoSu.get("children").toString()).get(UniversalEnum.ZERO.getNumber()).toString());
|
|
|
// JSONArray jiHeYunGuanG35 = JSONArray.parseArray(jiHeYunGuan.get("children").toString());
|
|
|
// JSONArray jiHeYunGuanG35 = JSONArray.parseArray(jiHeYunGuan.get("children").toString());
|
|
|
|
|
|
|
|
|
JSONArray data = cameraData.getJSONArray("data"); |
|
|
JSONArray data = cameraData.getJSONArray("data"); |
|
|
JSONObject children = data.getJSONObject(0); |
|
|
JSONObject children = data.getJSONObject(0); |
|
|
JSONArray jsonObject = children.getJSONArray("children"); |
|
|
JSONArray jsonObject = children.getJSONArray("children"); |
|
@ -292,6 +293,7 @@ public class VideoController extends BaseController { |
|
|
// device.setIotDeviceId(item.get("camId").toString());
|
|
|
// device.setIotDeviceId(item.get("camId").toString());
|
|
|
// list.add(device);
|
|
|
// list.add(device);
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
iDcDeviceService.batchUpdate(list); |
|
|
iDcDeviceService.batchUpdate(list); |
|
|
|
|
|
|
|
|
//更新中间库的设备状态
|
|
|
//更新中间库的设备状态
|
|
@ -526,7 +528,21 @@ public class VideoController extends BaseController { |
|
|
|
|
|
|
|
|
return AjaxResult.success(result); |
|
|
return AjaxResult.success(result); |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* 根据桩号查询附近收费站摄像机 |
|
|
|
|
|
*/ |
|
|
|
|
|
@ApiOperation("根据桩号查询附近收费站摄像机") |
|
|
|
|
|
@GetMapping(value = "/tollStationList") |
|
|
|
|
|
public Object selectTollStationCamPile(@ApiParam(value = "桩号", name = "pileNum", required = true) String pileNum) throws HttpException, IOException { |
|
|
|
|
|
Map<String,Object> result = new HashMap<>(); |
|
|
|
|
|
Integer pileNumDistance = pileNumTransformMetre(pileNum); |
|
|
|
|
|
String startMileage = String.valueOf(pileNumDistance - UniversalEnum.TWO_THOUSAND.getNumber()); |
|
|
|
|
|
String endMileage = String.valueOf(pileNumDistance + UniversalEnum.TWO_THOUSAND.getNumber()); |
|
|
|
|
|
List<DcDevice> tollStationList = iDcDeviceService.selectTollStationCamPile(UniversalEnum.THREE.getValue(),startMileage,endMileage); |
|
|
|
|
|
result.put("tollStationList",tollStationList); |
|
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(result); |
|
|
|
|
|
} |
|
|
/** |
|
|
/** |
|
|
* 获取视频流信息 |
|
|
* 获取视频流信息 |
|
|
*/ |
|
|
*/ |
|
|