From cc7b680aa5b2a6ad599c394715bb4327de8670bf Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Tue, 25 Jun 2024 14:37:32 +0800
Subject: [PATCH] 调查取证手动航线更新图斑调查状态,新增媒体查询接口视频图片筛查,调整定时任务时间,新增航线任务错误代码识别

---
 src/main/java/com/dji/sample/wayline/controller/WaylineJobController.java |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/dji/sample/wayline/controller/WaylineJobController.java b/src/main/java/com/dji/sample/wayline/controller/WaylineJobController.java
index 5d9fdf8..d587c29 100644
--- a/src/main/java/com/dji/sample/wayline/controller/WaylineJobController.java
+++ b/src/main/java/com/dji/sample/wayline/controller/WaylineJobController.java
@@ -13,6 +13,7 @@
 import com.dji.sample.wayline.model.param.*;
 import com.dji.sample.wayline.service.IWaylineJobService;
 import com.dji.sample.wayline.service.impl.WaylineJobServiceImpl;
+import com.dji.sample.wayline.util.ErrorCodeUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -78,13 +79,14 @@
 
     /**
      * 断点任务
+     *
      * @return
      */
     @PostMapping("/{workspace_id}/breakpoint-tasks")
     @SysLogAnnotation(operModul = "计划库", operType = "断点续飞", operDesc = "创建航路任务(重复定时和连续执行)")
     public ResponseResult breakPointJob(HttpServletRequest request, @Valid @RequestBody BreakPointJobParam param,
                                         @PathVariable(name = "workspace_id") String workspaceId) throws SQLException {
-        Optional<WaylineJobDTO> waylineJobDTO = waylineJobService.getJobByJobId(workspaceId, param.getJobId(),param.isBreakPoint());
+        Optional<WaylineJobDTO> waylineJobDTO = waylineJobService.getJobByJobId(workspaceId, param.getJobId(), param.isBreakPoint());
         return waylineJobService.publishOneFlightTask(waylineJobDTO.get());
     }
 
@@ -108,23 +110,24 @@
     @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);
+                                                                        @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
      * @return
      */
     @GetMapping("/{workspace_id}/getChildrenJobs")
     @SysLogAnnotation(operModul = "计划库", operType = "查询", operDesc = "分页查询")
     public ResponseResult<List<WaylineJobDTO>> getChildrenJobs(
-                                                                 @PathVariable(name = "workspace_id") String workspaceId, WaylineJobQueryParam waylineJobQueryParam) {
+            @PathVariable(name = "workspace_id") String workspaceId, WaylineJobQueryParam waylineJobQueryParam) {
         List<WaylineJobDTO> data = waylineJobService.getChildrenJobs(workspaceId, waylineJobQueryParam);
         return ResponseResult.success(data);
     }
@@ -143,6 +146,10 @@
         return ResponseResult.success(waylineJobEntity);
     }
 
+    @GetMapping("/code")
+    public ResponseResult errotCode(@RequestParam Integer code) {
+        return ResponseResult.success(ErrorCodeUtil.codeToReason(code));
+    }
 
     /**
      * 发送命令取消作业。
@@ -188,9 +195,9 @@
      * 统计飞行次数
      */
     @PostMapping("/{workspace_id}/patrol_statistics")
-    public ResponseResult<WaylineJobCountDTO> patrolStatistics(@PathVariable(name = "workspace_id") String workspaceId,String queryTime,String deviceSn) {
+    public ResponseResult<WaylineJobCountDTO> patrolStatistics(@PathVariable(name = "workspace_id") String workspaceId, String queryTime, String deviceSn) {
 
-        WaylineJobCountDTO waylineJobCountDTO = waylineJobService.patrolStatistics(workspaceId,queryTime,deviceSn);
+        WaylineJobCountDTO waylineJobCountDTO = waylineJobService.patrolStatistics(workspaceId, queryTime, deviceSn);
 
         return ResponseResult.success(waylineJobCountDTO);
     }
@@ -218,7 +225,7 @@
      */
     @PostMapping("/{sn}/jobs/{device_sn}/flyByArea")
     @SysLogAnnotation(operModul = "根据区域飞行", operType = "根据区域飞行", operDesc = "根据区域飞行")
-    public ResponseResult flyByArea(@PathVariable(name = "sn") String sn, @RequestBody FlyAreaParam flyAreaParam,@PathVariable(name = "device_sn")String deviceSn)throws Exception {
-            return waylineJobService.flyByArea(sn, flyAreaParam,deviceSn);
+    public ResponseResult flyByArea(@PathVariable(name = "sn") String sn, @RequestBody FlyAreaParam flyAreaParam, @PathVariable(name = "device_sn") String deviceSn) throws Exception {
+        return waylineJobService.flyByArea(sn, flyAreaParam, deviceSn);
     }
 }

--
Gitblit v1.9.3