Merge remote-tracking branch 'origin/ht-dev' into ht-dev
7 files modified
1 files added
| | |
| | | return ResponseResult.success(data); |
| | | } |
| | | |
| | | @GetMapping("/{workspace_id}/jobs-dp") |
| | | @SysLogAnnotation(operModul = "计划库", operType = "查询", operDesc = "分页查询") |
| | | public ResponseResult<PaginationData<WaylineJobDTO>> getJobsByState(@RequestParam(defaultValue = "1") Long page, |
| | | @RequestParam(name = "page_size", defaultValue = "10") Long pageSize, |
| | | @PathVariable(name = "workspace_id") String workspaceId, |
| | | @RequestParam(name = "order", defaultValue = "") String order, |
| | | WaylineJobQueryParam waylineJobQueryParam) { |
| | | PaginationData<WaylineJobDTO> data = waylineJobService.getJobsByWorkspaceIdNew(workspaceId, page, pageSize, waylineJobQueryParam,order); |
| | | return ResponseResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * 子查询 |
| | | * @param workspaceId |
| | |
| | | |
| | | Page<WaylineJobEntity> getPage(Page<WaylineJobEntity> waylineJobEntityPage, @Param("queryParam") WaylineJobQueryParam param, @Param("workspaceId") String workspaceId); |
| | | |
| | | /** |
| | | * 不分子任务列表 |
| | | * @param waylineJobEntityPage |
| | | * @param param |
| | | * @param workspaceId |
| | | * @return |
| | | */ |
| | | Page<WaylineJobEntity> getPageNew(Page<WaylineJobEntity> waylineJobEntityPage, @Param("queryParam") WaylineJobQueryParam param, @Param("workspaceId") String workspaceId,@Param("order") String order); |
| | | |
| | | WaylineJobEntity getLatest(@Param("workspaceId")String workspaceId,@Param("queryParam") WaylineJobQueryParam waylineJobQueryParam); |
| | | |
| | | List<WaylineJobEntity> getJobs(@Param("workspaceId") String workspaceId,@Param("queryParam") WaylineJobQueryParam waylineJobQueryParam); |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getPageNew" resultType="com.dji.sample.wayline.model.entity.WaylineJobEntity"> |
| | | |
| | | SELECT job.*, |
| | | ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM wayline_job WHERE parent_id = job.id ) AS hasChildren |
| | | FROM wayline_job job |
| | | LEFT JOIN wayline_file file ON job.file_id = file.wayline_id |
| | | WHERE job.workspace_id = #{workspaceId} |
| | | <if test="queryParam.taskType != null and queryParam.taskType!= '' or queryParam.taskType==0 "> |
| | | AND job.task_type = #{queryParam.taskType} |
| | | </if> |
| | | |
| | | <if test="queryParam.name != null and queryParam.name != '' "> |
| | | AND ( (job.name LIKE CONCAT('%',#{queryParam.name},'%'))or(file.name LIKE CONCAT('%',#{queryParam.name},'%')) ) |
| | | </if> |
| | | |
| | | <if test="queryParam.status != null and queryParam.status !='' "> |
| | | AND job.status in |
| | | <foreach collection="queryParam.status.split(',')" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="queryParam.startTime !=null and queryParam.endTime !=null"> |
| | | AND DATE_FORMAT(FROM_UNIXTIME(job.begin_time/1000,'%Y-%m-%d'),'%Y-%m-%d') >= DATE_FORMAT(#{queryParam.startTime},'%Y-%m-%d') |
| | | </if> |
| | | |
| | | <if test="queryParam.endTime !=null and queryParam.endTime !=null"> |
| | | AND DATE_FORMAT(FROM_UNIXTIME(job.end_time/1000,'%Y-%m-%d'),'%Y-%m-%d') <= DATE_FORMAT(#{queryParam.endTime},'%Y-%m-%d') |
| | | </if> |
| | | |
| | | <if test="queryParam.dockSn != null and queryParam.dockSn != '' "> |
| | | AND job.dock_sn in |
| | | <foreach collection="queryParam.dockSn.split(',')" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="order != null and order != '' and order == 'DESC'"> |
| | | ORDER BY job.begin_time DESC |
| | | </if> |
| | | <if test="order != null and order != '' and order == 'ASC'"> |
| | | ORDER BY job.begin_time ASC |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="getLatest" resultType="com.dji.sample.wayline.model.entity.WaylineJobEntity"> |
| | | SELECT job.* FROM wayline_job job |
| | | WHERE job.workspace_id = #{workspaceId} |
| | |
| | | private String flightId; |
| | | |
| | | private String trackId; |
| | | |
| | | /** |
| | | * 航线断点信息 |
| | | */ |
| | | private WaylineTaskProgressExtBreakPoint breakPoint; |
| | | } |
| New file |
| | |
| | | package com.dji.sample.wayline.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @PROJECT_NAME: iot_drone_api |
| | | * @DESCRIPTION: |
| | | * @USER: aix |
| | | * @DATE: 2024/3/22 14:54 |
| | | */ |
| | | @Data |
| | | public class WaylineTaskProgressExtBreakPoint { |
| | | |
| | | private Integer attitudeHead; |
| | | private Integer breakReason; |
| | | private Integer height; |
| | | private Integer index; |
| | | private Integer latitude; |
| | | private Integer longitude; |
| | | private Integer progress; |
| | | private Integer state; |
| | | private Integer waylineId; |
| | | |
| | | } |
| | |
| | | import com.dji.sample.wayline.model.entity.WaylineJobEntity; |
| | | import com.dji.sample.wayline.model.enums.WaylineJobStatusEnum; |
| | | import com.dji.sample.wayline.model.param.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.messaging.MessageHeaders; |
| | | |
| | | import java.sql.SQLException; |
| | |
| | | PaginationData<WaylineJobDTO> getJobsByWorkspaceId(String workspaceId, long page, long pageSize, WaylineJobQueryParam waylineJobQueryParam); |
| | | |
| | | /** |
| | | * 不分子任务列表 |
| | | * @param workspaceId |
| | | * @param page |
| | | * @param pageSize |
| | | * @param waylineJobQueryParam |
| | | * @return |
| | | */ |
| | | PaginationData<WaylineJobDTO> getJobsByWorkspaceIdNew(String workspaceId, long page, long pageSize, WaylineJobQueryParam waylineJobQueryParam, String order); |
| | | |
| | | /** |
| | | * Process to get interface data of flight mission resources. |
| | | * @param receiver |
| | | * @param headers |
| | |
| | | */ |
| | | @ServiceActivator(inputChannel = ChannelName.INBOUND_EVENTS_FLIGHT_TASK_PROGRESS, outputChannel = ChannelName.OUTBOUND_EVENTS) |
| | | public CommonTopicReceiver handleProgress(CommonTopicReceiver receiver, MessageHeaders headers) { |
| | | log.info("上报航线任务进度: {}", receiver.toString()); |
| | | EventsReceiver<WaylineTaskProgressReceiver> eventsReceiver = mapper.convertValue(receiver.getData(), |
| | | new TypeReference<EventsReceiver<WaylineTaskProgressReceiver>>(){}); |
| | | eventsReceiver.setBid(receiver.getBid()); |
| | |
| | | |
| | | WaylineTaskProgressReceiver output = eventsReceiver.getOutput(); |
| | | |
| | | log.info("Task progress: {}", output.getProgress().toString()); |
| | | log.info("任务进度: {}", output.getProgress().toString()); |
| | | |
| | | if (null != output.getExt().getBreakPoint()) { |
| | | log.info("任务进度 ===> 断点信息:{}", output.getExt().getBreakPoint().toString()); |
| | | } |
| | | |
| | | if (eventsReceiver.getResult() != ResponseResult.CODE_SUCCESS) { |
| | | log.error("Task progress ===> Error code: " + eventsReceiver.getResult()); |
| | | log.error("任务进度 ===> 错误编码: " + eventsReceiver.getResult()); |
| | | } |
| | | |
| | | EventsResultStatusEnum statusEnum = EventsResultStatusEnum.find(output.getStatus()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PaginationData<WaylineJobDTO> getJobsByWorkspaceIdNew(String workspaceId, long page, long pageSize, WaylineJobQueryParam waylineJobQueryParam, String order) { |
| | | Page<WaylineJobEntity> pageData = mapper.getPageNew(new Page<WaylineJobEntity>(page, pageSize), waylineJobQueryParam, workspaceId,order); |
| | | |
| | | List<WaylineJobDTO> records = pageData.getRecords() |
| | | .stream() |
| | | .map(this::entity2Dto) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return new PaginationData<WaylineJobDTO>(records, new Pagination(pageData)); |
| | | } |
| | | |
| | | @Override |
| | | public List<WaylineJobDTO> getChildrenJobs(String workspaceId, WaylineJobQueryParam waylineJobQueryParam) { |
| | | |
| | | List<WaylineJobEntity> list = mapper.getJobs(workspaceId, waylineJobQueryParam); |