From 05ffa1a7f490e1e81d6fbf1ee948db50b1fff6fc Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 14 二月 2023 16:02:52 +0800 Subject: [PATCH] 修改depcode、dircode值 --- src/main/java/com/lf/server/service/data/FmeService.java | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 200 insertions(+), 27 deletions(-) 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 7057092..69ad926 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,18 @@ 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.FmeReqEntity; +import com.lf.server.entity.ctrl.NameValueEntity; +import com.lf.server.entity.data.MetaFileEntity; +import com.lf.server.helper.RestHelper; +import com.lf.server.helper.StringHelper; +import com.lf.server.helper.WebHelper; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** * FME鏈嶅姟绫� @@ -10,83 +20,246 @@ */ @Service public class FmeService { - @Autowired - PropertiesConfig propertiesConfig; + @Value("${sys.fmeUrl}") + private String fmeUrl; /** - * OSGB妫�鏌ワ細.osgb + .xls/.xlsx + * 鑾峰彇浠诲姟鐘舵�� */ - public void checkOsgb(){ + public Object getTaskStatus(String id, HttpServletRequest req) { + String url = getUrl("datax/task/get", req) + "&id=" + id; + return RestHelper.getForRest(url, Object.class); } /** - * 琛ㄦ牸鏁版嵁妫�鏌ワ細.xls/.xlsx + * 涓嬭浇璐ㄦ閿欒缁撴灉 */ - public void checkXls(){ - + public String getDownloadUrl(String id, HttpServletRequest req) { + return getUrl("datax/task/downloadResult", req) + "&id=" + id; } /** - * 鐐逛簯妫�鏌ワ細.laz + .xls/.xlsx + * 1.OSGB妫�鏌ワ細.osgb + *鍊炬枩鎽勫奖*.xls/.xlsx */ - public void checkLaz(){ + public String checkOsgb(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A8鎴愭灉璐ㄦ_OSGB妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("OSGB妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("DMYX_FBL", fme.imgResolution)); + + return RestHelper.postForRest(url, list); } /** - * 楂樼▼妫�鏌ワ細.tif/.tfw/.tif.ovr + .dwg + * 2.琛ㄦ牸鏁版嵁妫�鏌ワ細.xls/.xlsx锛堟帓闄ゅ厓鏁版嵁锛� */ - public void checkDem(){ + public String checkXls(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A3鎴愭灉璐ㄦ_琛ㄦ牸鏁版嵁妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("琛ㄦ牸鏁版嵁妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + + return RestHelper.postForRest(url, list); } /** - * 灞炴�ф鏌ワ細.dwg, *dlg.gdb + * 3.鐐逛簯妫�鏌ワ細.laz + *婵�鍏夌偣浜�*.xls/.xlsx */ - public void checkAttrs(){ + public String checkLaz(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A9鎴愭灉璐ㄦ_鐐逛簯妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("鐐逛簯妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("LAZ_MD", fme.lazDensity)); + + return RestHelper.postForRest(url, list); } /** - * 鎷撴墤妫�鏌ワ細*鍦板舰鍥�.dwg + * 4.楂樼▼妫�鏌ワ細.tif/.prj/.tfw/.tif.ovr + *鍦板舰鍥�*.dwg */ - public void checkTopology(){ + public String checkDem(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A6鎴愭灉璐ㄦ_楂樼▼妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("楂樼▼妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("GCZWC", fme.demTolerance)); + list.add(new NameValueEntity("ChangeRate", fme.demChangeRate)); + + return RestHelper.postForRest(url, list); } /** - * 鍥鹃潰鏁撮グ妫�鏌ワ細.dwg + * 5.灞炴�ф鏌ワ細*dlg*.gdb + *鍦板舰鍥�*.dwg */ - public void checkDecorate(){ + public String checkAttrs(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A5鎴愭灉璐ㄦ_灞炴�ф鏌�", req); + List<NameValueEntity> list = getKeyValues("灞炴�ф鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + + return RestHelper.postForRest(url, list); } /** - * 鍘熺偣妫�鏌ワ細鍓栭潰鍥�.dwg + * 6.鎷撴墤妫�鏌ワ細*鍦板舰鍥�*.dwg */ - public void checkOrigin(){ + public String checkTopology(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A4鎴愭灉璐ㄦ_鎷撴墤妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("鎷撴墤妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("S_MCDRC", fme.tolerance)); + list.add(new NameValueEntity("S_XCDRC", fme.tolerance)); + list.add(new NameValueEntity("S_DCDRC", fme.tolerance)); + list.add(new NameValueEntity("OFFSET_GCD", fme.gcdOffset)); + list.add(new NameValueEntity("OFFSET_KZD", fme.kzdOffset)); + list.add(new NameValueEntity("Range_OFFSET", fme.rangeOffset)); + list.add(new NameValueEntity("XG_MAX", fme.xgMax)); + + return RestHelper.postForRest(url, list); } /** - * 鏍呮牸妫�鏌ワ細.tif/.tfw/.tif.ovr + .xls/.xlsx + * 7.鍥鹃潰鏁撮グ妫�鏌ワ細.dwg */ - public void checkDom(){ + public String checkDecorate(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A10鎴愭灉璐ㄦ_鍥鹃潰鏁撮グ妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("鍥鹃潰鏁撮グ妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("S_XLS", "$(ZJPZWJ)\\璐ㄦ閰嶇疆琛ㄦ��.xlsx")); + list.add(new NameValueEntity("S_XLS2", "D:\\Project\\Data\\LF\\temp\\20230107010101\\鏂囦欢娓呭崟.xlsx")); + + return RestHelper.postForRest(url, list); } /** - * 鏁板鍩虹妫�鏌ワ細.shp, .gdb, .xls/.xlsx + * 8.鍘熺偣妫�鏌ワ細*鍓栭潰鍥�*.dwg */ - public void checkMath(){ + public String checkOrigin(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A11鎴愭灉璐ㄦ_鍘熺偣妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("鍘熺偣妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + + return RestHelper.postForRest(url, list); } /** - * 鍏冩暟鎹鏌ワ細.xls/.xlsx + * 9.鏍呮牸妫�鏌ワ細.tif/.prj/.tfw/.tif.ovr + .xls/.xlsx */ - public void checkMeta(){ + public String checkDom(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/A7鎴愭灉璐ㄦ_鏍呮牸妫�鏌�", req); + List<NameValueEntity> list = getKeyValues("鏍呮牸妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("S_CoordinateSystem", fme.coordinateSystem)); + list.add(new NameValueEntity("DMYX_FBL", fme.imgResolution)); + + return RestHelper.postForRest(url, list); + } + + /** + * 10.鏁板鍩虹妫�鏌ワ細.shp, .gdb, *鍏冩暟鎹�*.xls/.xlsx + */ + public String checkMath(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/B1鍏ュ簱璐ㄦ_鏁板鍩虹妫�鏌�", req); + + List<NameValueEntity> list = getKeyValues("鏁板鍩虹妫�鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + + return RestHelper.postForRest(url, list); + } + + /** + * 11.鍏冩暟鎹鏌ワ細*鍏冩暟鎹�*.xls/.xlsx + */ + public String checkMeta(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/B5鍏ュ簱璐ㄦ_鍏冩暟鎹鏌�", req); + + List<NameValueEntity> list = getKeyValues("鍏冩暟鎹鏌�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + + return RestHelper.postForRest(url, list); + } + + /** + * 12.鎬昏川妫�锛�.zip/.7z + .xls/.xlsx + */ + public String checkMain(FmeReqEntity fme, HttpServletRequest req) { + String url = getUrl("datax/task/run/B0鍏ュ簱璐ㄦ__鎬�", req); + + List<NameValueEntity> list = getKeyValues("鎬昏川妫�"); + list.add(new NameValueEntity("XMMC", fme.xmmc)); + list.add(new NameValueEntity("SJZY", fme.sjzy)); + list.add(new NameValueEntity("GCXMYSB", fme.zipPath)); + list.add(new NameValueEntity("S_WBSBG", fme.wbsPath)); + list.add(new NameValueEntity("S_DZDK", fme.isDiZai)); + list.add(new NameValueEntity("DZ_ZLLX", fme.diZaiType)); + + return RestHelper.postForRest(url, list); + } + + /** + * 13.琛ㄦ牸鍏ュ簱锛歋_RKBG銆乨irid銆乸arentid锛屽涓互鑻辨枃閫楀彿闅斿紑 + */ + public String excelLoader(MetaFileEntity meta, HttpServletRequest req) { + String url = getUrl("datax/task/run/琛ㄦ牸鍏ュ簱", req); + + List<NameValueEntity> list = getKeyValues("琛ㄦ牸鍏ュ簱"); + list.add(new NameValueEntity("S_RKBG", meta.getPath())); + list.add(new NameValueEntity("COORDSYS", meta.getEpsgCode())); + list.add(new NameValueEntity("dirid", meta.getName())); + list.add(new NameValueEntity("depid", meta.getDepcode())); + list.add(new NameValueEntity("verid", meta.getVerid())); + list.add(new NameValueEntity("createuser", meta.getCreateUser())); + list.add(new NameValueEntity("parentid", meta.getEventid())); + + return RestHelper.postForRest(url, list); + } + + /** + * 鑾峰彇Url + */ + public String getUrl(String subUrl, HttpServletRequest req) { + String token = WebHelper.getToken(req); + + return fmeUrl + subUrl + "?token=" + token; + } + + /** + * 鑾峰彇鍚嶇О鍊煎闆嗗悎 + */ + public List<NameValueEntity> getKeyValues(String name) { + List<NameValueEntity> list = new ArrayList<>(); + list.add(new NameValueEntity("_name", String.format("%s_%s", name, StringHelper.YMDHMS2_FORMAT.format(new Date())))); + list.add(new NameValueEntity("_priority", 100)); + list.add(new NameValueEntity("_terminate_on_error", false)); + list.add(new NameValueEntity("IID", "")); + list.add(new NameValueEntity("FANOUT_DIR", "$(OrgResultStorage)")); + list.add(new NameValueEntity("IID_JL", "$(ZJPZWJ)\\IID璁板綍琛�.xlsx")); + list.add(new NameValueEntity("S_ZJXZ", "$(ZJPZWJ)\\璐ㄦ缁嗗垯鎬�.xlsx")); + list.add(new NameValueEntity("S_BZPZB", "$(ZJPZWJ)\\璐ㄦ閰嶇疆琛ㄦ��.xlsx")); + + return list; } } -- Gitblit v1.9.3