From 7beea5916728a84617d4791775d0aac70ab32eee Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Fri, 12 Dec 2025 10:40:43 +0800
Subject: [PATCH] 2025-12-12 zwy 优化,订阅视频时,谁订阅发给谁直播地址,其他订阅不变

---
 ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java b/ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java
index 7862e01..e450a49 100644
--- a/ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java
+++ b/ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java
@@ -189,7 +189,7 @@
         }
 
         if (waylineJobOpt.isEmpty()) {
-            return ResponseResult.error("创建机场任务失败!");
+            return ResponseResult.error(314013000,"创建机场任务失败!");
         }
 
         WaylineJobDTO waylineJob = waylineJobOpt.get();
@@ -206,8 +206,8 @@
 //        }
         // 换航线表
         ArdRouteInfo ardRouteOpt = _ardRouteInfoService.selectArdRouteInfoById(waylineJob.getFileId());
-        if (ardRouteOpt == null) {
-            return ResponseResult.error("机场任务航线不存在!");
+        if (ardRouteOpt == null || ardRouteOpt.getPath1() == null || ardRouteOpt.getPath1().isEmpty()) {
+            return ResponseResult.error(314013001,"机场任务航线不存在!");
         }
 
         // get file url
@@ -222,7 +222,7 @@
             log.info("机场任务航线文件md5值:{}", md5);
         } catch (Exception e) {
             log.error("机场任务航线文件地址错误!{}", e.getMessage());
-            return ResponseResult.error("机场任务航线文件地址错误!" + e.getMessage());
+            return ResponseResult.error(314013002,"机场任务航线文件地址错误!" + e.getMessage());
         }
 
         log.info("机场任务-rth_mode的值:{}", waylineJob.getRthMode());
@@ -290,7 +290,7 @@
         // Issue an immediate task execution command.
         if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) {
             if (!executeFlightTask(waylineJob.getJobId())) {
-                return ResponseResult.error("Failed to execute job.");
+                return ResponseResult.error("无法执行作业。");
             }
         }
 
@@ -299,7 +299,7 @@
                      waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(),
                     waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
             if (!isAdd) {
-                return ResponseResult.error("Failed to create scheduled job.");
+                return ResponseResult.error("无法创建计划作业。");
             }
         }
 
@@ -309,7 +309,7 @@
     public ResponseResult publishFlightTaskPrepare(Optional<WaylineJobDTO> waylineJobOpt) throws SQLException{
 
         if (waylineJobOpt.isEmpty()) {
-            return ResponseResult.error("创建机场任务失败!");
+            return ResponseResult.error(314013000,"创建机场任务失败!");
         }
         WaylineJobDTO waylineJob = waylineJobOpt.get();
         boolean isOnline = deviceService.checkDeviceOnline(waylineJob.getDockSn());
@@ -318,21 +318,21 @@
         }
         // 换航线表
         ArdRouteInfo ardRouteOpt = _ardRouteInfoService.selectArdRouteInfoById(waylineJob.getFileId());
-        if (ardRouteOpt == null) {
-            return ResponseResult.error("机场任务航线不存在!");
+        if (ardRouteOpt == null || ardRouteOpt.getPath1() == null || ardRouteOpt.getPath1().isEmpty()) {
+            return ResponseResult.error(314013001,"机场任务航线不存在!");
         }
         // get file url
         URL url = null;
-        String minioUrl = subStringMinioUrlName(ardRouteOpt.getPath());
+        String minioUrl = subStringMinioUrlName(ardRouteOpt.getPath1());
         String md5 = "";
         try (InputStream inputStream = _ossService.getObject(kmzPath, minioUrl)) {
             md5 = DigestUtils.md5Hex(inputStream);
-            url = new URL(ardRouteOpt.getPath());
+            url = new URL(ardRouteOpt.getPath1());
             log.info("机场任务航线文件url地址:{}", url);
             log.info("机场任务航线文件md5值:{}", md5);
         } catch (Exception e) {
             log.error("机场任务航线文件地址错误!{}", e.getMessage());
-            return ResponseResult.error("机场任务航线文件地址错误!" + e.getMessage());
+            return ResponseResult.error(314013002,"机场任务航线文件地址错误!" + e.getMessage());
         }
 
         WaylineTaskCreateDTO flightTask = WaylineTaskCreateDTO.builder()
@@ -342,6 +342,7 @@
                 .waylineType(waylineJob.getWaylineType())
                 .rthAltitude(waylineJob.getRthAltitude())
                 .outOfControlAction(waylineJob.getOutOfControlAction())
+                .rthMode(waylineJob.getRthMode())
                 .file(WaylineTaskFileDTO.builder()
                         .url(url.toString())
 //                        .fingerprint(waylineFile.get().getSign())
@@ -396,7 +397,7 @@
         // Issue an immediate task execution command.
         if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) {
             if (!executeFlightTask(waylineJob.getJobId())) {
-                return ResponseResult.error("Failed to execute job.");
+                return ResponseResult.error("无法执行作业。");
             }
         }
 
@@ -405,7 +406,7 @@
                      waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(),
                     waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
             if (!isAdd) {
-                return ResponseResult.error("Failed to create scheduled job.");
+                return ResponseResult.error("无法创建计划作业。");
             }
         }
 

--
Gitblit v1.9.3