ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideCameraDto.java
New file @@ -0,0 +1,35 @@ package com.ruoyi.alarm.global.domain; import lombok.Data; import lombok.experimental.Accessors; /** * @Description: * @ClassName: GuideCameraDto * @Author: 刘苏义 * @Date: 2024年03月11日11:45:38 **/ @Data @Accessors(chain = true) public class GuideCameraDto { /** * 摄像头id */ private String cameraId; /** * 摄像头通道 */ private Integer chanNo; /** * 是否引导ptz */ private Boolean isGuidePTZ; /** * 引导坐标实体 */ private GuidePoint guidePoint; /** * 引导PTZ实体 */ private GuidePTZ guidePTZ; } ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java
@@ -1,9 +1,11 @@ package com.ruoyi.alarm.global.domain; import com.ruoyi.device.camera.domain.ArdCameras; import lombok.Data; import lombok.experimental.Accessors; import java.util.Date; import java.util.List; /** * @Description: 引导数据实体 @@ -20,6 +22,8 @@ String alarmId; String alarmType; Date receiveTime; double[] targetPosition; GuidePTZ guidePTZ; GuidePoint targetPosition; String wellId; Boolean isGuidePTZ;//是否ptz引导 } ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java
New file @@ -0,0 +1,27 @@ package com.ruoyi.alarm.global.domain; import lombok.Data; import lombok.experimental.Accessors; /** * @Description: * @ClassName: PTZ * @Author: 刘苏义 * @Date: 2024年03月11日11:47:54 **/ @Data @Accessors(chain = true) public class GuidePTZ { /** * 可见光PTZ */ private Double p1; private Double t1; private Double z1; /** * 热红外PTZ */ private Double p2; private Double t2; private Double z2; } ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePoint.java
New file @@ -0,0 +1,13 @@ package com.ruoyi.alarm.global.domain; import lombok.Data; import lombok.experimental.Accessors; @Data @Accessors(chain = true) public class GuidePoint{ private Double longitude; private Double latitude; private Double altitude; } ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java
@@ -40,12 +40,18 @@ * 接收时间 */ String receiveTime; /** * 是否PTZ引导 */ Boolean isGuidePTZ; /** * 引导目标经纬度 */ double[] targetPosition; GuidePoint targetPosition; /** * 引导目标PTZ */ GuidePTZ targetPTZ; /** * 井号 */ ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -30,7 +30,9 @@ 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; @@ -116,6 +118,9 @@ private QueueHandler queueHandler; @Resource private ArdEquipRadarMapper ardEquipRadarMapper; @Resource private ArdWellGuideCameraMapper ardWellGuideCameraMapper; //endregion /** @@ -1034,15 +1039,15 @@ 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 @@ -1070,8 +1075,8 @@ String alarmpointName = ardAlarmRadar.getName();//兴趣点名称 ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName); if (well == null) { String path=System.getProperty("user.dir") + File.separator +"noExistWell.txt"; writeStringToFile(alarmpointName,path); String path = System.getProperty("user.dir") + File.separator + "noExistWell.txt"; writeStringToFile(alarmpointName, path); continue; } @@ -1148,15 +1153,16 @@ 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); } @@ -1186,15 +1192,15 @@ 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 @@ -1263,6 +1269,11 @@ } 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 "运动目标检测": @@ -1317,7 +1328,7 @@ /** * 获取附近开启报警引导功能光电 */ private String getCameraByNear(double[] targetPosition) { private String getCameraByNear(GuidePoint guidePoint) { String minDistanceCameraId = ""; try { //获取所有大光电 @@ -1330,6 +1341,7 @@ 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); @@ -1357,15 +1369,37 @@ //获取相机引导入队 private void getCameraGuideToQueue(GuideDataDto guideDataDto) { //获取雷达所在塔上的大光电 ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(guideDataDto.getRadarId()); if (StringUtils.isNotNull(cameraWithTower)) { log.debug("获取到雷达塔上的光电:" + cameraWithTower.getId()); //如果雷达塔上有光电 guideDataDto.setCameraId(cameraWithTower.getId()); //获取兴趣点关联的相机 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 { log.debug("未获取到雷达塔上的光电,无法引导"); //获取雷达所在塔上的大光电 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("未获取到雷达塔上的光电,无法引导"); } } } @@ -1380,7 +1414,9 @@ 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()) @@ -1389,7 +1425,7 @@ .setAlarmType(ardAlarmRadarMove.getAlarmType()) .setReceiveTime(ardAlarmRadarMove.getCreateTime()) .setWellId(ardAlarmRadarMove.getWellId()) .setTargetPosition(coordinate); .setTargetPosition(guidePoint); getCameraGuideToQueue(guideDataDto);//获取相机入队 } @@ -1404,7 +1440,8 @@ 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()) @@ -1413,7 +1450,7 @@ .setAlarmType(ardAlarmRadarFire.getAlarmType()) .setReceiveTime(ardAlarmRadarFire.getCreateTime()) .setWellId(ardAlarmRadarFire.getWellId()) .setTargetPosition(coordinate); .setTargetPosition(guidePoint); getCameraGuideToQueue(guideDataDto);//获取相机入队 } @@ -1429,7 +1466,8 @@ 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()) @@ -1438,7 +1476,7 @@ .setAlarmType(ardAlarmRadarPump.getAlarmType()) .setReceiveTime(ardAlarmRadarPump.getCreateTime()) .setWellId(ardAlarmRadarPump.getWellId()) .setTargetPosition(coordinate); .setTargetPosition(guidePoint); getCameraGuideToQueue(guideDataDto);//获取相机入队 } ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java
@@ -91,6 +91,7 @@ } } } //异步处理任务 public void processTask(GuideTask guideTask) { try { @@ -103,24 +104,46 @@ cmd.setChanNo(guideTask.getChanNo()); cmd.setOperator(guideTask.getAlarmType()); cmd.setExpired(30); Map<String, Double> ptzMap=new HashMap<>(); if(guideTask.getTargetPTZ()!=null) { if (guideTask.getChanNo() == 1) { ptzMap.put("p", guideTask.getTargetPTZ().getP1()); ptzMap.put("t", guideTask.getTargetPTZ().getT1()); ptzMap.put("z", guideTask.getTargetPTZ().getZ1()); } if (guideTask.getChanNo() == 2) { ptzMap.put("p", guideTask.getTargetPTZ().getP2()); ptzMap.put("t", guideTask.getTargetPTZ().getT2()); ptzMap.put("z", guideTask.getTargetPTZ().getZ2()); } cmd.setPtzMap(ptzMap); } cmd.setRecordBucketName("record"); cmd.setTargetPosition(guideTask.getTargetPosition()); cmd.setRecordObjectName("alarmGuide/"+ DateUtils.getDateYYYYMMDD()+"/"+guideTask.getAlarmType()+"/"+guideTask.getAlarmId()); cmd.setRecordObjectName("alarmGuide/" + DateUtils.getDateYYYYMMDD() + "/" + guideTask.getAlarmType() + "/" + guideTask.getAlarmId()); ICameraSdkService cameraSdkService = SpringUtils.getBean(ICameraSdkService.class); log.debug("开始引导"); boolean recordFlag = false; boolean guideRes = cameraSdkService.guideTargetPosition(cmd); boolean guideRes = false; if (guideTask.getIsGuidePTZ()) { AjaxResult result = cameraSdkService.setPtz(cmd); if (result.get("code").equals(200)) { guideRes = true; } } else { guideRes = cameraSdkService.guideTargetPosition(cmd); } if (guideRes) { log.debug("引导成功"); //region 通知前端 Map<String,Object> message = new HashMap<>(); Map<String,String> data = new HashMap<>(); data.put("cameraId",cmd.getCameraId()); data.put("chanNo",cmd.getChanNo().toString()); data.put("alarmType",cmd.getOperator()); Map<String, Object> message = new HashMap<>(); Map<String, String> data = new HashMap<>(); data.put("cameraId", cmd.getCameraId()); data.put("chanNo", cmd.getChanNo().toString()); data.put("alarmType", cmd.getOperator()); data.put("alarmId", guideTask.getAlarmId()); data.put("wellId",guideTask.getWellId()); message.put("70000",data); data.put("wellId", guideTask.getWellId()); message.put("70000", data); WebSocketUtils.sendMessageAll(message); //endregion cameraSdkService.controlLock(cmd);//上锁 ard-work/src/main/java/com/ruoyi/alarm/radar/service/impl/ArdRadarServiceImpl.java
@@ -1,6 +1,7 @@ package com.ruoyi.alarm.radar.service.impl; import com.alibaba.fastjson2.JSONObject; import com.ruoyi.alarm.global.domain.GuidePoint; import com.ruoyi.alarm.radar.domain.ArdAlarmRadar; import com.ruoyi.alarm.radar.domain.RadarAlarmData; import com.ruoyi.alarm.radar.service.ArdRadarService; @@ -98,6 +99,7 @@ //这里追踪的坐标为雷达经过计算上传的经纬度 Double longitude = ardFollowRadar.getLongitude(); Double latitude = ardFollowRadar.getLatitude(); GuidePoint guidePoint=new GuidePoint().setLongitude(longitude).setLatitude(latitude); //获取雷达所在塔上的大光电 ArdCameras camera = ardEquipRadarMapper.getCameraByRadar(radarId); if (StringUtils.isNotNull(camera)) { @@ -107,7 +109,7 @@ cmd.setOperator("sys_radar_follow"); cmd.setCameraId(camera.getId()); cmd.setChanNo(1); cmd.setTargetPosition(new double[]{longitude,latitude}); cmd.setTargetPosition(guidePoint); boolean res = iCameraSdkService.guideTargetPosition(cmd); if (res) { log.debug("雷达追踪引导成功"); ard-work/src/main/java/com/ruoyi/device/camera/controller/CameraSdkController.java
@@ -194,8 +194,8 @@ point.setLatitude(Double.valueOf(parts[i + 1])); pointList.add(point); } double lon = cmd.getTargetPosition()[0]; double lat = cmd.getTargetPosition()[1]; double lon = cmd.getTargetPosition().getLongitude(); double lat = cmd.getTargetPosition().getLatitude(); Point targetPoint = new Point(lon, lat); //判断引导目标是否在坐标集合组成的多边形内 boolean inPolygon = GisUtil.isInPolygon(targetPoint, pointList); ard-work/src/main/java/com/ruoyi/device/camera/domain/CameraCmd.java
@@ -1,5 +1,6 @@ package com.ruoyi.device.camera.domain; import com.ruoyi.alarm.global.domain.GuidePoint; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.NoArgsConstructor; @@ -37,7 +38,7 @@ Map<String, Double> ptzMap; /*目标经纬度*/ double[] targetPosition; GuidePoint targetPosition; /*目标井*/ String wellId; ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
@@ -3,6 +3,7 @@ import java.util.*; import java.util.stream.Collectors; import com.ruoyi.alarm.global.domain.GuidePoint; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CameraConstants; @@ -402,8 +403,8 @@ @Override public TreeMap getNearCamerasBycoordinate(CameraCmd cmd) { try { double[] targetPosition = cmd.getTargetPosition(); if (targetPosition == null || (targetPosition != null && targetPosition.length == 0)) { GuidePoint guidePoint = cmd.getTargetPosition(); if (guidePoint == null) { log.debug("目标位置为空"); return new TreeMap<>(); } @@ -418,7 +419,8 @@ continue; } double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()}; double distance = GisUtil.getDistance(cmd.getTargetPosition(), camPosition); double[] targetPosition = new double[]{guidePoint.getLongitude(), guidePoint.getLatitude()}; double distance = GisUtil.getDistance(targetPosition, camPosition); if (camera.getCamMaxVisibleDistance() == null) { continue; } ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java
@@ -1,5 +1,6 @@ package com.ruoyi.device.camera.service.impl; import com.ruoyi.alarm.global.domain.GuidePoint; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.domain.ArdWellGuideCamera; import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService; @@ -500,7 +501,8 @@ if (well == null) { return AjaxResult.error("井不存在"); } cmd.setTargetPosition(new double[]{well.getLongitude(), well.getLatitude()}); GuidePoint guidePoint=new GuidePoint().setLongitude(well.getLongitude()).setLatitude(well.getLatitude()); cmd.setTargetPosition(guidePoint); //获取井配置的引导相机列表 List<ArdWellGuideCamera> ardWellGuideCameraList = well.getArdWellGuideCameraList(); ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
@@ -2,6 +2,7 @@ import java.util.*; import com.ruoyi.alarm.global.domain.GuidePoint; import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell; import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper; import com.ruoyi.common.utils.DateUtils; @@ -436,17 +437,13 @@ if (!StringUtils.isNull(wellId)) { /*获取井坐标*/ ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId); if(StringUtils.isNull(well)) { if (StringUtils.isNull(well)) { log.debug("找不到井:" + well.getWellId()); return; } log.debug("找到井:" + well.getWellId()); double[] targetPositon = new double[3]; targetPositon[0] = well.getLongitude(); targetPositon[1] = well.getLatitude(); //targetPositon[2] = well.getAltitude(); log.debug("找到井坐标:" +well.getLongitude()+"-"+well.getLatitude()+"-"+well.getAltitude()); GuidePoint guidePoint = new GuidePoint().setLongitude(well.getLongitude()).setLatitude(well.getLatitude()); log.debug("找到井坐标:" + well.getLongitude() + "-" + well.getLatitude() + "-" + well.getAltitude()); /*获取相机坐标*/ ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId); if (StringUtils.isNull(cameras)) { @@ -454,16 +451,11 @@ return; } log.debug("找到相机:" + cameraId); //double[] cameraPositon = new double[3]; //cameraPositon[0] = cameras.getLongitude(); //cameraPositon[1] = cameras.getLatitude(); //cameraPositon[2] = cameras.getAltitude(); /*控制相机巡检*/ CameraCmd cmd = new CameraCmd(); cmd.setCameraId(cameraId); cmd.setChanNo(channel); cmd.setTargetPosition(targetPositon); cmd.setTargetPosition(guidePoint); cmd.setOperator("sys_patrol_inspect"); cmd.setExpired(step.getRecordingTime());//秒为单位 boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd); @@ -502,25 +494,25 @@ if (!StringUtils.isNull(wellId)) { /*获取井坐标*/ ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId); double[] targetPositon = new double[2]; targetPositon[0] = well.getLongitude(); targetPositon[1] = well.getLatitude(); //targetPositon[2] = well.getAltitude(); if(StringUtils.isNull(well)) { log.debug("找不到井:" + well.getWellId()); return; } log.debug("找到井:" + well.getWellId()); GuidePoint guidePoint = new GuidePoint().setLongitude(well.getLongitude()).setLatitude(well.getLatitude()); /*获取相机坐标*/ ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId); if (StringUtils.isNull(cameras)) { log.debug("找不到相机:" + cameraId); return; } double[] cameraPositon = new double[3]; cameraPositon[0] = cameras.getLongitude(); cameraPositon[1] = cameras.getLatitude(); cameraPositon[2] = cameras.getAltitude(); log.debug("找到相机:" + cameraId); /*控制相机巡检*/ CameraCmd cmd = new CameraCmd(); cmd.setCameraId(cameraId); cmd.setChanNo(channel); cmd.setTargetPosition(targetPositon); cmd.setTargetPosition(guidePoint); cmd.setOperator("sys_patrol_inspect"); cmd.setExpired(step.getRecordingTime());//秒为单位 boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd); @@ -561,7 +553,7 @@ cmd.setChanNo(channel); cmd.setOperator("sys_patrol_inspect"); cmd.setRecordBucketName("record"); cmd.setRecordObjectName("inspectGuide/" + DateUtils.getDateYYYYMMDD()+"/"+ IdUtils.fastSimpleUUID()); cmd.setRecordObjectName("inspectGuide/" + DateUtils.getDateYYYYMMDD() + "/" + IdUtils.fastSimpleUUID()); String url = cameraSdkService.recordStopToMinio(cmd); /*插入巡检记录*/ ArdVideoInspectRecord ardVideoInspectRecord = new ArdVideoInspectRecord(); ard-work/src/main/java/com/ruoyi/utils/sdk/dhsdk/service/impl/DahuaSDK.java
@@ -690,7 +690,7 @@ try { ArdCameras cameras = ardCamerasService.selectArdCamerasById(cameraId); double[] cameraPositon = new double[]{cameras.getLongitude(), cameras.getLatitude(), cameras.getAltitude()}; double[] targetPositions = cmd.getTargetPosition(); double[] targetPositions = new double[]{cmd.getTargetPosition().getLongitude(),cmd.getTargetPosition().getLatitude()}; double[] cameraPTZ = GisUtil.getCameraPTZ(cameraPositon, targetPositions, 20, 150); int p = (int) (cameraPTZ[0] * 10); int t = (int) (cameraPTZ[1] * 10); ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/lib/HCNetSDK.java
@@ -686,7 +686,8 @@ public static final int NET_DVR_GET_TRAFFIC_DATA = 3141; //长连接获取交通数据 public static final int NET_DVR_GET_TRAFFIC_FLOW = 3142; //长连接获取交通流量 public static final int NET_DVR_GET_CCDPARAMCFG = 1067;//获取前端参数(扩展) public static final int NET_DVR_SET_CCDPARAMCFG = 1068;//设置前端参数(扩展) public static final int NET_DVR_GET_CCDPARAMCFG_EX = 3368;//获取前端参数(扩展) public static final int NET_DVR_SET_CCDPARAMCFG_EX = 3369;//设置前端参数(扩展) public static final int NET_DVR_GET_FOCUSMODECFG = 3305;//获取快球聚焦模式信息 ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java
@@ -457,7 +457,7 @@ if (!bool) { int errorCode = hCNetSDK.NET_DVR_GetLastError(); log.error("控制失败,请稍后重试" + errorCode); return AjaxResult.error("errorCode:" + errorCode + "errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); return AjaxResult.error("errorCode:" + errorCode + " errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); } return AjaxResult.success(); } @@ -1021,7 +1021,7 @@ if (!bool) { int errorCode = hCNetSDK.NET_DVR_GetLastError(); log.error("设置PTZ参数失败,请稍后重试:" + errorCode); return AjaxResult.error("errorCode:" + errorCode + "errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); return AjaxResult.error("errorCode:" + errorCode + " errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); } return AjaxResult.success(); } catch (Exception ex) { @@ -1080,7 +1080,7 @@ if (!bool) { int errorCode = hCNetSDK.NET_DVR_GetLastError(); log.error("设置高精度PTZ参数失败,请稍后重试:" + errorCode); return AjaxResult.error("errorCode:" + errorCode + "errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); return AjaxResult.error("errorCode:" + errorCode + " errorInfo:" + SdkErrorCodeEnum.getDescByCode(errorCode)); } return AjaxResult.success(); @@ -1104,7 +1104,7 @@ try { ArdCameras cameras = ardCamerasService.selectArdCamerasById(cameraId); double[] cameraPositon = new double[]{cameras.getLongitude(), cameras.getLatitude(), cameras.getAltitude()}; double[] targetPositions = cmd.getTargetPosition(); double[] targetPositions = new double[]{cmd.getTargetPosition().getLongitude(), cmd.getTargetPosition().getLatitude()}; double[] cameraPTZ = GisUtil.getCameraPTZ(cameraPositon, targetPositions, 20, 150); String p = String.valueOf((int) (cameraPTZ[0] * 10)); String t = String.valueOf((int) (cameraPTZ[1] * 10)); @@ -1302,7 +1302,7 @@ NET_DVR_CAMERAPARAMCFG_EX struDayNigh = new NET_DVR_CAMERAPARAMCFG_EX(); Pointer point = struDayNigh.getPointer(); IntByReference ibrBytesReturned = new IntByReference(0); boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_CCDPARAMCFG_EX, chanNo, point, struDayNigh.size(), ibrBytesReturned); boolean b_GetCameraParam = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_CCDPARAMCFG, chanNo, point, struDayNigh.size(), ibrBytesReturned); if (!b_GetCameraParam) { log.error("获取前端参数失败,错误码:" + hCNetSDK.NET_DVR_GetLastError()); } @@ -1320,7 +1320,7 @@ daynight.byDayNightFilterTime = 60; struDayNigh.struDayNight = daynight; struDayNigh.write(); boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG_EX, chanNo, point, struDayNigh.size()); boolean bool = hCNetSDK.NET_DVR_SetDVRConfig(userId, NET_DVR_SET_CCDPARAMCFG, chanNo, point, struDayNigh.size()); if (!bool) { int code = hCNetSDK.NET_DVR_GetLastError(); log.error("设置夜视失败 ErrorCode:{},ErrorInfo:{}",code, SdkErrorCodeEnum.getDescByCode(code)); ard-work/src/main/java/com/ruoyi/utils/tools/ArdTool.java
@@ -181,4 +181,5 @@ e.printStackTrace(); } } }