| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.device.camera.domain.CameraCmd; |
| | | import com.ruoyi.device.external.domain.ArdEquipExternal; |
| | | import com.ruoyi.device.external.mapper.ArdEquipExternalMapper; |
| | | import com.ruoyi.device.radar.mapper.ArdEquipRadarMapper; |
| | |
| | | import com.ruoyi.utils.tube.GeoPoint; |
| | | import com.ruoyi.utils.tube.TubeTools; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.gavaghan.geodesy.GlobalCoordinates; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String radarId = radarAlarmData.getRadarId(); |
| | | String alarmpointName = ardAlarmRadar.getName();//兴趣点名称 |
| | | Double longitude = ardAlarmRadar.getLongitude(); |
| | | Double latitude = ardAlarmRadar.getLatitude(); |
| | | ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName); |
| | | if(well==null) |
| | | { |
| | | return; |
| | | } |
| | | Double longitude = well.getLongitude(); |
| | | Double latitude = well.getLatitude(); |
| | | String targetId = ardAlarmRadar.getTargetId(); |
| | | switch (ardAlarmRadar.getAlarmType()) { |
| | | case "运动目标检测": |
| | |
| | | ardAlarmRadarMove.setId(uuid); |
| | | ardAlarmRadarMove.setTargetId(targetId); |
| | | ardAlarmRadarMove.setAlarmTime(radarAlarmData.getAlarmTime()); |
| | | ardAlarmRadarMove.setCreateTime(DateUtils.covertTime(new Date())); |
| | | ardAlarmRadarMove.setCreateTime(new Date()); |
| | | ardAlarmRadarMove.setName(alarmpointName + "(" + radarAlarmData.getRadarName() + ")"); |
| | | ardAlarmRadarMove.setAlarmType("运动目标检测"); |
| | | ardAlarmRadarMove.setLongitude(longitude); |
| | |
| | | } else { |
| | | //否则比对更新时间 |
| | | Date lastUpdateTime = lastMoveData.getUpdateTime(); |
| | | |
| | | Date lastGuideTime = lastMoveData.getGuideTime(); |
| | | long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime); |
| | | if (secDatePoor <= radarMergeTime) { |
| | |
| | | ardAlarmRadarFire.setId(uuid); |
| | | ardAlarmRadarFire.setTargetId(targetId); |
| | | ardAlarmRadarFire.setAlarmTime(radarAlarmData.getAlarmTime()); |
| | | ardAlarmRadarFire.setCreateTime(DateUtils.covertTime(new Date())); |
| | | ardAlarmRadarFire.setCreateTime(new Date()); |
| | | ardAlarmRadarFire.setName(alarmpointName + "(" + radarAlarmData.getRadarName() + ")"); |
| | | ardAlarmRadarFire.setAlarmType("热源检测"); |
| | | ardAlarmRadarFire.setLongitude(longitude); |
| | |
| | | ardAlarmRadarPump.setId(uuid); |
| | | ardAlarmRadarPump.setTargetId(targetId); |
| | | ardAlarmRadarPump.setAlarmTime(radarAlarmData.getAlarmTime()); |
| | | ardAlarmRadarPump.setCreateTime(DateUtils.covertTime(new Date())); |
| | | ardAlarmRadarPump.setCreateTime(new Date()); |
| | | ardAlarmRadarPump.setName(ardAlarmRadar.getName() + "(" + radarAlarmData.getRadarName() + ")"); |
| | | ardAlarmRadarPump.setAlarmType("雷达抽油机停机"); |
| | | ardAlarmRadarPump.setUpdateTime(radarAlarmData.getAlarmTime()); |
| | |
| | | int index = name.indexOf("("); |
| | | String alarmpointName = name.substring(0, index); |
| | | //获取雷达所在塔上的大光电 |
| | | String cameraIdWithTower = ardEquipRadarMapper.getCameraByRadar(radarId); |
| | | if (StringUtils.isNotNull(cameraIdWithTower) && StringUtils.isNotEmpty(cameraIdWithTower)) { |
| | | log.debug("获取到雷达塔上的光电:" + cameraIdWithTower); |
| | | ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(radarId); |
| | | if (StringUtils.isNotNull(cameraWithTower)) { |
| | | log.debug("获取到雷达塔上的光电:" + cameraWithTower.getId()); |
| | | //如果雷达塔上有光电 |
| | | messagesEnqueued(cameraIdWithTower, alarmId, alarmType, createTime, 1, 1, coordinate); |
| | | messagesEnqueued(cameraWithTower.getId(), alarmId, alarmType, createTime, 1, 1, coordinate); |
| | | } else { |
| | | log.debug("未获取到雷达塔上的光电,无法引导"); |
| | | } |
| | |
| | | ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName); |
| | | if (StringUtils.isNotNull(ardAlarmpointsWell) && StringUtils.isNotEmpty(ardAlarmpointsWell.getCameraId())) { |
| | | String cameraId = ardAlarmpointsWell.getCameraId(); |
| | | if (cameraId.equals(cameraIdWithTower)) { |
| | | if (cameraId.equals(cameraWithTower.getId())) { |
| | | return; |
| | | } |
| | | log.info("获取到报警点关联的光电:" + cameraId); |