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
package com.ard.web.controller.sample.wayline;
 
import com.ard.sample.common.model.ResponseResult;
import com.ard.sample.manage.model.dto.WaylineTrajectoryDTO;
import com.ard.sample.manage.service.IWaylineTrajectoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Optional;
 
@Api(tags = "航线历史任务轨迹")
@RequestMapping("/dock/waylineTrajectory")
@RestController
public class WaylineTrajectoryController {
    @Autowired
    private IWaylineTrajectoryService _waylineTrajectoryService;
 
    @ApiOperation("获取航线任务轨迹")
    @GetMapping("/flight-id")
    public ResponseResult<WaylineTrajectoryDTO> getJob(@RequestParam(name = "job_id") String jobId) {
        try {
            if(jobId == null){
                return ResponseResult.error(98,"任务ID不能为空");
            }
            WaylineTrajectoryDTO waylineJobDTO = _waylineTrajectoryService.getWayLineTrajectorybyJobID(jobId);
            if(waylineJobDTO==null) {
                return ResponseResult.error(99,"任务不存在");
            }
            return ResponseResult.success(waylineJobDTO);
        } catch (Exception e) {
            return ResponseResult.error(97, "获取航线轨迹发生异常:"+e.getMessage());
        }
    }
}