| | |
| | | import com.ard.oss.service.impl.OssServiceContext; |
| | | import com.ard.sample.utils.TimestampUtils; |
| | | import com.ard.sample.utils.VideoDurationUtilFFmpeg; |
| | | import com.ard.sample.wayline.model.dto.WaylineJobDTO; |
| | | import com.ard.sample.wayline.service.IWaylineJobService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ard.sample.common.model.Pagination; |
| | |
| | | |
| | | @Autowired |
| | | private IDeviceDictionaryService deviceDictionaryService; |
| | | |
| | | @Autowired |
| | | private IWaylineJobService _waylineJobService; |
| | | |
| | | @Autowired |
| | | private OssServiceContext ossService; |
| | |
| | | return new PaginationData<MediaFileDTO>(records, new Pagination(pageData)); |
| | | } |
| | | |
| | | /** |
| | | * 分页获取媒体文件列表 |
| | | * 增加筛选条件 |
| | | * @param page 当前页码 |
| | | * @param pageSize 每页大小 |
| | | * @return 分页数据对象,包含媒体文件列表和分页信息 |
| | | */ |
| | | @Override |
| | | public PaginationData<MediaFileDTO> getMediaFilesPagination(long page, long pageSize) { |
| | | public PaginationData<MediaFileDTO> getMediaFilesPagination(long page, long pageSize, String jobId, Long startTime, Long endTime) { |
| | | Page<MediaFileEntity> pageData = mapper.selectPage( |
| | | new Page<MediaFileEntity>(page, pageSize), |
| | | new LambdaQueryWrapper<MediaFileEntity>() |
| | | .eq(jobId != null, MediaFileEntity::getJobId, jobId) |
| | | .ge(startTime != null, MediaFileEntity::getStartTime, startTime) |
| | | .le(endTime != null, MediaFileEntity::getStartTime, endTime) |
| | | .orderByDesc(MediaFileEntity::getId)); |
| | | List<MediaFileDTO> records = pageData.getRecords() |
| | | .stream() |
| | |
| | | } |
| | | |
| | | /** |
| | | * Convert the received file object into a database entity object. |
| | | * 将接收到的文件对象转换为数据库实体对象。 |
| | | * @param file |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Convert database entity objects into file data transfer object. |
| | | * 将数据库实体对象转换为文件数据传输对象。 |
| | | * @param entity |
| | | * @return |
| | | */ |
| | |
| | | Instant.ofEpochMilli(entity.getEndTime()), ZoneId.systemDefault()).format(DATE_TIME_FORMATTER)) |
| | | .duration(entity.getDuration()) |
| | | .drone(entity.getDrone()) |
| | | .jobId(entity.getJobId()); |
| | | .jobId(entity.getJobId()) |
| | | .jobName(entity.getJobName()); |
| | | |
| | | } |
| | | |