using ExportMap.db; using ExportMap.Models; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; namespace ExportMap.cs { public class CommonUtils { /// /// 删除文件 /// public static List DeleteFiles(XYZArgs args, ref string err) { List pubs = PubDBHelper.SelectPublishs(args.ids); if (null == pubs || pubs.Count == 0) return null; List list = new List(); 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; } Tools.DelPath(path); list.Add(pub.id); } catch (Exception ex) { LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); err = ex.Message; } } return list; } /// /// 删除任务 /// public static List DeleteTask(XYZArgs args, ref string err) { List list = new List(); try { } catch (Exception ex) { LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); err = ex.Message; } return list; } } }