| | |
| | | import com.ruoyi.alarmpoints.tube.mapper.ArdTubesDetailsMapper; |
| | | import com.ruoyi.alarmpoints.tube.mapper.ArdTubesMapper; |
| | | import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; |
| | | import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; |
| | | import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; |
| | | import com.ruoyi.alarmpoints.well.mapper.ArdWellGuideCameraMapper; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.ConfigUtils; |
| | |
| | | private QueueHandler queueHandler; |
| | | @Resource |
| | | private ArdEquipRadarMapper ardEquipRadarMapper; |
| | | @Resource |
| | | private ArdWellGuideCameraMapper ardWellGuideCameraMapper; |
| | | |
| | | //endregion |
| | | |
| | | /** |
| | |
| | | if (StringUtils.isNull(longitude) || StringUtils.isNull(latitude)) { |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{longitude, latitude}; |
| | | String cameraId = getCameraByNear(new double[]{ardAlarmTube.getLongitude(), ardAlarmTube.getLatitude()}); |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(longitude).setLatitude(latitude); |
| | | String cameraId = getCameraByNear(guidePoint); |
| | | if (StringUtils.isNotEmpty(cameraId)) { |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setAlarmId(cameraId) |
| | | .setCameraId(cameraId) |
| | | .setAlarmId(ardAlarmTube.getId()) |
| | | .setAlarmType("sys_tube_leak") |
| | | .setReceiveTime(ardAlarmTube.getCreateTime()) |
| | | .setTargetPosition(coordinate); |
| | | .setTargetPosition(guidePoint); |
| | | messagesEnqueued(guideDataDto); |
| | | } |
| | | //endregion |
| | |
| | | if (StringUtils.isNull(ardAlarmExternal.getLongitude()) || StringUtils.isNull(ardAlarmExternal.getLatitude())) { |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmExternal.getLongitude(), ardAlarmExternal.getLatitude()};//引导坐标 |
| | | String cameraId = getCameraByNear(coordinate);//最近相机ID |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(ardAlarmExternal.getLongitude()).setLatitude(ardAlarmExternal.getLatitude()); |
| | | //引导坐标 |
| | | String cameraId = getCameraByNear(guidePoint);//最近相机ID |
| | | if (StringUtils.isNotEmpty(cameraId)) { |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setAlarmId(cameraId) |
| | | .setCameraId(cameraId) |
| | | .setAlarmId(ardAlarmExternal.getId()) |
| | | .setAlarmType("sys_external") |
| | | .setReceiveTime(ardAlarmExternal.getCreateTime()) |
| | | .setTargetPosition(coordinate) |
| | | .setTargetPosition(guidePoint) |
| | | .setWellId(well.getId()); |
| | | messagesEnqueued(guideDataDto); |
| | | } |
| | |
| | | if (StringUtils.isNull(ardAlarmAccess.getLongitude()) || StringUtils.isNull(ardAlarmAccess.getLatitude())) { |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmAccess.getLongitude(), ardAlarmAccess.getLatitude()};//引导坐标 |
| | | String cameraId = getCameraByNear(coordinate);//最近相机ID |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(ardAlarmAccess.getLongitude()).setLatitude(ardAlarmAccess.getLatitude());//引导坐标 |
| | | String cameraId = getCameraByNear(guidePoint);//最近相机ID |
| | | if (StringUtils.isNotEmpty(cameraId)) { |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setAlarmId(cameraId) |
| | | .setCameraId(cameraId) |
| | | .setAlarmId(ardAlarmAccess.getId()) |
| | | .setAlarmType("sys_external") |
| | | .setReceiveTime(ardAlarmAccess.getCreateTime()) |
| | | .setTargetPosition(coordinate); |
| | | .setTargetPosition(guidePoint); |
| | | messagesEnqueued(guideDataDto); |
| | | } |
| | | //endregion |
| | |
| | | } |
| | | GuideTask guideTask = new GuideTask(); |
| | | guideTask.setCameraId(cameraId);//相机ID |
| | | guideTask.setIsGuidePTZ(guideDataDto.getIsGuidePTZ()); |
| | | if(guideTask.getIsGuidePTZ()) |
| | | { |
| | | guideTask.setTargetPTZ(guideDataDto.getGuidePTZ()); |
| | | } |
| | | String alarmType = guideDataDto.getAlarmType(); |
| | | switch (alarmType) { |
| | | case "运动目标检测": |
| | |
| | | /** |
| | | * 获取附近开启报警引导功能光电 |
| | | */ |
| | | private String getCameraByNear(double[] targetPosition) { |
| | | private String getCameraByNear(GuidePoint guidePoint) { |
| | | String minDistanceCameraId = ""; |
| | | try { |
| | | //获取所有大光电 |
| | |
| | | continue; |
| | | } |
| | | double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()}; |
| | | double[] targetPosition = new double[]{guidePoint.getLongitude(), guidePoint.getLatitude()}; |
| | | double distance = GisUtil.getDistance(targetPosition, camPosition); |
| | | if (distance != 0.0 && distance <= camera.getCamMaxVisibleDistance()) { |
| | | distanceMap.put(camera.getId(), distance); |
| | |
| | | |
| | | //获取相机引导入队 |
| | | private void getCameraGuideToQueue(GuideDataDto guideDataDto) { |
| | | //获取兴趣点关联的相机 |
| | | ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(guideDataDto.getWellId()); |
| | | ArdWellGuideCamera ardWellGuideCamera = new ArdWellGuideCamera(); |
| | | ardWellGuideCamera.setWellId(well.getId()); |
| | | List<ArdWellGuideCamera> ardWellGuideCameras = ardWellGuideCameraMapper.selectArdWellGuideCameraList(ardWellGuideCamera); |
| | | if (ardWellGuideCameras.size() > 0) { |
| | | //优先获取井关联相机的预置位 |
| | | ardWellGuideCamera = ardWellGuideCameras.get(0); |
| | | guideDataDto.setIsGuidePTZ(true); |
| | | guideDataDto.setCameraId(ardWellGuideCamera.getCameraId()); |
| | | guideDataDto.setGuidePTZ(new GuidePTZ() |
| | | .setP1(ardWellGuideCamera.getP1()) |
| | | .setT1(ardWellGuideCamera.getT1()) |
| | | .setZ1(ardWellGuideCamera.getZ1()) |
| | | .setP2(ardWellGuideCamera.getP2()) |
| | | .setT2(ardWellGuideCamera.getT2()) |
| | | .setZ2(ardWellGuideCamera.getZ2()) |
| | | ); |
| | | messagesEnqueued(guideDataDto); |
| | | } else { |
| | | //获取雷达所在塔上的大光电 |
| | | ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(guideDataDto.getRadarId()); |
| | | if (StringUtils.isNotNull(cameraWithTower)) { |
| | | log.debug("获取到雷达塔上的光电:" + cameraWithTower.getId()); |
| | | //如果雷达塔上有光电 |
| | | guideDataDto.setIsGuidePTZ(false); |
| | | guideDataDto.setCameraId(cameraWithTower.getId()); |
| | | messagesEnqueued(guideDataDto); |
| | | } else { |
| | | log.debug("未获取到雷达塔上的光电,无法引导"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | log.debug("坐标为空不引导"); |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmRadarMove.getLongitude(), ardAlarmRadarMove.getLatitude()};//报警坐标 |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(ardAlarmRadarMove.getLongitude()) |
| | | .setLatitude(ardAlarmRadarMove.getLatitude()); |
| | | //报警坐标 |
| | | //引导入队 |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setRadarId(ardAlarmRadarMove.getRadarId()) |
| | |
| | | .setAlarmType(ardAlarmRadarMove.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarMove.getCreateTime()) |
| | | .setWellId(ardAlarmRadarMove.getWellId()) |
| | | .setTargetPosition(coordinate); |
| | | .setTargetPosition(guidePoint); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | | } |
| | | |
| | |
| | | log.debug("坐标为空不引导"); |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmRadarFire.getLongitude(), ardAlarmRadarFire.getLatitude()};//报警坐标 |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(ardAlarmRadarFire.getLongitude())//报警坐标 |
| | | .setLatitude(ardAlarmRadarFire.getLatitude()); |
| | | //引导入队 |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setRadarId(ardAlarmRadarFire.getRadarId()) |
| | |
| | | .setAlarmType(ardAlarmRadarFire.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarFire.getCreateTime()) |
| | | .setWellId(ardAlarmRadarFire.getWellId()) |
| | | .setTargetPosition(coordinate); |
| | | .setTargetPosition(guidePoint); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | | } |
| | | |
| | |
| | | log.debug("坐标为空不引导"); |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmRadarPump.getLongitude(), ardAlarmRadarPump.getLatitude()};//报警坐标 |
| | | GuidePoint guidePoint = new GuidePoint().setLongitude(ardAlarmRadarPump.getLongitude()) |
| | | .setLatitude(ardAlarmRadarPump.getLatitude());//报警坐标 |
| | | //引导入队 |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | | .setRadarId(ardAlarmRadarPump.getRadarId()) |
| | |
| | | .setAlarmType(ardAlarmRadarPump.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarPump.getCreateTime()) |
| | | .setWellId(ardAlarmRadarPump.getWellId()) |
| | | .setTargetPosition(coordinate); |
| | | .setTargetPosition(guidePoint); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | | } |
| | | |