From c4e3ccb0b53486f025a7c35694efdd2267142149 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 16 一月 2023 19:10:21 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/config/InitConfig.java | 2 +- src/main/java/com/lf/server/helper/GdalHelper.java | 26 +++++++++++++++++--------- data/update.sql | 3 +++ src/main/resources/application.yml | 14 +++++++------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/data/update.sql b/data/update.sql index af088e9..f0323ab 100644 --- a/data/update.sql +++ b/data/update.sql @@ -1,3 +1,6 @@ +select * from lf.sys_menu where position('http://' in url) > 0; +select url, replace(url, 'pipe.cppe.com', '{host}') from lf.sys_menu where position('http://' in url) > 0; +update lf.sys_menu set url = replace(url, 'pipe.cppe.com', '{host}') where position('http://' in url) > 0; ------------------------------------------------------ 鏇存柊鑿滃崟+鐢ㄦ埛 select * from lf.sys_menu where cn_name = '鏁版嵁搴撶洃鎺�'; -- update lf.sys_menu set url = 'http://pipe.cppe.com:8088/server/druid/index.html' where cn_name = '鏁版嵁搴撶洃鎺�'; diff --git a/src/main/java/com/lf/server/config/InitConfig.java b/src/main/java/com/lf/server/config/InitConfig.java index 1bc8bcf..4f24dde 100644 --- a/src/main/java/com/lf/server/config/InitConfig.java +++ b/src/main/java/com/lf/server/config/InitConfig.java @@ -89,7 +89,7 @@ //boolean f4 = Zip4jHelper.unzip("D:\\LF\\data\\zip\\resources.zip", "D:\\LF\\data\\zip\\res", "12345"); // 鍒濆鍖� - GdalHelper.init(env.getProperty("sys.gdal_driver_path")); + GdalHelper.init(env.getProperty("sys.gdal_path")); pathHelper.init(); argsService.initSettingData(); diff --git a/src/main/java/com/lf/server/helper/GdalHelper.java b/src/main/java/com/lf/server/helper/GdalHelper.java index c25269b..c65c068 100644 --- a/src/main/java/com/lf/server/helper/GdalHelper.java +++ b/src/main/java/com/lf/server/helper/GdalHelper.java @@ -10,6 +10,8 @@ import org.gdal.ogr.*; import org.gdal.osr.SpatialReference; +import javax.swing.plaf.synth.SynthTextAreaUI; +import java.io.File; import java.sql.Time; import java.sql.Timestamp; import java.time.LocalDate; @@ -28,25 +30,31 @@ public class GdalHelper { private final static Log log = LogFactory.getLog(GdalHelper.class); - public static void init(String driverPath) { + public static void init(String gdalPath) { // 娉ㄥ唽鎵�鏈夌殑椹卞姩 gdal.AllRegister(); // 涓轰簡鏀寔涓枃璺緞锛岃娣诲姞涓嬮潰杩欏彞浠g爜 gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); - // 閰嶇疆GDAL_DATA璺緞锛坓dal鏍圭洰褰曚笅鐨刡in\gdal-data锛� - // gdal.SetConfigOption("GDAL_DATA", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\gdal-data"); - // gdal.SetConfigOption("PROJ_LIB", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\proj7\\share"); - if (null != driverPath) { - gdal.SetConfigOption("GDAL_DRIVER_PATH", driverPath); - } - //gdal.SetConfigOption("PROJ_LIB", "E:\\terrait\\TianJin\\Zip\\release-1928-x64-dev\\release-1928-x64\\bin\\proj7\\share"); - // 涓轰簡浣垮睘鎬ц〃瀛楁鏀寔涓枃锛岃娣诲姞涓嬮潰杩欏彞锛欳P936 gdal.SetConfigOption("SHAPE_ENCODING", ""); gdal.SetConfigOption("PGEO_DRIVER_TEMPLATE", "DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s"); gdal.SetConfigOption("MDB_DRIVER_TEMPLATE", "DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s"); + + if (StringHelper.isEmpty(gdalPath)) { + return; + } + + // 閰嶇疆鐜鍙橀噺 + gdal.SetConfigOption("GDAL_DATA", gdalPath + File.separator + "gdal-data"); + gdal.SetConfigOption("PROJ_LIB", gdalPath + File.separator + "proj7\\share"); + gdal.SetConfigOption("GDAL_DRIVER_PATH", gdalPath + File.separator + "gdalplugins"); + + String path = System.getenv("PATH"); + if (!path.contains(gdalPath)) { + System.setProperty("PATH", path + ";" + gdalPath); + } } /** diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e58a51a..bc490bd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,8 +12,8 @@ # redis redis: database: 0 - host: 192.168.20.39 - port: 6379 + host: 192.168.20.205 + port: 6369 password: rediS_5L#F4_Server timeout: 6000 # 杩炴帴瓒呮椂鏃堕暱锛堟绉掞級 pool: @@ -41,11 +41,11 @@ datasource: name: prod # JDBC 鍩烘湰閰嶇疆 ¤tSchema=public - url: jdbc:postgresql://192.168.20.39:5433/langfang?useAffectedRows=true + url: jdbc:postgresql://192.168.20.205:5433/langfang?useAffectedRows=true #url: jdbc:postgresql://pipe.cppe.com:5433/langfang?useAffectedRows=true username : postgres - #password: Postgres!_14_Lf - password: postgres + password: Postgres!_14_Lf + #password: postgres driver-class-name: org.postgresql.Driver paltform: POSTGRESQL type: com.alibaba.druid.pool.DruidDataSource @@ -146,9 +146,9 @@ # FME鏈嶅姟鍦板潃 fmeUrl: http://192.168.20.205:88/ # 鍑哄浘鏈嶅姟 - exportServer: http://127.0.0.1/ExportMap + exportServer: http://192.168.20.205/ExportMap # Gdal椹卞姩鐩綍 - gdal_driver_path: E:\terrait\TianJin\Zip\release-1928-x64-dev\release-1928-x64\bin\gdalplugins + gdal_path: E:\terrait\TianJin\Zip\release-1928-x64-dev\release-1928-x64\bin path: # 涓嬭浇鐩綍锛堜笅杞芥枃浠讹級 download: D:\LF\download -- Gitblit v1.9.3