From b77e20c5fdb7be7d70963161b20bb62550b11de4 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 25 七月 2023 09:02:51 +0800
Subject: [PATCH] 1

---
 ExportMap/export.html       |    4 ++--
 ExportMap/Web.config        |    4 ++--
 ExportMap/db/PubDBHelper.cs |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/ExportMap/Web.config b/ExportMap/Web.config
index 0fa81f8..822215a 100644
--- a/ExportMap/Web.config
+++ b/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"/>
diff --git a/ExportMap/db/PubDBHelper.cs b/ExportMap/db/PubDBHelper.cs
index 698179e..5f60ebb 100644
--- a/ExportMap/db/PubDBHelper.cs
+++ b/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)
diff --git a/ExportMap/export.html b/ExportMap/export.html
index 59a8e02..6b23fb6 100644
--- a/ExportMap/export.html
+++ b/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);

--
Gitblit v1.9.3