From 7cbbe62fea4efded9cf73939a860f7bbb2169458 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 23 三月 2023 18:07:57 +0800
Subject: [PATCH] 1

---
 ExportMap/cs/XYZUtils.cs |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ExportMap/cs/XYZUtils.cs b/ExportMap/cs/XYZUtils.cs
index 733fc45..5224d2b 100644
--- a/ExportMap/cs/XYZUtils.cs
+++ b/ExportMap/cs/XYZUtils.cs
@@ -78,11 +78,11 @@
         /// </summary>
         /// <param name="args">XYZ鍙傛暟</param>
         /// <param name="err">閿欒淇℃伅</param>
-        /// <returns>鏁版嵁鍙戝竷ID</returns>
-        public static int Generate(XYZArgs args, ref string err)
+        /// <returns>鏁版嵁鍙戝竷ID闆嗗悎</returns>
+        public static List<int> Generate(XYZArgs args, ref string err)
         {
             List<SysMeta> list = SelectMetas(args.ids, "and type in ('tif', 'tiff', 'img')");
-            if (null == list || list.Count == 0) return 0;
+            if (null == list || list.Count == 0) return null;
 
             string dateStr = ExportUtil.DateStr;
             //string batFile = Path.Combine(BatPath, dateStr + ".bat");
@@ -100,15 +100,17 @@
             //if (File.Exists(batFile)) File.Delete(batFile);
             if (File.Exists(tifFile)) File.Delete(tifFile);
 
+            List<int> ids = new List<int>();
             string viewFile = Path.Combine(xyzPath, "view.html");
             if (File.Exists(viewFile))
             {
                 string path = "2d\\tiles" + "\\" + args.dircode;
-                InsertToDB(list, args, path);
-                return 1;
+                int pubid = InsertToDB(list, args, path);
+
+                if (pubid > 0) ids.Add(pubid);
             }
 
-            return 0;
+            return ids;
         }
 
         /// <summary>
@@ -157,9 +159,9 @@
         /// <summary>
         /// 鎻掑叆鏁版嵁搴�
         /// </summary>
-        private static void InsertToDB(List<SysMeta> metas, XYZArgs args, string path)
+        private static int InsertToDB(List<SysMeta> metas, XYZArgs args, string path)
         {
-            if (PubDBHelper.IsPublish(args.dircode)) return;
+            if (PubDBHelper.IsPublish(args.dircode)) return 0;
 
             SysPublish sys = NewPublish(metas[0], args);
             sys.path = path;
@@ -178,6 +180,8 @@
                     PubDBHelper.InsertMetaPub(meta.id, pubid, args.userId);
                 }
             }
+
+            return pubid;
         }
 
         /// <summary>

--
Gitblit v1.9.3