管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-07-30 110685ca201361af20d758fce7cf8a89ab5362b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
    {
        /// <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;
                    }
 
                    Tools.DelPath(path);
                    list.Add(pub.id);
                }
                catch (Exception ex)
                {
                    LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                    err = ex.Message;
                }
            }
 
            return list;
        }
 
        /// <summary>
        /// 删除任务
        /// </summary>
        public static List<int> DeleteTask(XYZArgs args, ref string err)
        {
            List<int> list = new List<int>();
            try
            {
 
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                err = ex.Message;
            }
 
            return list;
        }
    }
}