管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-03-17 b00121d9909d4e1d3233fe2161ca7fe1992051d5
ExportMap/cs/SGUtils.cs
@@ -4,8 +4,10 @@
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Web;
namespace ExportMap.cs
@@ -68,12 +70,19 @@
            int maxId = GetMaxId();
            RomoveNoneFiles(list);
            if (list.Count == 0) return 0;
            LinkFiles(list);
            for (int i = 0; i < 25; i++)
            {
                Thread.Sleep(3000);
                List<SpatialItem> items = SelectItems(maxId);
                if (null == items || items.Count == 0) continue;
            List<SpatialItem> items = SelectItems(maxId);
            if (null == items || items.Count == 0) return 0;
                //
            }
            return 0;
        }
@@ -135,5 +144,42 @@
                i++;
            }
        }
        /// <summary>
        /// 链接文件
        /// </summary>
        private string LinkFiles(List<SysMeta> metas)
        {
            string uploadFolder = Tool.GetSetting("uploadFolder");
            List<string> list = new List<string>();
            foreach (SysMeta meta in metas)
            {
                switch (meta.type)
                {
                    case "3dml":
                        string d3ml = Path.Combine(uploadFolder, meta.path);
                        break;
                    case "mpt":
                        string mpt = Path.Combine(uploadFolder, meta.path);
                        string midx = Path.Combine(uploadFolder, meta.path.Replace(".mpt", ".midx"));
                        string strmi = Path.Combine(uploadFolder, meta.path.Replace(".mpt", ".strmi"));
                        break;
                }
            }
            //foreach (string file in list)
            //{
            //    string fileName = Path.GetFileName(file);
            //    string path = Path.Combine(target, fileName);
            //    string text = string.Format("mklink \"{0}\" \"{1}\"", path, file); // /H
            //    p.StandardInput.WriteLine(text);
            //}
            string str = Tool.ExecCmd(list);
            return str;
        }
    }
}