From 502c7dbbe1f906ae22895436b925a3aa2fb7225a Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 06 一月 2023 16:16:46 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/service/data/FmeService.java | 56 ++++++++++++++++++++++----- src/main/java/com/lf/server/service/show/ExportService.java | 2 src/main/java/com/lf/server/entity/ctrl/NameValueEntity.java | 35 +++++++++++++++++ src/main/java/com/lf/server/config/PropertiesConfig.java | 11 ----- src/main/resources/application.yml | 9 ++-- src/main/java/com/lf/server/entity/ctrl/KeyValueEntity.java | 6 +- 6 files changed, 88 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/lf/server/config/PropertiesConfig.java b/src/main/java/com/lf/server/config/PropertiesConfig.java index 4770547..6767572 100644 --- a/src/main/java/com/lf/server/config/PropertiesConfig.java +++ b/src/main/java/com/lf/server/config/PropertiesConfig.java @@ -10,9 +10,6 @@ @Configuration @SuppressWarnings("AlibabaCommentsMustBeJavadocFormat") public class PropertiesConfig { - @Value("${sys.fme.url}") - private String fmeUrl; - @Value("${sys.path.download}") private String downloadPath; @@ -30,14 +27,6 @@ // @Value("${spring.datasource.druid.stat-view-servlet.login-password}") private String druidPwd; - - public String getFmeUrl() { - return fmeUrl; - } - - public void setFmeUrl(String fmeUrl) { - this.fmeUrl = fmeUrl; - } public String getDownloadPath() { return downloadPath; diff --git a/src/main/java/com/lf/server/entity/ctrl/KeyValueEntity.java b/src/main/java/com/lf/server/entity/ctrl/KeyValueEntity.java index 7404bb9..d7cf424 100644 --- a/src/main/java/com/lf/server/entity/ctrl/KeyValueEntity.java +++ b/src/main/java/com/lf/server/entity/ctrl/KeyValueEntity.java @@ -7,7 +7,7 @@ public class KeyValueEntity { private String key; - private Object value; + private String value; public KeyValueEntity() { } @@ -20,11 +20,11 @@ this.key = key; } - public Object getValue() { + public String getValue() { return value; } - public void setValue(Object value) { + public void setValue(String value) { this.value = value; } } diff --git a/src/main/java/com/lf/server/entity/ctrl/NameValueEntity.java b/src/main/java/com/lf/server/entity/ctrl/NameValueEntity.java new file mode 100644 index 0000000..ad07cda --- /dev/null +++ b/src/main/java/com/lf/server/entity/ctrl/NameValueEntity.java @@ -0,0 +1,35 @@ +package com.lf.server.entity.ctrl; + +/** + * 鍚嶇О鍊煎瀹炰綋绫� + * @author WWW + */ +public class NameValueEntity { + private String name; + + private Object value; + + public NameValueEntity() { + } + + public NameValueEntity(String name, Object value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } +} diff --git a/src/main/java/com/lf/server/service/data/FmeService.java b/src/main/java/com/lf/server/service/data/FmeService.java index e8a9d94..e5c6e00 100644 --- a/src/main/java/com/lf/server/service/data/FmeService.java +++ b/src/main/java/com/lf/server/service/data/FmeService.java @@ -1,8 +1,12 @@ package com.lf.server.service.data; -import com.lf.server.config.PropertiesConfig; -import org.springframework.beans.factory.annotation.Autowired; +import com.lf.server.entity.ctrl.NameValueEntity; +import com.lf.server.helper.WebHelper; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; /** * FME鏈嶅姟绫� @@ -10,32 +14,32 @@ */ @Service public class FmeService { - @Autowired - PropertiesConfig propertiesConfig; + @Value("${sys.fmeUrl}") + private String fmeUrl; /** - * OSGB妫�鏌ワ細.osgb + .xls/.xlsx + * OSGB妫�鏌ワ細.osgb + *鍊炬枩鎽勫奖*.xls/.xlsx */ - public void checkOsgb() { + public void checkOsgb(String path) { } /** - * 琛ㄦ牸鏁版嵁妫�鏌ワ細.xls/.xlsx + * 琛ㄦ牸鏁版嵁妫�鏌ワ細.xls/.xlsx锛堟帓闄ゅ厓鏁版嵁锛� */ public void checkXls() { } /** - * 鐐逛簯妫�鏌ワ細.laz + .xls/.xlsx + * 鐐逛簯妫�鏌ワ細.laz + *婵�鍏夌偣浜�*.xls/.xlsx */ public void checkLaz() { } /** - * 楂樼▼妫�鏌ワ細.tif/.prj/.tfw/.tif.ovr + .dwg + * 楂樼▼妫�鏌ワ細.tif/.prj/.tfw/.tif.ovr + *鍦板舰鍥�*.dwg */ public void checkDem() { @@ -77,10 +81,18 @@ } /** - * 鏁板鍩虹妫�鏌ワ細.shp, .gdb, .xls/.xlsx + * 鏁板鍩虹妫�鏌ワ細.shp, .gdb, *鍏冩暟鎹�*.xls/.xlsx */ - public void checkMath() { + public void checkMath(String taskGuid, String xmmc, String sjzy, String filePath) { + String url = getUrl("datax/task/run/B1鍏ュ簱璐ㄦ_鏁板鍩虹妫�鏌�"); + List<NameValueEntity> list = getKeyVals(); + list.add(new NameValueEntity("_name", taskGuid)); + list.add(new NameValueEntity("XMMC", xmmc)); + list.add(new NameValueEntity("SJZY", sjzy)); + list.add(new NameValueEntity("GCXMYSB", filePath)); + + //String rs = } /** @@ -89,4 +101,26 @@ public void checkMeta() { } + + /** + * 鑾峰彇Url + */ + public String getUrl(String subUrl) { + String token = WebHelper.getToken(WebHelper.getRequest()); + + return fmeUrl + subUrl + "?token=" + token; + } + + /** + * 鑾峰彇鍚嶇О鍊煎闆嗗悎 + * + * @return 鍚嶇О鍊煎闆嗗悎 + */ + public List<NameValueEntity> getKeyVals() { + List<NameValueEntity> list = new ArrayList<>(); + list.add(new NameValueEntity("_priority", 100)); + list.add(new NameValueEntity("_terminate_on_error", true)); + + return list; + } } diff --git a/src/main/java/com/lf/server/service/show/ExportService.java b/src/main/java/com/lf/server/service/show/ExportService.java index 3365b10..b3ea46c 100644 --- a/src/main/java/com/lf/server/service/show/ExportService.java +++ b/src/main/java/com/lf/server/service/show/ExportService.java @@ -26,7 +26,7 @@ */ @Service public class ExportService { - @Value("${sys.path.exportServer}") + @Value("${sys.exportServer}") private String exportServer; @Autowired diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ef96aa6..9f0a321 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -143,9 +143,10 @@ # 绯荤粺閰嶇疆 sys: - fme: - # FME鏈嶅姟璺緞 - url: http://pipe.cppe.com:88/ + # FME鏈嶅姟鍦板潃 + fmeUrl: http://pipe.cppe.com:88/ + # 鍑哄浘鏈嶅姟 + exportServer: http://127.0.0.1/ExportMap path: # 涓嬭浇鐩綍锛堜笅杞芥枃浠讹級 download: D:\LF\download @@ -155,5 +156,3 @@ share: D:\LF\share # 涓存椂鐩綍锛堜复鏃朵笂浼犳枃浠讹級 temp: D:\LF\temp - # 鍑哄浘鏈嶅姟 - exportServer: http://127.0.0.1/ExportMap -- Gitblit v1.9.3