管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-07-25 b77e20c5fdb7be7d70963161b20bb62550b11de4
1
已修改3个文件
57 ■■■■■ 文件已修改
ExportMap/Web.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/db/PubDBHelper.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/export.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Web.config
@@ -22,8 +22,8 @@
    <add key="mpt" value="D:\LF\data\mpt\tb.mpt" />
    <!-- PG连接 -->
    <!--<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.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>
    <!--<add key="pgConn" value="Server=103.85.165.99;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>-->
    <!--<add key="pgConn" value="Server=192.168.20.205;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>-->
    <add key="pgConn" value="Server=103.85.165.99;Port=5433;Database=langfang;User Id=postgres;Password=Postgres!_14_Lf;"/>
    <add key="webpages:Version" value="3.0.0.0"/>
    <add key="webpages:Enabled" value="false"/>
    <add key="ClientValidationEnabled" value="true"/>
ExportMap/db/PubDBHelper.cs
@@ -3,6 +3,7 @@
using Npgsql;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Reflection;
@@ -57,6 +58,54 @@
        }
        /// <summary>
        /// 获取发布ID
        /// </summary>
        public static int GetPushlishId(string dirid, string type = "DOM")
        {
            string sql = string.Format("select b.id from lf.sys_publish b where b.type = '{0}' and b.dirid = '{1}' limit 1", type, dirid);
            object obj = Tools.DBHelper.GetScalar(sql);
            return null == obj ? 0 : Convert.ToInt32(obj);
        }
        /// <summary>
        /// 获取已经发布的元数据ID
        /// </summary>
        public static List<int> GetPublishMetaId(int pubid)
        {
            string sql = string.Format("select metaid from lf.sys_meta_pub where pubid = {0}", pubid);
            DataTable dt = Tools.DBHelper.GetDataTable(sql);
            List<int> list = new List<int>();
            if (null == dt || 0 == dt.Rows.Count) return list;
            for (int i = 0, c = dt.Rows.Count; i < c; i++)
            {
                object obj = dt.Rows[i][0];
                if (null != obj)
                {
                    int id = 0;
                    if (int.TryParse(obj.ToString(), out id))
                    {
                        list.Add(id);
                    }
                }
            }
            return list;
        }
        /// <summary>
        /// 更新发布数据的坐标
        /// </summary>
        public static int UpdatePublishCoord(int pid, string json)
        {
            string sql = string.Format("update lf.sys_publish set json = '{0}' where id = {1}", json, pid);
            return Tools.DBHelper.ExecuteNonQuery(sql);
        }
        /// <summary>
        /// 插入元数据-数据发布表记录
        /// </summary>
        public static int InsertMetaPub(int metaid, int pubid, int userId)
ExportMap/export.html
@@ -125,9 +125,9 @@
      });
    }
    
    // 测试Terra
    // 测试Terra:10526,10527
    function toTerra() {
      var data = { token: token, ids: [7088, 7089, 7090], min: 0, max: 18, depcode: "00", dircode: "0C00000003", userId: 1, name: "ASTGTM2" };
      var data = { token: token, ids: [10526], min: 0, max: 18, depcode: "00", dircode: "09", userId: 1, name: "BN_GD" };
      ajax("Convert/ToTerra", "POST", JSON.stringify(data), null, null, function (rs) {
        alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
        console.log(rs);