From f4c25e70497a233caba9e208c13f1b663bf0623f Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期六, 29 七月 2023 18:30:38 +0800
Subject: [PATCH] 删除服务时物理删除发布文件

---
 ExportMap/cs/Tools.cs |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/ExportMap/cs/Tools.cs b/ExportMap/cs/Tools.cs
index 000724c..6c8223d 100644
--- a/ExportMap/cs/Tools.cs
+++ b/ExportMap/cs/Tools.cs
@@ -288,6 +288,41 @@
             }
         }
 
+        /// <summary>
+        /// 鍒犻櫎鏂囦欢
+        /// </summary>
+        public static List<int> DeleteFiles(XYZArgs args, ref string err)
+        {
+            List<SysPublish> pubs = PubDBHelper.SelectPublishs(args.ids);
+            if (null == pubs || pubs.Count == 0) return null;
+
+            List<int> list = new List<int>();
+            foreach (SysPublish pub in pubs)
+            {
+                try
+                {
+                    if (string.IsNullOrEmpty(pub.url) || string.IsNullOrEmpty(pub.path)) continue;
+
+                    String path = SGUtils.LFData + "\\" + pub.path.Replace("\\tileset.json", "");
+                    if (pub.url.Contains("/SG/") || !Directory.Exists(path))
+                    {
+                        list.Add(pub.id);
+                        continue;
+                    }
+
+                    DelPath(path);
+                    list.Add(pub.id);
+                }
+                catch (Exception ex)
+                {
+                    LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
+                    err = ex.Message;
+                }
+            }
+
+            return list;
+        }
+
         [DllImport("ReadLas.dll")]
         public extern static int get_las_cs(string file_name);
     }

--
Gitblit v1.9.3