From 87b782c2132c645b667032598403896518055f9a Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 03 八月 2023 15:39:34 +0800
Subject: [PATCH] 1

---
 ExportMap/cs/ExportUtil.cs |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/ExportMap/cs/ExportUtil.cs b/ExportMap/cs/ExportUtil.cs
index 00c7851..344489f 100644
--- a/ExportMap/cs/ExportUtil.cs
+++ b/ExportMap/cs/ExportUtil.cs
@@ -1,4 +1,5 @@
 锘縰sing ExportMap.cs;
+using ExportMap.db;
 using ExportMap.Models;
 using Newtonsoft.Json;
 using System;
@@ -142,7 +143,8 @@
             CreateTemplate(args);
 
             string cmd = string.Format("python \"{0}\" -qgz {1} -qpt {2}", PyFile, qgz, args.qpt);
-            err = Tools.ExecCmd(null, cmd, true, true);
+            SysTask task = TaskDBHelper.CreateTask(ToXYZArgs(args), "PNG", "鍦ㄧ嚎鍒跺浘");
+            err = Tools.ExecCmd(task, cmd, true, true);
 
             string qptFile = Path.Combine(SourcesPath, args.qpt);
             if (File.Exists(qptFile)) File.Delete(qptFile);
@@ -154,6 +156,21 @@
         }
 
         /// <summary>
+        /// 杞崲涓篨YZ鍙傛暟
+        /// </summary>
+        private static XYZArgs ToXYZArgs(ExportArgs ea)
+        {
+            XYZArgs args = new XYZArgs();
+            args.name = ea.title;
+            args.ids = new List<int>();
+            args.depcode = null;
+            args.dircode = null;
+            args.userId = TaskDBHelper.SelectUserIdByToken(ea.token);
+
+            return args;
+        }
+
+        /// <summary>
         /// 鍒涘缓妯℃澘
         /// </summary>
         /// <param name="args">鍑哄浘鍙傛暟</param>

--
Gitblit v1.9.3