From 76861803e45e1e8746577f08661cccbb3cf13eb1 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 16 三月 2023 19:06:27 +0800 Subject: [PATCH] 1 --- ExportMap/cs/SGUtils.cs | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ExportMap/cs/SGUtils.cs b/ExportMap/cs/SGUtils.cs index c3fe028..24f0771 100644 --- a/ExportMap/cs/SGUtils.cs +++ b/ExportMap/cs/SGUtils.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Configuration; using System.Data; +using System.IO; using System.Linq; using System.Web; @@ -60,12 +61,17 @@ /// </summary> /// <param name="args">XYZ鍙傛暟</param> /// <returns>琛屾暟</returns> - public static int Release(XYZArgs args) + public int Release(XYZArgs args) { List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('mpt', '3dml')"); if (null == list || list.Count == 0) return 0; int maxId = GetMaxId(); + RomoveNoneFiles(list); + + + + List<SpatialItem> items = SelectItems(maxId); if (null == items || items.Count == 0) return 0; @@ -94,8 +100,29 @@ DataTable dt = SQLiteHelper.GetDataTable(sql); List<SpatialItem> list = ModelHandler.FillModel<SpatialItem>(dt); - return list; } + + /// <summary> + /// 绉婚櫎绌烘枃浠� + /// </summary> + private void RomoveNoneFiles(List<SysMeta> list) + { + string uploadFolder = Tool.GetSetting("uploadFolder"); + + int i = 0; + while (i < list.Count) + { + SysMeta meta = list[i]; + string filePath = Path.Combine(uploadFolder, meta.path); + if (!File.Exists(filePath)) + { + list.RemoveAt(i); + continue; + } + + // + } + } } } -- Gitblit v1.9.3