From 6545b0cb0817378cff3b20d962d4c4f0d51f2207 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Thu, 11 Apr 2024 09:39:28 +0800
Subject: [PATCH] 完善图斑线上配置

---
 src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java |   19 +++++++++++++++++--
 src/main/resources/application-dev.yml                                     |   14 +++++++++++---
 src/main/resources/application-prod.yml                                    |   10 +++++++++-
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java b/src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java
index 0bd0cb8..a7f1cfc 100644
--- a/src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java
+++ b/src/main/java/com/dji/sample/patches/xml/utils/CreateWaylineFileUtils.java
@@ -3,6 +3,7 @@
 import com.dji.sample.patches.xml.mode.XMLTemplateModel;
 import freemarker.template.Configuration;
 import freemarker.template.Template;
+import org.springframework.beans.factory.annotation.Value;
 import lombok.extern.slf4j.Slf4j;
 
 import java.io.*;
@@ -17,13 +18,27 @@
 @Slf4j
 public class CreateWaylineFileUtils {
 
+    @Value("${xml.temple.template}")
+    static String templeFilePath;
+    @Value("${xml.temple.waylines}")
+    static String waylineFilePath;
+
+    @Value("${xml.target.template}")
+    static String targetTempleFilePath;
+    @Value("${xml.target.waylines}")
+    static String targetWaylineFilePath;
     /**
      * 生成航线文件
      * @param xmlModel
      */
     public static void createWaylineFile(XMLTemplateModel xmlModel) {
-        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\template.xml", "home\\drone\\server\\template\\wpmz\\template.kml");
-        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\waylines.xml", "home\\drone\\server\\template\\wpmz\\waylines.wpml");
+
+
+//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\template.xml", "home\\drone\\server\\template\\wpmz\\template.kml");
+//        xml2XmlDoc(xmlModel, "home\\drone\\server\\template\\waylines.xml", "home\\drone\\server\\template\\wpmz\\waylines.wpml");
+
+        xml2XmlDoc(xmlModel, templeFilePath, targetTempleFilePath);
+        xml2XmlDoc(xmlModel, waylineFilePath, targetWaylineFilePath);
     }
 
     /**
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 36b802b..69d18b5 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -90,7 +90,15 @@
 Patches:
   url:
     path:
-      unzip: D:/tmp/
+      unzip: D:\\tmp\\
       kmz:
-        destKMZFile: src/main/resources/template/kmz/
-        sourceDir: src/main/resources/template/wpmz/
\ No newline at end of file
+        destKMZFile: src\\main\\resources\\template\\kmz\\
+        sourceDir: src\\main\\resources\\template\\wpmz\\
+
+xml:
+  temple:
+    template: src\\main\\resources\\template\\template.xml
+    waylines: src\\main\\resources\\template\\waylines.xml
+  target:
+    template: src\\main\\resources\\template\\wpmz\\template.kml
+    waylines: src\\main\\resources\\template\\wpmz\\waylines.wpml
\ No newline at end of file
diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml
index 3b8785c..87cfe62 100644
--- a/src/main/resources/application-prod.yml
+++ b/src/main/resources/application-prod.yml
@@ -93,7 +93,15 @@
 Patches:
   url:
     path:
-      unzip: /home/drone/server/temp
+      unzip: /home/drone/server/temp/
       kmz:
         destKMZFile: /home/drone/server/template/kmz/
         sourceDir: /home/drone/server/template/wpmz/
+#解析图斑航线模板的地址
+xml:
+  temple:
+    template: home/drone/server/template/template.xml
+    waylines: home/drone/server/template/waylines.xml
+  target:
+    template: home/drone/server/template/wpmz/template.kml
+    waylines: home/drone/server/template/wpmz/waylines.wpml
\ No newline at end of file

--
Gitblit v1.9.3