| | |
| | | import com.dji.sample.territory.pojo.TerritoryConfigPojo; |
| | | import com.dji.sample.territory.service.impl.TbFjServiceImpl; |
| | | import com.dji.sample.territory.utils.WaterMarkUtil; |
| | | import com.dji.sample.wayline.service.IWaylineFileService; |
| | | import com.dji.sample.wayline.service.IWaylineJobService; |
| | | import com.drew.imaging.ImageProcessingException; |
| | | import io.minio.MinioClient; |
| | |
| | | private TerritoryConfigPojo territoryConfigPojo; |
| | | @Autowired |
| | | private IWaylineJobService waylineJobService; |
| | | @Autowired |
| | | private IWaylineFileService waylineFileService; |
| | | |
| | | private Optional<MediaFileEntity> getMediaByFingerprint(String workspaceId, String fingerprint) { |
| | | MediaFileEntity fileEntity = mapper.selectOne(new LambdaQueryWrapper<MediaFileEntity>() |
| | |
| | | MediaFileEntity fileEntity = this.fileUploadConvertToEntity(file); |
| | | fileEntity.setWorkspaceId(workspaceId); |
| | | fileEntity.setFileId(UUID.randomUUID().toString()); |
| | | updateInvestigate(file.getExt().getFlightId()); |
| | | return mapper.insert(fileEntity); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PaginationData<MediaFileEntity> MediaQuery(Integer page, Integer pageSize, Long updateStart, Long updateEnd, Long photoStart, Long photoEnd, String jobName, String workspaceId) { |
| | | public PaginationData<MediaFileEntity> MediaQuery(Integer page, Integer pageSize, Long updateStart, Long updateEnd, Long photoStart, Long photoEnd, String jobName, String workspaceId,String type) { |
| | | // 创建分页对象 |
| | | Page<MediaFileEntity> pageObj = new Page<>(page, pageSize); |
| | | |
| | |
| | | } |
| | | |
| | | if (jobName != null && !jobName.isEmpty()) { |
| | | List<String> jobIds = waylineJobService.getJobId(jobName); |
| | | List<String> jobIds = waylineJobService.getJobIds(jobName); |
| | | queryWrapper.in(MediaFileEntity::getJobId, jobIds); |
| | | } |
| | | |
| | | if (type != null && !type.isEmpty()) { |
| | | if ("图片".equals(type)) { |
| | | queryWrapper.likeLeft(MediaFileEntity::getFileName, ".jpeg"); |
| | | } else if ("视频".equals(type)) { |
| | | queryWrapper.likeLeft(MediaFileEntity::getFileName, ".mp4"); |
| | | } |
| | | } |
| | | queryWrapper.orderByDesc(MediaFileEntity::getCreateTime); |
| | | // 执行分页查询 |
| | | Page<MediaFileEntity> resultPage = mapper.selectPage(pageObj, queryWrapper); |
| | | |
| | |
| | | String taskNameResult = waylineJobService.getName(mediaFile.getJobId()); |
| | | mediaFile.setJobName(taskNameResult); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | .collect(Collectors.toList() |
| | | ); |
| | | |
| | | // 返回分页数据 |
| | | return new PaginationData<>(records, new Pagination(resultPage)); |
| | | |
| | | } |
| | | |
| | | public void updateInvestigate(String jobId){ |
| | | String waylineId=waylineJobService.getWaylineId(jobId); |
| | | String patchesId=waylineFileService.getPatchesId(waylineId); |
| | | if (patchesId==null){ |
| | | return; |
| | | } |
| | | List<Long> ids = Arrays.stream(patchesId.split(",")) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | LambdaUpdateWrapper<LotInfo> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.in(LotInfo::getId, ids) |
| | | .set(LotInfo::getInvestigate, 1); |
| | | patchesMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<MediaFileEntity> listMediaFileEntity(String workspaceId, String jobId) { |
| | | return mapper.selectList(new LambdaQueryWrapper<MediaFileEntity>() |