| | |
| | | <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"/> |
| | |
| | | using Npgsql; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | |
| | | } |
| | | |
| | | /// <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) |
| | |
| | | }); |
| | | } |
| | | |
| | | // 测试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); |