guoshilong
2023-11-13 2caa210098644f51ff46daa33b87ce4b7f862a91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
package com.dji.sample.wayline.service;
 
import com.dji.sample.common.model.CustomClaim;
import com.dji.sample.common.model.PaginationData;
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.component.mqtt.model.CommonTopicReceiver;
import com.dji.sample.wayline.model.dto.WaylineJobCountDTO;
import com.dji.sample.wayline.model.dto.WaylineJobDTO;
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.springframework.messaging.MessageHeaders;
 
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
 
/**
 * @author sean
 * @version 1.1
 * @date 2022/6/1
 */
public interface IWaylineJobService {
 
    /**
     * Create wayline job in the database.
     * @param param
     * @param workspaceId   user info
     * @param username      user info
     * @param beginTime     The time the job started.
     * @param endTime       The time the job ended.
     * @return
     */
    Optional<WaylineJobDTO> createWaylineJob(CreateJobParam param, String workspaceId, String username, Long beginTime, Long endTime);
 
    /**
     * Create a sub-task based on the information of the parent task.
     * @param workspaceId
     * @param parentId
     * @return
     */
    Optional<WaylineJobDTO> createWaylineJobByParent(String workspaceId, String parentId);
 
    /**
     * Issue wayline mission to the dock.
     * 向机场发出航线任务
     * @param param
     * @param customClaim   user info
     * @return
     */
    ResponseResult publishFlightTask(CreateJobParam param, CustomClaim customClaim) throws SQLException;
 
    /**
     * Issue wayline mission to the dock.
     * 向机场发出航线任务(重复任务和定时任务)
     * @param param
     * @param customClaim   user info
     * @return
     */
    ResponseResult publishFlightTaskCondition(CreateJobParam param, CustomClaim customClaim) throws SQLException;
 
    /**
     * Issue wayline mission to the dock.
     * 向机场添加航线任务指令
     * @param waylineJob
     * @return
     * @throws SQLException
     */
    ResponseResult publishOneFlightTask(WaylineJobDTO waylineJob) throws SQLException;
 
    /**
     * Execute the task immediately.
     * 执行立即任务
     * @param jobId
     * @throws SQLException
     * @return
     */
    Boolean executeFlightTask(String workspaceId, String jobId);
 
    /**
     * Cancel the task Base on job Ids.
     * @param workspaceId
     * @param jobIds
     * @throws SQLException
     */
    void cancelFlightTask(String workspaceId, Collection<String> jobIds);
 
    /**
     * Cancel the dock tasks that have been issued but have not yet been executed.
     * @param workspaceId
     * @param dockSn
     * @param jobIds
     */
    void publishCancelTask(String workspaceId, String dockSn, List<String> jobIds);
 
    /**
     * Query wayline jobs based on conditions.
     * @param workspaceId
     * @param jobIds
     * @param status
     * @return
     */
    List<WaylineJobDTO> getJobsByConditions(String workspaceId, Collection<String> jobIds, WaylineJobStatusEnum status);
 
    /**
     * Query job information based on job id.
     * @param workspaceId
     * @param jobId
     * @return job information
     */
    Optional<WaylineJobDTO> getJobByJobId(String workspaceId, String jobId);
 
    /**
     * Update job data.
     * @param dto
     * @return
     */
    Boolean updateJob(WaylineJobDTO dto) ;
 
    /**
     * Paginate through all jobs in this workspace.
     * @param workspaceId
     * @param page
     * @param pageSize
     * @return
     */
    PaginationData<WaylineJobDTO> getJobsByWorkspaceId(String workspaceId, long page, long pageSize, WaylineJobQueryParam waylineJobQueryParam);
 
    /**
     * Process to get interface data of flight mission resources.
     * @param receiver
     * @param headers
     */
    void flightTaskResourceGet(CommonTopicReceiver receiver, MessageHeaders headers);
 
    /**
     * Set the media files for this job to upload immediately.
     * @param workspaceId
     * @param jobId
     */
    void uploadMediaHighestPriority(String workspaceId, String jobId);
 
    /**
     * Manually control the execution status of wayline job.
     * @param workspaceId
     * @param jobId
     * @param param
     */
    void updateJobStatus(String workspaceId, String jobId, UpdateJobParam param);
 
    /**
     * Query the wayline execution status of the dock.
     * @param dockSn
     * @return
     */
    WaylineJobStatusEnum getWaylineState(String dockSn);
 
    /**
     * 获取最新的航线任务
     * @param workspaceId
     * @param waylineJobQueryParam
     * @return
     */
    WaylineJobEntity getLatestJob(String workspaceId, WaylineJobQueryParam waylineJobQueryParam);
 
    WaylineJobCountDTO patrolStatistics(String workspaceId);
 
    void updateJobCollect(WaylineJobEntity waylineJob);
 
    ResponseResult flyByArea(String sn, FlyAreaParam flyAreaParam);
 
    /**
     * 判断是否有下一次任务
     * @param job
     */
    ResponseResult checkNextJob(WaylineJobDTO job)  throws SQLException ;
}