管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-01-17 d633d8200bacc4a05996ba367d81e1dc6e60d572
1
已修改5个文件
已删除1个文件
125 ■■■■ 文件已修改
DataLoader/App.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/CS/Importor.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/DataLoader.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/Model/SysMeta.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/Model/SysMetaFile.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/htmls/login.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DataLoader/App.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="pgConn" value="Server=127.0.0.1;Port=5433;Database=langfang;User Id=postgres;Password=postgres;"/>
    <add key="pgConn" value="Server=192.168.20.83;Port=5433;Database=moon;User Id=postgres;Password=postgres;"/>
  </appSettings>
  <startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
DataLoader/CS/Importor.cs
@@ -25,9 +25,7 @@
            }
        }
        private static readonly string insertMeta = "insert into lf.sys_meta (name, dirid, depid, verid, type, sizes, cs, scale, resolution, gather, batch, descr, create_user) values (@name, @dirid, @depid, @verid, @type, @sizes, @cs, @scale, @resolution, @gather, @batch, @descr, @create_user) returning id";
        private static readonly string insertMetaFile = "insert into lf.sys_meta_file (name, metaid, fileid, guid, path, sizes, create_user) values (@name, @metaid, @fileid, @guid, @path, @sizes, @create_user)";
        private static readonly string insertMeta = "insert into lf.sys_meta (eventid, metaid, dirid, depid, verid, name, type, guid, path, sizes, tab, rows, create_user, create_time) values (@eventid, @metaid, @dirid, @depid, @verid, @name, @type, @guid, @path, @sizes, @tab, @rows, @create_user, now()) returning id";
        public static string GetFilePathByGuid(string guid)
        {
@@ -51,19 +49,9 @@
        public static int InsertMeta(SysMeta meta)
        {
            // string sql = "INSERT INTO public.data_files(mid, guid, name, ext, path, subs, remark) VALUES (@mid, @guid, @name, @ext, @path, @subs, @remark) returning id";
            List<DbParameter> list = Tool.GetParams<SysMeta>(insertMeta, meta);
            object obj = Helper.GetScalar(insertMeta, list.ToArray());
            return obj == null ? 0 : Convert.ToInt32(obj);
        }
        public static int InsertMetaFile(SysMetaFile metaFile)
        {
            List<DbParameter> list = Tool.GetParams<SysMetaFile>(insertMetaFile, metaFile);
            object obj = Helper.ExecuteNonQuery(insertMetaFile, list.ToArray());
            return obj == null ? 0 : Convert.ToInt32(obj);
        }
@@ -89,17 +77,11 @@
            vd.Meta = new SysMeta();
            vd.Meta.name = fi.Name;
            vd.Meta.dirid = 0;
            vd.Meta.depid = 0;
            vd.Meta.dirid = 1;
            vd.Meta.depid = 1;
            vd.Meta.verid = 0;
            vd.Meta.type = "file";
            vd.Meta.type = fi.Extension.ToLower().Replace(".", "");
            vd.Meta.sizes = Tool.SizeToMb(fi.Length);
            vd.Meta.cs = null;
            vd.Meta.scale = null;
            vd.Meta.resolution = null;
            vd.Meta.gather = DateTime.Now;
            vd.Meta.batch = null;
            vd.Meta.descr = null;
            vd.Meta.create_user = Tool.UserId;
        }
@@ -119,16 +101,15 @@
                    }
                    vd.Status = "插入数据库...";
                    int metaId = InsertMeta(vd.Meta);
                    start = GetSubPath(target, start);
                    SysMeta mf = GetMetaFile(vd, start, guid);
                    int metaId = InsertMeta(mf);
                    if (metaId == 0)
                    {
                        vd.Status = "元数据出错!";
                        continue;
                    }
                    start = GetSubPath(target, start);
                    SysMetaFile mf = GetMetaFile(vd, metaId, start, guid);
                    InsertMetaFile(mf);
                    vd.Status = "复制文件...";
                    CopyFile(vd.FilePath, Path.Combine(target, mf.path));
@@ -163,15 +144,21 @@
            }
        }
        private static SysMetaFile GetMetaFile(ViewData vd, int metaId, int subPath, string guid)
        private static SysMeta GetMetaFile(ViewData vd, int subPath, string guid)
        {
            SysMetaFile mf = new SysMetaFile();
            SysMeta mf = new SysMeta();
            mf.eventid = Guid.NewGuid().ToString();
            mf.metaid = 0;
            mf.dirid = vd.Meta.dirid;
            mf.depid = vd.Meta.depid;
            mf.verid = vd.Meta.verid;
            mf.name = vd.Meta.name;
            mf.metaid = metaId;
            mf.fileid = 0;
            mf.type = vd.Meta.type;
            mf.guid = guid;
            mf.path = subPath + "\\" + mf.name;
            mf.sizes = vd.Meta.sizes;
            mf.tab = null;
            mf.rows = 0;
            mf.create_user = vd.Meta.create_user;
            return mf;
DataLoader/DataLoader.csproj
@@ -93,7 +93,6 @@
    <Compile Include="CS\ModelHandler.cs" />
    <Compile Include="Model\NtstWeb.cs" />
    <Compile Include="CS\PostgreHelper.cs" />
    <Compile Include="Model\SysMetaFile.cs" />
    <Compile Include="Model\ViewData.cs" />
    <Compile Include="LoginWin.xaml.cs">
      <DependentUpon>LoginWin.xaml</DependentUpon>
DataLoader/Model/SysMeta.cs
@@ -10,11 +10,16 @@
namespace DataLoader.Model
{
    /// <summary>
    /// å…ƒæ•°æ®
    /// </summary>
    public class SysMeta
    {
        public int id { set; get; }
        public string name { set; get; }
        public string eventid { set; get; }
        public int metaid { set; get; }
        public int dirid { set; get; }
@@ -22,21 +27,19 @@
        public int verid { set; get; }
        public string name { set; get; }
        public string type { set; get; }
        public string guid { set; get; }
        public string path { set; get; }
        public double sizes { set; get; }
        public string cs { set; get; }
        public string tab { set; get; }
        public string scale { set; get; }
        public string resolution { set; get; }
        public DateTime gather { set; get; }
        public string batch { set; get; }
        public string descr { set; get; }
        public int rows { set; get; }
        public int create_user { set; get; }
@@ -46,11 +49,9 @@
        public DateTime update_time { set; get; }
        public string bak { set; get; }
        public string geom { set; get; }
        public string tab { set; get; }
        public int rows { set; get; }
        public SysMeta() { }
    }
DataLoader/Model/SysMetaFile.cs
ÎļþÒÑɾ³ý
DataLoader/htmls/login.html
@@ -28,7 +28,7 @@
      <div class="loginpwd" style='width: 400px; margin-right: 20px; margin-top: 30px; border-bottom: 1px solid #fff;'>
        <span style="visibility: hidden;">请</span><label for="password">密码:</label>
        <input class="required" placeholder="请输入密码" type="password" id="password" size="20" tabindex="2"
          accesskey="p" autocomplete="off" name="password" value="Admin@123" /><span id="capslock-on" style="display: none;">
          accesskey="p" autocomplete="off" name="password" value="Admin@1234_lf" /><span id="capslock-on" style="display: none;">
            <i class="fa fa-exclamation-circle"></i>
            <span>CAPSLOCK key is turned on!</span>
          </span>
@@ -41,7 +41,7 @@
    </section>
  </div>
  <script>
    var url = "http://127.0.0.1:12316/server/";
    var url = "http://192.168.20.83:12316/server/";
    var isBusy = false;