管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-03-17 0e5d6aaf83aa5a612f82398e41498926d1983a88
1
已修改1个文件
45 ■■■■■ 文件已修改
ExportMap/cs/ConvertUtils.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/ConvertUtils.cs
@@ -1,4 +1,5 @@
using ExportMap.Models;
using ExportMap.db;
using ExportMap.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -60,6 +61,9 @@
                File.Delete(configFile);
                count += File.Exists(jsonFile) ? 1 : 0;
                string path = jsonFile.Replace(Tool.GetSetting("lfData") + "\\", "");
                InsertToDB(meta, path);
            }
            return count;
@@ -110,5 +114,44 @@
            File.WriteAllText(file, str);
            LogOut.Info("JobConfig:" + str);
        }
        /// <summary>
        /// 插入数据库
        /// </summary>
        private static void InsertToDB(SysMeta meta, string path)
        {
            if (PubDBHelper.IsPublish(meta.id)) return;
            SysPublish sys = NewPublish(meta);
            sys.path = path;
            int pubid = PubDBHelper.InsertPublish(sys);
            if (pubid > 0)
            {
                PubDBHelper.InsertMetaPub(meta.id, pubid);
            }
        }
        /// <summary>
        /// 创建数据发布类
        /// </summary>
        private static SysPublish NewPublish(SysMeta meta)
        {
            SysPublish sp = new SysPublish();
            sp.name = meta.name;
            sp.url = GetReleaseUrl(meta);
            sp.type = meta.type;
            sp.status = 3;
            sp.dirid = meta.dircode;
            sp.depid = meta.depcode;
            sp.min = 0;
            sp.max = 0;
            sp.json = null;
            sp.create_user = meta.create_user;
            sp.geom = null;
            sp.bak = null;
            return sp;
        }
    }
}