From d23b2ce1ae45c192aed067041da8de748b97d405 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 22 十一月 2024 14:19:31 +0800
Subject: [PATCH] 1

---
 src/main/java/com/lf/server/service/data/FmeService.java |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 101 insertions(+), 2 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 dad628a..6cefe9f 100644
--- a/src/main/java/com/lf/server/service/data/FmeService.java
+++ b/src/main/java/com/lf/server/service/data/FmeService.java
@@ -2,10 +2,13 @@
 
 import com.lf.server.entity.ctrl.FmeReqEntity;
 import com.lf.server.entity.ctrl.NameValueEntity;
+import com.lf.server.entity.ctrl.RegisterEntity;
 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.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
@@ -22,6 +25,11 @@
 public class FmeService {
     @Value("${sys.fmeUrl}")
     private String fmeUrl;
+
+    @Value("${sys.fmeToken}")
+    private String fmeToken;
+
+    private final static Log log = LogFactory.getLog(FmeService.class);
 
     /**
      * 鑾峰彇浠诲姟鐘舵��
@@ -220,7 +228,36 @@
     }
 
     /**
-     * 13.琛ㄦ牸鍏ュ簱锛歋_RKBG銆乨irid銆乸arentid锛屽涓互鑻辨枃閫楀彿闅斿紑
+     * 13.閫昏緫涓�鑷存�ф鏌ワ細.dwg/.xls/.xlsx
+     */
+    public String checkLogical(FmeReqEntity fme, HttpServletRequest req) {
+        String url = getUrl("datax/task/run/B3鍏ュ簱璐ㄦ_閫昏緫涓�鑷存�ф鏌�", 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);
+    }
+
+    /**
+     * 14.鍗曢」鎴愭灉瀹屾暣鎬ф鏌ワ細.*
+     */
+    public String checkSingleIntegrity(FmeReqEntity fme, HttpServletRequest req) {
+        String url = getUrl("datax/task/run/B6鍏ュ簱璐ㄦ_鍗曢」鎴愭灉瀹屾暣鎬ф鏌�", 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("SJFL", fme.sjfl));
+
+        return RestHelper.postForRest(url, list);
+    }
+
+    /**
+     * a.琛ㄦ牸鍏ュ簱锛歋_RKBG銆乨irid銆乸arentid锛屽涓互鑻辨枃閫楀彿闅斿紑
      */
     public String excelLoader(MetaFileEntity meta, HttpServletRequest req) {
         String url = getUrl("datax/task/run/琛ㄦ牸鍏ュ簱", req);
@@ -238,7 +275,7 @@
     }
 
     /**
-     * 14.CRDS骞冲彴浜や粯
+     * b.CRDS骞冲彴浜や粯
      */
     public String crdsPackaging(String dirCode, String major, String isCut, HttpServletRequest req) {
         // datax/task/run/CRDS骞冲彴浜や粯_娴嬭瘯
@@ -253,6 +290,61 @@
     }
 
     /**
+     * c.鏈嶅姟娉ㄥ唽
+     */
+    public RegisterEntity serverRegister(String name, String serverUri, String type, HttpServletRequest req) {
+        String url = getUrl("resource/res/item", req);
+
+        RegisterEntity entity = new RegisterEntity(name, serverUri, type);
+
+        String resid = RestHelper.postForRest(url, entity);
+        entity.setSerialnum(resid);
+
+        return entity;
+    }
+
+    /**
+     * d.鏈嶅姟鐢宠
+     */
+    public void serverApply(String id, Integer pubid, HttpServletRequest req) {
+        try {
+            String url = getUrl("resource/res/request", req) + "&resourceid=" + id;
+
+            RegisterEntity entity = new RegisterEntity(pubid);
+
+            RestHelper.postForRest(url, entity);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(), ex);
+        }
+    }
+
+    /**
+     * e.鍒犻櫎璧勬簮
+     */
+    public void deleteRes(String id, HttpServletRequest req) {
+        String url = getUrl("resource/res/hashid", req) + "&hashid=" + id;
+
+        RestHelper.deleteForRest(url);
+    }
+
+    /**
+     * f.璁$畻闈㈢Н
+     */
+    public String calcArea(String sjfl, String id, String wjlj) {
+        String url = getUrl("datax/task/run/鏁版嵁鍗犲湴闈㈢Н璁$畻");
+
+        List<NameValueEntity> list = new ArrayList<>();
+        list.add(new NameValueEntity("_name", String.format("%s_%s", "鏁版嵁鍗犲湴闈㈢Н璁$畻", StringHelper.YMDHMS2_FORMAT.format(new Date()))));
+        list.add(new NameValueEntity("_terminate_on_error", false));
+        list.add(new NameValueEntity("_priority", 100));
+        list.add(new NameValueEntity("SJFL", sjfl));
+        list.add(new NameValueEntity("ID", id));
+        list.add(new NameValueEntity("WJLJ", wjlj));
+
+        return RestHelper.postForRest(url, list);
+    }
+
+    /**
      * 鑾峰彇Url
      */
     public String getUrl(String subUrl, HttpServletRequest req) {
@@ -262,6 +354,13 @@
     }
 
     /**
+     * 鑾峰彇Url
+     */
+    public String getUrl(String subUrl) {
+        return fmeUrl + subUrl + "?token=" + fmeToken;
+    }
+
+    /**
      * 鑾峰彇鍚嶇О鍊煎闆嗗悎
      */
     public List<NameValueEntity> getKeyValues(String name) {

--
Gitblit v1.9.3