增加PTZ引导优先;
井管理增加可见光和热红外ptz设置;
雷达报警引导只需要引导雷达塔上的光电,通道根据日夜切换自动选择;
引导优先按井配置的ptz进行引导,当未配置时按经纬度进行引导;
相机优先级队列排序取消报警次数num比对,仅由优先级和接收时间作为比较器条件;
| | |
| | | String alarmId; |
| | | String alarmType; |
| | | Date receiveTime; |
| | | Integer num; |
| | | Integer recordSn; |
| | | double[] targetPosition; |
| | | GuidePTZ guidePTZ; |
| | | } |
| | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class GuidePTZ { |
| | | /** 引导P值 */ |
| | | private Double P; |
| | | /** 引导P1值 */ |
| | | private Double P1; |
| | | |
| | | /** 引导T值 */ |
| | | private Double T; |
| | | /** 引导T1值 */ |
| | | private Double T1; |
| | | |
| | | /** 引导Z值 */ |
| | | private Double Z; |
| | | /** 引导Z1值 */ |
| | | private Double Z1; |
| | | |
| | | /** 引导P2值 */ |
| | | private Double P2; |
| | | |
| | | /** 引导T2值 */ |
| | | private Double T2; |
| | | |
| | | /** 引导Z2值 */ |
| | | private Double Z2; |
| | | } |
| | |
| | | */ |
| | | public static Comparator<GuideTask> getComparator() { |
| | | Comparator<GuideTask> PriorityDescCom = Comparator.comparingInt(GuideTask::getPriority).reversed(); |
| | | Comparator<GuideTask> NumDescCom = Comparator.comparingInt(GuideTask::getNum).reversed(); |
| | | Comparator<GuideTask> receiveTimeAscCom = Comparator.comparing(GuideTask::getReceiveTime); |
| | | Comparator<GuideTask> Comparator = PriorityDescCom.thenComparing(NumDescCom).thenComparing(receiveTimeAscCom); |
| | | Comparator<GuideTask> Comparator = PriorityDescCom.thenComparing(receiveTimeAscCom); |
| | | return Comparator; |
| | | } |
| | | |
| | |
| | | PriorityBlockingQueue<GuideTask> queue = new PriorityBlockingQueue<>(priorityQueue); |
| | | while (queue.size() > 0) { |
| | | GuideTask task = queue.poll(); |
| | | log.info("正在排队【cameraId】" + task.getCameraId()+"【alarmId】" + task.getAlarmId() + "【receiveTime】" + task.getReceiveTime() |
| | | + "【alarmType】" + task.getAlarmType() + "【priority】" + task.getPriority() + "【num】" + task.getNum() |
| | | + "【chan】" + task.getChanNum() + "【recordSn】" + task.getRecordSn()); |
| | | log.info("正在排队【cameraId】" + task.getCameraId() + "【alarmId】" + task.getAlarmId() + "【receiveTime】" + task.getReceiveTime() |
| | | + "【alarmType】" + task.getAlarmType() + "【priority】" + task.getPriority() + "【chanNo】" + task.getChanNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 相机通道 |
| | | */ |
| | | Integer chanNum; |
| | | Integer chanNo; |
| | | /** |
| | | * 报警ID |
| | | */ |
| | |
| | | * 接收时间 |
| | | */ |
| | | String receiveTime; |
| | | /** |
| | | * 报警次数 |
| | | */ |
| | | Integer num; |
| | | /** |
| | | * 录像存储位置-这里有的报警需要引导2个相机,故需要指定哪个相机录像回写到哪个字段 |
| | | */ |
| | | Integer recordSn; |
| | | |
| | | /** |
| | | * 引导目标经纬度 |
| | |
| | | .setAlarmId(ardAlarmTube.getId()) |
| | | .setAlarmType("sys_tube_leak") |
| | | .setReceiveTime(ardAlarmTube.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate); |
| | | messagesEnqueued(guideDataDto); |
| | | } |
| | |
| | | if (well == null) { |
| | | return; |
| | | } |
| | | Double guideP = well.getGuideP(); |
| | | Double guideT = well.getGuideT(); |
| | | Double guideZ = well.getGuideZ(); |
| | | |
| | | Double longitude = well.getLongitude(); |
| | | Double latitude = well.getLatitude(); |
| | | String targetId = ardAlarmRadar.getTargetId(); |
| | | GuidePTZ guidePTZ = new GuidePTZ(); |
| | | guidePTZ.setP1(well.getGuideP1()); |
| | | guidePTZ.setT1(well.getGuideT1()); |
| | | guidePTZ.setZ1(well.getGuideZ1()); |
| | | guidePTZ.setP2(well.getGuideP2()); |
| | | guidePTZ.setT2(well.getGuideT2()); |
| | | guidePTZ.setZ2(well.getGuideZ2()); |
| | | switch (ardAlarmRadar.getAlarmType()) { |
| | | case "运动目标检测": |
| | | ArdAlarmRadarMove ardAlarmRadarMove = new ArdAlarmRadarMove(); |
| | |
| | | ardAlarmRadarMove.setLatitude(latitude); |
| | | ardAlarmRadarMove.setUpdateTime(radarAlarmData.getAlarmTime()); |
| | | ardAlarmRadarMove.setRadarId(radarId); |
| | | |
| | | guidePTZ.setP(guideP); |
| | | guidePTZ.setT(guideT); |
| | | guidePTZ.setZ(guideZ); |
| | | ardAlarmRadarMove.setGuidePTZ(guidePTZ); |
| | | Date alarmTime = ardAlarmRadarMove.getAlarmTime(); |
| | | //获取当前兴趣点当前雷达的上一条数据 |
| | |
| | | ardAlarmRadarFire.setAlarmType("热源检测"); |
| | | ardAlarmRadarFire.setLongitude(longitude); |
| | | ardAlarmRadarFire.setLatitude(latitude); |
| | | guidePTZ.setP(guideP); |
| | | guidePTZ.setT(guideT); |
| | | guidePTZ.setZ(guideZ); |
| | | ardAlarmRadarFire.setGuidePTZ(guidePTZ); |
| | | ardAlarmRadarFire.setRadarId(radarId); |
| | | ardAlarmRadarFire.setUpdateTime(radarAlarmData.getAlarmTime()); |
| | |
| | | alarmTime = ardAlarmRadarPump.getAlarmTime(); |
| | | ardAlarmRadarPump.setLongitude(well.getLongitude()); |
| | | ardAlarmRadarPump.setLatitude(well.getLatitude()); |
| | | guidePTZ.setP(guideP); |
| | | guidePTZ.setT(guideT); |
| | | guidePTZ.setZ(guideZ); |
| | | ardAlarmRadarPump.setGuidePTZ(guidePTZ); |
| | | // |
| | | ArdAlarmRadarPump lastPumpData = ardAlarmRadarPumpMapper.selectArdAlarmRadarLastData(ardAlarmRadarPump.getName()); |
| | |
| | | //外联防区名称就是兴趣点,查兴趣点坐标 |
| | | String defenseName = ardAlarmExternal.getDefenseName(); |
| | | ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(defenseName); |
| | | GuidePTZ guidePTZ = new GuidePTZ(); |
| | | if (StringUtils.isNotNull(well)) { |
| | | ardAlarmExternal.setLongitude(well.getLongitude()); |
| | | ardAlarmExternal.setLatitude(well.getLatitude()); |
| | | guidePTZ.setP1(well.getGuideP1()); |
| | | guidePTZ.setT1(well.getGuideT1()); |
| | | guidePTZ.setZ1(well.getGuideZ1()); |
| | | guidePTZ.setP2(well.getGuideP2()); |
| | | guidePTZ.setT2(well.getGuideT2()); |
| | | guidePTZ.setZ2(well.getGuideZ2()); |
| | | } |
| | | int aae = ardAlarmExternalMapper.insertArdAlarmExternal(ardAlarmExternal); |
| | | if (aae > 0) { |
| | |
| | | return; |
| | | } |
| | | double[] coordinate = new double[]{ardAlarmExternal.getLongitude(), ardAlarmExternal.getLatitude()};//引导坐标 |
| | | GuidePTZ guidePTZ = new GuidePTZ() |
| | | .setP(well.getGuideP()) |
| | | .setT(well.getGuideT()) |
| | | .setZ(well.getGuideZ()); |
| | | String cameraId = getCameraByNear(coordinate);//最近相机ID |
| | | if (StringUtils.isNotEmpty(cameraId)) { |
| | | GuideDataDto guideDataDto = new GuideDataDto() |
| | |
| | | .setAlarmId(ardAlarmExternal.getId()) |
| | | .setAlarmType("sys_external") |
| | | .setReceiveTime(ardAlarmExternal.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate) |
| | | .setGuidePTZ(guidePTZ); |
| | | messagesEnqueued(guideDataDto); |
| | |
| | | .setAlarmId(ardAlarmAccess.getId()) |
| | | .setAlarmType("sys_external") |
| | | .setReceiveTime(ardAlarmAccess.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate); |
| | | messagesEnqueued(guideDataDto); |
| | | } |
| | |
| | | private void messagesEnqueued(GuideDataDto guideDataDto) { |
| | | try { |
| | | String cameraId = guideDataDto.getCameraId(); |
| | | String alarmType = guideDataDto.getAlarmType(); |
| | | if (!IsEnableGuide(cameraId)) { |
| | | log.info("相机:" + cameraId + "未开启报警引导功能"); |
| | | return; |
| | | } |
| | | SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | GuideTask guideTask = new GuideTask(); |
| | | //相机ID |
| | | guideTask.setCameraId(cameraId); |
| | | //报警类型 |
| | | guideTask.setCameraId(cameraId);//相机ID |
| | | String alarmType = guideDataDto.getAlarmType(); |
| | | switch (alarmType) { |
| | | case "运动目标检测": |
| | | alarmType = "sys_radar_move"; |
| | |
| | | alarmType = "sys_radar_pump"; |
| | | break; |
| | | } |
| | | guideTask.setAlarmType(alarmType); |
| | | //通道(通过日夜时间研判) |
| | | String dayNightTime = redisCache.getCacheObject("sys_config:dayNightTime"); |
| | | Integer channel = ArdTool.getChannelBydayNightTime(dayNightTime); |
| | | guideTask.setChanNum(channel); |
| | | //报警ID |
| | | guideTask.setAlarmId(guideDataDto.getAlarmId()); |
| | | //接收时间 |
| | | guideTask.setReceiveTime(fmt.format(guideDataDto.getReceiveTime())); |
| | | guideTask.setAlarmType(alarmType);//报警类型 |
| | | Integer chanNo = ArdTool.getChannelBydayNightTime(redisCache.getCacheObject("sys_config:dayNightTime")); |
| | | guideTask.setChanNo(chanNo);//通道(通过日夜时间研判) |
| | | guideTask.setAlarmId(guideDataDto.getAlarmId()); //报警ID |
| | | guideTask.setReceiveTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS_MS,guideDataDto.getReceiveTime()));//接收时间 |
| | | //报警优先级(通过优先级字典) |
| | | String priority = DictUtils.getDictValue("cameras_priority", alarmType); |
| | | if (StringUtils.isEmpty(priority)) { |
| | |
| | | return; |
| | | } |
| | | guideTask.setPriority(Integer.valueOf(priority)); |
| | | //报警次数 |
| | | guideTask.setNum(guideDataDto.getNum()); |
| | | //录像存储位置 |
| | | guideTask.setRecordSn(guideDataDto.getRecordSn()); |
| | | //目标经纬度 |
| | | guideTask.setTargetPosition(guideDataDto.getTargetPosition()); |
| | | //目标PTZ |
| | | guideTask.setTargetPosition(guideDataDto.getTargetPosition());//目标经纬度 |
| | | if (guideDataDto.getGuidePTZ() != null) { |
| | | guideTask.setGuidePTZ(guideDataDto.getGuidePTZ()); |
| | | guideTask.setGuidePTZ(guideDataDto.getGuidePTZ());//目标PTZ |
| | | } |
| | | //消息入队 |
| | | queueHandler.addTaskToQueue(cameraId, guideTask); |
| | |
| | | |
| | | //获取相机引导入队 |
| | | private void getCameraGuideToQueue(GuideDataDto guideDataDto) { |
| | | int index = guideDataDto.getName().indexOf("("); |
| | | String alarmpointName = guideDataDto.getName().substring(0, index); |
| | | |
| | | //获取雷达所在塔上的大光电 |
| | | ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(guideDataDto.getRadarId()); |
| | | if (StringUtils.isNotNull(cameraWithTower)) { |
| | |
| | | messagesEnqueued(guideDataDto); |
| | | } else { |
| | | log.debug("未获取到雷达塔上的光电,无法引导"); |
| | | } |
| | | //获取报警点关联的大光电 |
| | | ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName); |
| | | if (StringUtils.isNotNull(ardAlarmpointsWell) && StringUtils.isNotEmpty(ardAlarmpointsWell.getCameraId())) { |
| | | String cameraId = ardAlarmpointsWell.getCameraId(); |
| | | if (cameraId.equals(cameraWithTower.getId())) { |
| | | return; |
| | | } |
| | | log.debug("获取到报警点关联的光电:" + cameraId); |
| | | //如果报警点关联了光电 |
| | | guideDataDto.setCameraId(cameraId); |
| | | guideDataDto.setRecordSn(2);//兴趣点光电引导录像存储第二个路径 |
| | | messagesEnqueued(guideDataDto); |
| | | } else { |
| | | log.debug("未获取到报警点关联的光电,无法引导"); |
| | | } |
| | | } |
| | | |
| | |
| | | .setAlarmId(ardAlarmRadarMove.getId()) |
| | | .setAlarmType(ardAlarmRadarMove.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarMove.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate) |
| | | .setGuidePTZ(ardAlarmRadarMove.getGuidePTZ()); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | |
| | | .setAlarmId(ardAlarmRadarFire.getId()) |
| | | .setAlarmType(ardAlarmRadarFire.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarFire.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate) |
| | | .setGuidePTZ(ardAlarmRadarFire.getGuidePTZ()); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | |
| | | .setAlarmId(ardAlarmRadarPump.getId()) |
| | | .setAlarmType(ardAlarmRadarPump.getAlarmType()) |
| | | .setReceiveTime(ardAlarmRadarPump.getCreateTime()) |
| | | .setNum(1) |
| | | .setRecordSn(1) |
| | | .setTargetPosition(coordinate) |
| | | .setGuidePTZ(ardAlarmRadarPump.getGuidePTZ()); |
| | | getCameraGuideToQueue(guideDataDto);//获取相机入队 |
| | |
| | | // newThread.start(); |
| | | //} |
| | | } |
| | | |
| | | @Async("guideExecutor") |
| | | public void process(String cameraId) { |
| | | log.debug("CameraId:【" + cameraId + "】引导队列处理器启动成功"); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void processTask(GuideTask guideTask) { |
| | | try { |
| | | String url=""; |
| | | String url = ""; |
| | | CameraCmd cmd = new CameraCmd(); |
| | | cmd.setCameraId(guideTask.getCameraId()); |
| | | cmd.setChanNo(guideTask.getChanNum()); |
| | | cmd.setChanNo(guideTask.getChanNo()); |
| | | cmd.setTargetPosition(guideTask.getTargetPosition()); |
| | | cmd.setOperator(guideTask.getAlarmType()); |
| | | cmd.setExpired(30); |
| | | cmd.setRecordBucketName("record"); |
| | | Map<String, Double> ptzMap = new HashMap<>(); |
| | | ptzMap.put("p", guideTask.getGuidePTZ().getP()); |
| | | ptzMap.put("t", guideTask.getGuidePTZ().getT()); |
| | | ptzMap.put("z", guideTask.getGuidePTZ().getZ()); |
| | | cmd.setPtzMap(ptzMap); |
| | | if (guideTask.getRecordSn().equals(1)) { |
| | | cmd.setRecordObjectName("alarm_" + guideTask.getAlarmId() + "_1"); |
| | | } else { |
| | | cmd.setRecordObjectName("alarm_" + guideTask.getAlarmId() + "_2"); |
| | | switch (guideTask.getChanNo()) { |
| | | case 1: |
| | | ptzMap.put("p", guideTask.getGuidePTZ().getP1()); |
| | | ptzMap.put("t", guideTask.getGuidePTZ().getT1()); |
| | | ptzMap.put("z", guideTask.getGuidePTZ().getZ1()); |
| | | break; |
| | | case 2: |
| | | ptzMap.put("p", guideTask.getGuidePTZ().getP2()); |
| | | ptzMap.put("t", guideTask.getGuidePTZ().getT2()); |
| | | ptzMap.put("z", guideTask.getGuidePTZ().getZ2()); |
| | | break; |
| | | } |
| | | cmd.setPtzMap(ptzMap); |
| | | cmd.setRecordObjectName("alarm_" + guideTask.getAlarmId()); |
| | | ICameraSdkService cameraSdkService = SpringUtils.getBean(ICameraSdkService.class); |
| | | log.debug("开始引导"); |
| | | boolean guideRes = false; |
| | |
| | | GuideTask firstTask = guideTasks.peek(); |
| | | if (firstTask.getPriority() > guideTask.getPriority()) { |
| | | recordFlag = false;//录像停止 |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | case "sys_radar_move": |
| | | ArdAlarmRadarMove ardAlarmRadarMove = new ArdAlarmRadarMove(); |
| | | ardAlarmRadarMove.setId(guideTask.getAlarmId()); |
| | | if (guideTask.getRecordSn().equals(1)) { |
| | | ardAlarmRadarMove.setRecordUrl1(url); |
| | | } else { |
| | | ardAlarmRadarMove.setRecordUrl2(url); |
| | | } |
| | | ardAlarmRadarMove.setRecordUrl(url); |
| | | IArdAlarmRadarMoveService ardAlarmRadarMoveService = SpringUtils.getBean(IArdAlarmRadarMoveService.class); |
| | | ardAlarmRadarMoveService.updateArdAlarmRadarMove(ardAlarmRadarMove); |
| | | break; |
| | | case "sys_radar_fire": |
| | | ArdAlarmRadarFire ardAlarmRadarFire = new ArdAlarmRadarFire(); |
| | | ardAlarmRadarFire.setId(guideTask.getAlarmId()); |
| | | if (guideTask.getRecordSn().equals(1)) { |
| | | ardAlarmRadarFire.setRecordUrl1(url); |
| | | } else { |
| | | ardAlarmRadarFire.setRecordUrl2(url); |
| | | } |
| | | ardAlarmRadarFire.setRecordUrl(url); |
| | | IArdAlarmRadarFireService ardAlarmRadarFireService = SpringUtils.getBean(IArdAlarmRadarFireService.class); |
| | | ardAlarmRadarFireService.updateArdAlarmRadarFire(ardAlarmRadarFire); |
| | | break; |
| | | case "sys_radar_pump": |
| | | ArdAlarmRadarPump ardAlarmRadarPump = new ArdAlarmRadarPump(); |
| | | ardAlarmRadarPump.setId(guideTask.getAlarmId()); |
| | | if (guideTask.getRecordSn().equals(1)) { |
| | | ardAlarmRadarPump.setRecordUrl1(url); |
| | | } else { |
| | | ardAlarmRadarPump.setRecordUrl2(url); |
| | | } |
| | | ardAlarmRadarPump.setRecordUrl(url); |
| | | IArdAlarmRadarPumpService ardAlarmRadarPumpService = SpringUtils.getBean(IArdAlarmRadarPumpService.class); |
| | | ardAlarmRadarPumpService.updateArdAlarmRadarPump(ardAlarmRadarPump); |
| | | break; |
| | |
| | | @Excel(name = "纬度") |
| | | private Double latitude; |
| | | |
| | | /** 引导录像2 */ |
| | | @Excel(name = "引导录像2") |
| | | private String recordUrl2; |
| | | /** 引导录像1 */ |
| | | @Excel(name = "引导录像1") |
| | | private String recordUrl1; |
| | | /** 引导录像 */ |
| | | @Excel(name = "引导录像") |
| | | private String recordUrl; |
| | | /** 查看时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "查看时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | @Excel(name = "纬度") |
| | | private Double latitude; |
| | | |
| | | /** 引导录像1 */ |
| | | @Excel(name = "引导录像1") |
| | | private String recordUrl1; |
| | | /** 引导录像2 */ |
| | | @Excel(name = "引导录像2") |
| | | private String recordUrl2; |
| | | /** 引导录像 */ |
| | | @Excel(name = "引导录像") |
| | | private String recordUrl; |
| | | |
| | | /** 查看时间 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "查看时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | @Excel(name = "纬度") |
| | | private Double latitude; |
| | | /** |
| | | * 引导录像1 |
| | | * 引导录像 |
| | | */ |
| | | @Excel(name = "引导录像1") |
| | | private String recordUrl1; |
| | | /** |
| | | * 引导录像2 |
| | | */ |
| | | @Excel(name = "引导录像2") |
| | | private String recordUrl2; |
| | | @Excel(name = "引导录像") |
| | | private String recordUrl; |
| | | |
| | | /** |
| | | * 查看时间 |
| | |
| | | /** 用户id */ |
| | | private String userId; |
| | | |
| | | /** 关联相机ID */ |
| | | private String cameraId; |
| | | /** 引导P1值 */ |
| | | private Double guideP1; |
| | | |
| | | /** 引导P值 */ |
| | | private Double guideP; |
| | | /** 引导T1值 */ |
| | | private Double guideT1; |
| | | |
| | | /** 引导T值 */ |
| | | private Double guideT; |
| | | /** 引导Z1值 */ |
| | | private Double guideZ1; |
| | | |
| | | /** 引导Z值 */ |
| | | private Double guideZ; |
| | | /** 引导P2值 */ |
| | | private Double guideP2; |
| | | |
| | | /** 引导T2值 */ |
| | | private Double guideT2; |
| | | |
| | | /** 引导Z2值 */ |
| | | private Double guideZ2; |
| | | |
| | | @TableField(exist = false) |
| | | private String type; |
| | |
| | | String wellId = step.getWellId();
|
| | | if (!StringUtils.isNull(wellId)) {
|
| | | /*获取井坐标*/
|
| | | ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId);
|
| | | ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId);
|
| | | double[] targetPositon = new double[3];
|
| | | targetPositon[0] = ardAlarmpointsWell.getLongitude();
|
| | | targetPositon[1] = ardAlarmpointsWell.getLatitude();
|
| | | targetPositon[2] = ardAlarmpointsWell.getAltitude();
|
| | | targetPositon[0] = well.getLongitude();
|
| | | targetPositon[1] = well.getLatitude();
|
| | | targetPositon[2] = well.getAltitude();
|
| | | /*获取相机坐标*/
|
| | | ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
|
| | | if (StringUtils.isNull(cameras)) {
|
| | |
| | | cmd.setOperator("sys_patrol_inspect");
|
| | | cmd.setExpired(step.getRecordingTime() * 60);
|
| | | Map<String, Double> ptzMap = new HashMap<>();
|
| | | ptzMap.put("p", ardAlarmpointsWell.getGuideP());
|
| | | ptzMap.put("t", ardAlarmpointsWell.getGuideT());
|
| | | ptzMap.put("z", ardAlarmpointsWell.getGuideZ());
|
| | | switch (channel) {
|
| | | case 1:
|
| | | ptzMap.put("p", well.getGuideP1());
|
| | | ptzMap.put("t", well.getGuideT1());
|
| | | ptzMap.put("z", well.getGuideZ1());
|
| | | break;
|
| | | case 2:
|
| | | ptzMap.put("p", well.getGuideP2());
|
| | | ptzMap.put("t", well.getGuideT2());
|
| | | ptzMap.put("z", well.getGuideZ2());
|
| | | break;
|
| | | }
|
| | | cmd.setPtzMap(ptzMap);
|
| | | boolean setTargetPosition;
|
| | | if (cmd.getPtzMap().get("p") != null) {
|
| | |
| | | String wellId = step.getWellId();
|
| | | if (!StringUtils.isNull(wellId)) {
|
| | | /*获取井坐标*/
|
| | | ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId);
|
| | | ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellById(wellId);
|
| | | double[] targetPositon = new double[3];
|
| | | targetPositon[0] = ardAlarmpointsWell.getLongitude();
|
| | | targetPositon[1] = ardAlarmpointsWell.getLatitude();
|
| | | targetPositon[2] = ardAlarmpointsWell.getAltitude();
|
| | | targetPositon[0] = well.getLongitude();
|
| | | targetPositon[1] = well.getLatitude();
|
| | | targetPositon[2] = well.getAltitude();
|
| | | /*获取相机坐标*/
|
| | | ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
|
| | | if (StringUtils.isNull(cameras)) {
|
| | |
| | | cmd.setOperator("sys_patrol_inspect");
|
| | | cmd.setExpired(step.getRecordingTime() * 60);
|
| | | Map<String, Double> ptzMap = new HashMap<>();
|
| | | ptzMap.put("p", ardAlarmpointsWell.getGuideP());
|
| | | ptzMap.put("t", ardAlarmpointsWell.getGuideT());
|
| | | ptzMap.put("z", ardAlarmpointsWell.getGuideZ());
|
| | | switch (channel) {
|
| | | case 1:
|
| | | ptzMap.put("p", well.getGuideP1());
|
| | | ptzMap.put("t", well.getGuideT1());
|
| | | ptzMap.put("z", well.getGuideZ1());
|
| | | break;
|
| | | case 2:
|
| | | ptzMap.put("p", well.getGuideP2());
|
| | | ptzMap.put("t", well.getGuideT2());
|
| | | ptzMap.put("z", well.getGuideZ2());
|
| | | break;
|
| | | }
|
| | | cmd.setPtzMap(ptzMap);
|
| | | boolean setTargetPosition;
|
| | | if (cmd.getPtzMap().get("p") != null) {
|
| | |
| | | <result property="alarmTime" column="alarm_time" /> |
| | | <result property="longitude" column="longitude" /> |
| | | <result property="latitude" column="latitude" /> |
| | | <result property="recordUrl1" column="record_url1" /> |
| | | <result property="recordUrl" column="record_url" /> |
| | | <result property="viewTime" column="view_time" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdAlarmRadarFireVo"> |
| | | select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url1, view_time, create_by, create_time, user_id, dept_id, guide_time from ard_alarm_radar_fire |
| | | select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url, view_time, create_by, create_time, user_id, dept_id, guide_time from ard_alarm_radar_fire |
| | | </sql> |
| | | |
| | | <select id="selectArdAlarmRadarFireList" parameterType="ArdAlarmRadarFire" resultMap="ArdAlarmRadarFireResult"> |
| | |
| | | <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if> |
| | | <if test="longitude != null "> and longitude = #{longitude}</if> |
| | | <if test="latitude != null "> and latitude = #{latitude}</if> |
| | | <if test="recordUrl1 != null and recordUrl1 != ''"> and record_url1 = #{recordUrl1}</if> |
| | | <if test="recordUrl != null and recordUrl != ''"> and record_url = #{recordUrl}</if> |
| | | <if test="viewTime != null "> and view_time = #{viewTime}</if> |
| | | <if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
| | | <if test="deptId != null "> and dept_id = #{deptId}</if> |
| | |
| | | <if test="alarmTime != null">alarm_time,</if> |
| | | <if test="longitude != null">longitude,</if> |
| | | <if test="latitude != null">latitude,</if> |
| | | <if test="recordUrl1 != null">record_url1,</if> |
| | | <if test="recordUrl != null">record_url,</if> |
| | | <if test="viewTime != null">view_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="alarmTime != null">#{alarmTime},</if> |
| | | <if test="longitude != null">#{longitude},</if> |
| | | <if test="latitude != null">#{latitude},</if> |
| | | <if test="recordUrl1 != null">#{recordUrl1},</if> |
| | | <if test="recordUrl != null">#{recordUrl},</if> |
| | | <if test="viewTime != null">#{viewTime},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | <if test="alarmTime != null">alarm_time = #{alarmTime},</if> |
| | | <if test="longitude != null">longitude = #{longitude},</if> |
| | | <if test="latitude != null">latitude = #{latitude},</if> |
| | | <if test="recordUrl1 != null">record_url1 = #{recordUrl1},</if> |
| | | <if test="recordUrl2 != null">record_url2 = #{recordUrl2},</if> |
| | | <if test="recordUrl != null">record_url = #{recordUrl},</if> |
| | | <if test="viewTime != null">view_time = #{viewTime},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | <result property="alarmTime" column="alarm_time" /> |
| | | <result property="longitude" column="longitude" /> |
| | | <result property="latitude" column="latitude" /> |
| | | <result property="recordUrl1" column="record_url1" /> |
| | | <result property="recordUrl2" column="record_url2" /> |
| | | <result property="recordUrl" column="record_url" /> |
| | | <result property="viewTime" column="view_time" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdAlarmRadarMoveVo"> |
| | | select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url1,record_url2, view_time, create_by, create_time, user_id, dept_id, guide_time from ard_alarm_radar_move |
| | | select id, name, target_id, alarm_type, alarm_time, longitude, latitude, record_url, view_time, create_by, create_time, user_id, dept_id, guide_time from ard_alarm_radar_move |
| | | </sql> |
| | | |
| | | <select id="selectArdAlarmRadarMoveList" parameterType="ArdAlarmRadarMove" resultMap="ArdAlarmRadarMoveResult"> |
| | |
| | | <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if> |
| | | <if test="longitude != null "> and longitude = #{longitude}</if> |
| | | <if test="latitude != null "> and latitude = #{latitude}</if> |
| | | <if test="recordUrl1 != null and recordUrl1 != ''"> and record_url1 = #{recordUrl1}</if> |
| | | <if test="recordUrl != null and recordUrl != ''"> and record_url = #{recordUrl}</if> |
| | | <if test="viewTime != null "> and view_time = #{viewTime}</if> |
| | | <if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
| | | <if test="deptId != null "> and dept_id = #{deptId}</if> |
| | |
| | | <if test="alarmTime != null">alarm_time,</if> |
| | | <if test="longitude != null">longitude,</if> |
| | | <if test="latitude != null">latitude,</if> |
| | | <if test="recordUrl1 != null">record_url1,</if> |
| | | <if test="recordUrl2 != null">record_url2,</if> |
| | | <if test="recordUrl != null">record_url,</if> |
| | | <if test="viewTime != null">view_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="alarmTime != null">#{alarmTime},</if> |
| | | <if test="longitude != null">#{longitude},</if> |
| | | <if test="latitude != null">#{latitude},</if> |
| | | <if test="recordUrl1 != null">#{recordUrl1},</if> |
| | | <if test="recordUrl2 != null">#{recordUrl2},</if> |
| | | <if test="recordUrl != null">#{recordUrl},</if> |
| | | <if test="viewTime != null">#{viewTime},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | <if test="alarmTime != null">alarm_time = #{alarmTime},</if> |
| | | <if test="longitude != null">longitude = #{longitude},</if> |
| | | <if test="latitude != null">latitude = #{latitude},</if> |
| | | <if test="recordUrl1 != null">record_url1 = #{recordUrl1},</if> |
| | | <if test="recordUrl2 != null">record_url2 = #{recordUrl2},</if> |
| | | <if test="recordUrl != null">record_url = #{recordUrl},</if> |
| | | <if test="viewTime != null">view_time = #{viewTime},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | <result property="alarmTime" column="alarm_time" /> |
| | | <result property="longitude" column="longitude" /> |
| | | <result property="latitude" column="latitude" /> |
| | | <result property="recordUrl1" column="record_url1" /> |
| | | <result property="recordUrl" column="record_url" /> |
| | | <result property="viewTime" column="view_time" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | <if test="alarmTime != null "> and alarm_time = #{alarmTime}</if> |
| | | <if test="longitude != null "> and longitude = #{longitude}</if> |
| | | <if test="latitude != null "> and latitude = #{latitude}</if> |
| | | <if test="recordUrl1 != null and recordUrl1 != ''"> and record_url1 = #{recordUrl1}</if> |
| | | <if test="recordUrl != null and recordUrl != ''"> and record_url = #{recordUrl}</if> |
| | | <if test="viewTime != null "> and view_time = #{viewTime}</if> |
| | | <if test="userId != null and userId != ''"> and user_id = #{userId}</if> |
| | | <if test="deptId != null "> and dept_id = #{deptId}</if> |
| | |
| | | <if test="alarmTime != null">alarm_time,</if> |
| | | <if test="longitude != null">longitude,</if> |
| | | <if test="latitude != null">latitude,</if> |
| | | <if test="recordUrl1 != null">record_url1,</if> |
| | | <if test="recordUrl != null">record_url,</if> |
| | | <if test="viewTime != null">view_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | <if test="alarmTime != null">#{alarmTime},</if> |
| | | <if test="longitude != null">#{longitude},</if> |
| | | <if test="latitude != null">#{latitude},</if> |
| | | <if test="recordUrl1 != null">#{recordUrl1},</if> |
| | | <if test="recordUrl != null">#{recordUrl},</if> |
| | | <if test="viewTime != null">#{viewTime},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | <if test="alarmTime != null">alarm_time = #{alarmTime},</if> |
| | | <if test="longitude != null">longitude = #{longitude},</if> |
| | | <if test="latitude != null">latitude = #{latitude},</if> |
| | | <if test="recordUrl1 != null">record_url1 = #{recordUrl1},</if> |
| | | <if test="recordUrl2 != null">record_url2 = #{recordUrl2},</if> |
| | | <if test="recordUrl != null">record_url = #{recordUrl},</if> |
| | | <if test="viewTime != null">view_time = #{viewTime},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="cameraId" column="camera_id"/> |
| | | <result property="guideP" column="guide_p"/> |
| | | <result property="guideT" column="guide_t"/> |
| | | <result property="guideZ" column="guide_z"/> |
| | | <result property="guideP1" column="guide_p1"/> |
| | | <result property="guideT1" column="guide_t1"/> |
| | | <result property="guideZ1" column="guide_z1"/> |
| | | <result property="guideP2" column="guide_p2"/> |
| | | <result property="guideT2" column="guide_t2"/> |
| | | <result property="guideZ2" column="guide_z2"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="ArdAlarmpointsWell" id="wellResult"> |
| | |
| | | c.create_time, |
| | | c.update_by, |
| | | c.update_time, |
| | | c.camera_id, |
| | | c.guide_p, |
| | | c.guide_t, |
| | | c.guide_z |
| | | c.guide_p1, |
| | | c.guide_t1, |
| | | c.guide_z1, |
| | | c.guide_p2, |
| | | c.guide_t2, |
| | | c.guide_z2 |
| | | from ard_alarmpoints_well c |
| | | left join sys_dept d on d.dept_id = c.dept_id |
| | | left join sys_user u on u.user_id = c.user_id |
| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="cameraId != null">camera_id,</if> |
| | | <if test="guideP != null">guide_p,</if> |
| | | <if test="guideT != null">guide_t,</if> |
| | | <if test="guideZ != null">guide_z,</if> |
| | | <if test="guideP1 != null">guide_p1,</if> |
| | | <if test="guideT1 != null">guide_t1,</if> |
| | | <if test="guideZ1 != null">guide_z1,</if> |
| | | <if test="guideP2 != null">guide_p2,</if> |
| | | <if test="guideT2 != null">guide_t2,</if> |
| | | <if test="guideZ2 != null">guide_z2,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="cameraId != null">#{cameraId},</if> |
| | | <if test="guideP != null">#{guideP},</if> |
| | | <if test="guideT != null">#{guideT},</if> |
| | | <if test="guideZ != null">#{guideZ},</if> |
| | | <if test="guideP1 != null">#{guideP1},</if> |
| | | <if test="guideT1 != null">#{guideT1},</if> |
| | | <if test="guideZ1 != null">#{guideZ1},</if> |
| | | <if test="guideP2 != null">#{guideP2},</if> |
| | | <if test="guideT2 != null">#{guideT2},</if> |
| | | <if test="guideZ2 != null">#{guideZ2},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="cameraId != null">camera_id = #{cameraId},</if> |
| | | <if test="guideP != null">guide_p = #{guideP},</if> |
| | | <if test="guideT != null">guide_t = #{guideT},</if> |
| | | <if test="guideZ != null">guide_z = #{guideZ},</if> |
| | | <if test="guideP1 != null">guide_p1 = #{guideP1},</if> |
| | | <if test="guideT1 != null">guide_t1 = #{guideT1},</if> |
| | | <if test="guideZ1 != null">guide_z1 = #{guideZ1},</if> |
| | | <if test="guideP2 != null">guide_p2 = #{guideP2},</if> |
| | | <if test="guideT2 != null">guide_t2 = #{guideT2},</if> |
| | | <if test="guideZ2 != null">guide_z2 = #{guideZ2},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="cameraId != null">camera_id = #{cameraId},</if> |
| | | <if test="guideP != null">guide_p = #{guideP},</if> |
| | | <if test="guideT != null">guide_t = #{guideT},</if> |
| | | <if test="guideZ != null">guide_z = #{guideZ},</if> |
| | | <if test="guideP1 != null">guide_p1 = #{guideP1},</if> |
| | | <if test="guideT1 != null">guide_t1 = #{guideT1},</if> |
| | | <if test="guideZ1 != null">guide_z1 = #{guideZ1},</if> |
| | | <if test="guideP2 != null">guide_p2 = #{guideP2},</if> |
| | | <if test="guideT2 != null">guide_t2 = #{guideT2},</if> |
| | | <if test="guideZ2 != null">guide_z2 = #{guideZ2},</if> |
| | | </trim> |
| | | where well_id = #{wellId} |
| | | </update> |
| | |
| | | public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; |
| | | |
| | | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; |
| | | public static String YYYY_MM_DD_HH_MM_SS_MS = "yyyy-MM-dd HH:mm:ss.fff"; |
| | | public static String YYYY_MM_DD_HH_MM_SS_MS = "yyyy-MM-dd HH:mm:ss.SSS"; |
| | | public static String HH_MM_SS = "HH:mm:ss"; |
| | | |
| | | private static String[] parsePatterns = { |