From 7217f6710dd952369e073ac277713d989cb6b51b Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 02 八月 2023 09:24:36 +0800 Subject: [PATCH] 1 --- ExportMap/cs/TerraUtils.cs | 4 +++- ExportMap/db/PubDBHelper.cs | 14 +++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ExportMap/cs/TerraUtils.cs b/ExportMap/cs/TerraUtils.cs index da87efa..b61f87e 100644 --- a/ExportMap/cs/TerraUtils.cs +++ b/ExportMap/cs/TerraUtils.cs @@ -213,6 +213,7 @@ string dirPath = GetTerrainPath(args.dircode); string gdal_data = string.Format("set GDAL_DATA={0}\\data", ctbPath); + // -N 椤剁偣娉曠嚎, -C 寮哄埗鍒涘缓缂哄け鏍圭摝鐗�, -R 涓嶈鐩栫幇鏈夋枃浠� string createMesh = string.Format("{0}\\ctb-tile.exe -R -C -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); string createLayer = string.Format("{0}\\ctb-tile.exe -l -o \"{1}\" -f Mesh \"{2}\\{3}.tif\"", ctbPath, dirPath, dirPath, args.dircode); @@ -270,7 +271,8 @@ if (!ids.Contains(m.id)) PubDBHelper.InsertMetaPub(m.id, pubid, args.userId); } string geom = GetPointZ(args); - if (!string.IsNullOrEmpty(geom)) PubDBHelper.UpdatePublishGeom(pubid, geom); + //if (!string.IsNullOrEmpty(geom)) PubDBHelper.UpdatePublishGeom(pubid, geom); + PubDBHelper.UpdatePublish(pubid, args.name, args.userId, geom); return pubid; } diff --git a/ExportMap/db/PubDBHelper.cs b/ExportMap/db/PubDBHelper.cs index 4147e5b..658ad31 100644 --- a/ExportMap/db/PubDBHelper.cs +++ b/ExportMap/db/PubDBHelper.cs @@ -96,14 +96,18 @@ } /// <summary> - /// 鏇存柊鍙戝竷鏁版嵁鐨勫潗鏍� + /// 鏇存柊鍙戝竷鏁版嵁 /// </summary> - public static int UpdatePublishGeom(int pid, string geom) + public static int UpdatePublish(int pubid, string name, int userId, string geom) { - string sql = string.Format("update lf.sys_publish set geom = {0} where id = {1}", string.IsNullOrEmpty(geom) ? "null" : geom, pid); - //DbParameter dp = new NpgsqlParameter("@geom", geom); + string str = null == geom ? "" : string.Format(", geom={0}", geom); + string sql = string.Format("update lf.sys_publish set name=@name, update_user=@userId, create_time=now(), update_time=now(){0} where id=@id", str); - return Tools.DBHelper.ExecuteNonQuery(sql); + DbParameter dp1 = new NpgsqlParameter("@name", name); + DbParameter dp2 = new NpgsqlParameter("@userId", userId); + DbParameter dp3 = new NpgsqlParameter("@id", pubid); + + return Tools.DBHelper.ExecuteNonQuery(sql, dp1, dp2, dp3); } /// <summary> -- Gitblit v1.9.3