| | |
| | | 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; |
| | |
| | | List<DeptAndCamerasDto> deptAndCamerasList = sysDepts.stream() |
| | | .map(sysDept -> { |
| | | List<ArdCameras> ardCameras = ardCamerasMapper.selectArdCamerasByDeptId(sysDept.getDeptId()); |
| | | ardCameras.stream().forEach(ardCamera ->{ |
| | | ArdChannel ardChannel = new ArdChannel(); |
| | | ardChannel.setDeviceId(ardCamera.getId()); |
| | | List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); |
| | | if (ardChannels != null) { |
| | | ardCamera.setChannelList(ardChannels); |
| | | } |
| | | }); |
| | | DeptAndCamerasDto deptAndCamerasDto = new DeptAndCamerasDto(); |
| | | deptAndCamerasDto.setSysDept(sysDept); |
| | | deptAndCamerasDto.setArdCamerasList(ardCameras); |
| | |
| | | public TreeMap getNearCamerasBycoordinate(CameraCmd cmd) { |
| | | try { |
| | | double[] targetPosition = cmd.getTargetPosition(); |
| | | if (targetPosition == null || (targetPosition != null && targetPosition.length == 0)) { |
| | | if (targetPosition == null) { |
| | | log.debug("目标位置为空"); |
| | | return new TreeMap<>(); |
| | | } |
| | |
| | | continue; |
| | | } |
| | | double[] camPosition = new double[]{camera.getLongitude(), camera.getLatitude()}; |
| | | double distance = GisUtil.getDistance(cmd.getTargetPosition(), camPosition); |
| | | double distance = GisUtil.getDistance(targetPosition, camPosition); |
| | | if (camera.getCamMaxVisibleDistance() == null) { |
| | | continue; |
| | | } |