From 28b8826749e910010e748a3bf085f8615ed628b6 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 09 一月 2023 15:42:23 +0800
Subject: [PATCH] 3

---
 /dev/null                                                                |   44 --------------
 src/main/java/com/lf/server/entity/data/MetaFileEntity.java              |   20 +++---
 src/main/java/com/lf/server/service/data/FmeService.java                 |    8 +-
 src/main/java/com/lf/server/entity/ctrl/FmeReqEntity.java                |   14 ----
 src/main/java/com/lf/server/service/all/BaseUploadService.java           |   43 ++-----------
 src/main/java/com/lf/server/controller/data/upload/UploadController.java |   15 ++--
 6 files changed, 32 insertions(+), 112 deletions(-)

diff --git a/src/main/java/com/lf/server/controller/data/upload/UploadController.java b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
index 2276d55..7c56727 100644
--- a/src/main/java/com/lf/server/controller/data/upload/UploadController.java
+++ b/src/main/java/com/lf/server/controller/data/upload/UploadController.java
@@ -3,14 +3,10 @@
 import com.lf.server.annotation.SysLog;
 import com.lf.server.entity.all.ResponseMsg;
 import com.lf.server.entity.all.StaticData;
-import com.lf.server.entity.ctrl.TabMapperEntity;
-import com.lf.server.entity.ctrl.UploadEntity;
 import com.lf.server.entity.data.DirEntity;
-import com.lf.server.entity.data.MetaEntity;
 import com.lf.server.entity.data.MetaFileEntity;
 import com.lf.server.entity.sys.UserEntity;
 import com.lf.server.helper.StringHelper;
-import com.lf.server.helper.WebHelper;
 import com.lf.server.service.data.UploadService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -129,7 +125,12 @@
                 return fail("鐩綍ID=" + dirid + "涓嶅瓨鍦�");
             }
 
-            List<TabMapperEntity> list = uploadService.selectMappers(path);
+            List<MetaFileEntity> metas = uploadService.selectFiles(path, StaticData.ALL_EXTENSION);
+            if (null == metas || metas.isEmpty()) {
+                return fail("鐩綍" + path + "涓嬫煡鏃犳枃浠�");
+            }
+
+            List<MetaFileEntity> list = uploadService.selectMappers(metas, dir, epsgCode);
 
             return success(list);
         } catch (Exception ex) {
@@ -137,7 +138,7 @@
         }
     }
 
-    @SysLog()
+    /*@SysLog()
     @ApiOperation(value = "鎻掑叆鏂囦欢")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "entity", value = "涓婁紶瀹炰綋绫�", dataType = "UploadEntity", paramType = "body")
@@ -203,7 +204,7 @@
         } catch (Exception ex) {
             return fail(ex.getMessage(), null);
         }
-    }
+    }*/
 
     @SysLog()
     @ApiOperation(value = "鍒犻櫎鍏冩暟鎹�")
diff --git a/src/main/java/com/lf/server/entity/ctrl/FmeReqEntity.java b/src/main/java/com/lf/server/entity/ctrl/FmeReqEntity.java
index 3834d5c..bd6ca29 100644
--- a/src/main/java/com/lf/server/entity/ctrl/FmeReqEntity.java
+++ b/src/main/java/com/lf/server/entity/ctrl/FmeReqEntity.java
@@ -54,19 +54,9 @@
     public double imgResolution = 0.2;
 
     /**
-     * 闈㈤噸鍙犲宸�
+     * 闈�/绾�/鐐归噸鍙犲宸�
      */
-    public double polyTolerance = 0.001;
-
-    /**
-     * 绾块噸鍙犲宸�
-     */
-    public double lineTolerance = 0.001;
-
-    /**
-     * 鐐归噸鍙犲宸紙榛樿0.2m锛�
-     */
-    public double pointTolerance = 0.001;
+    public double tolerance = 0.001;
 
     /**
      * 楂樼▼鐐归棿璺濅笂闄�
diff --git a/src/main/java/com/lf/server/entity/ctrl/TabMapperEntity.java b/src/main/java/com/lf/server/entity/ctrl/TabMapperEntity.java
deleted file mode 100644
index eb88378..0000000
--- a/src/main/java/com/lf/server/entity/ctrl/TabMapperEntity.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.lf.server.entity.ctrl;
-
-/**
- * 琛ㄦ槧灏勫疄浣撶被
- * @author WWW
- */
-public class TabMapperEntity {
-    public TabMapperEntity() {
-    }
-
-    public TabMapperEntity(String fileName, String type, String tab, String subPath) {
-        this.fileName = fileName;
-        this.type = type;
-        this.tab = tab;
-        this.subPath = subPath;
-    }
-
-    private String fileName;
-
-    private String type;
-
-    private String tab;
-
-    private String subPath;
-
-    private String entity;
-
-    private Integer rows;
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getTab() {
-        return tab;
-    }
-
-    public void setTab(String tab) {
-        this.tab = tab;
-    }
-
-    public String getSubPath() {
-        return subPath;
-    }
-
-    public void setSubPath(String subPath) {
-        this.subPath = subPath;
-    }
-
-    public String getEntity() {
-        return entity;
-    }
-
-    public void setEntity(String entity) {
-        this.entity = entity;
-    }
-
-    public Integer getRows() {
-        return rows;
-    }
-
-    public void setRows(Integer rows) {
-        this.rows = rows;
-    }
-}
diff --git a/src/main/java/com/lf/server/entity/ctrl/UploadEntity.java b/src/main/java/com/lf/server/entity/ctrl/UploadEntity.java
deleted file mode 100644
index 06fc37c..0000000
--- a/src/main/java/com/lf/server/entity/ctrl/UploadEntity.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.lf.server.entity.ctrl;
-
-import com.lf.server.entity.data.MetaEntity;
-
-import java.util.List;
-
-/**
- * 涓婁紶瀹炰綋绫�
- * @author WWW
- */
-public class UploadEntity {
-    private MetaEntity metaEntity;
-
-    private List<MetaEntity> fileEntities;
-
-    private List<TabMapperEntity> tabEntities;
-
-    public UploadEntity() {
-    }
-
-    public MetaEntity getMetaEntity() {
-        return metaEntity;
-    }
-
-    public void setMetaEntity(MetaEntity metaEntity) {
-        this.metaEntity = metaEntity;
-    }
-
-    public List<MetaEntity> getFileEntities() {
-        return fileEntities;
-    }
-
-    public void setFileEntities(List<MetaEntity> fileEntities) {
-        this.fileEntities = fileEntities;
-    }
-
-    public List<TabMapperEntity> getTabEntities() {
-        return tabEntities;
-    }
-
-    public void setTabEntities(List<TabMapperEntity> tabEntities) {
-        this.tabEntities = tabEntities;
-    }
-}
diff --git a/src/main/java/com/lf/server/entity/data/MetaFileEntity.java b/src/main/java/com/lf/server/entity/data/MetaFileEntity.java
index 3469b7c..4f5cf47 100644
--- a/src/main/java/com/lf/server/entity/data/MetaFileEntity.java
+++ b/src/main/java/com/lf/server/entity/data/MetaFileEntity.java
@@ -29,9 +29,9 @@
 
     private int createUser;
 
-    private String cs;
-
     private String extName;
+
+    private String epsgCode;
 
     public String getEventid() {
         return eventid;
@@ -113,14 +113,6 @@
         this.createUser = createUser;
     }
 
-    public String getCs() {
-        return cs;
-    }
-
-    public void setCs(String cs) {
-        this.cs = cs;
-    }
-
     public String getExtName() {
         return extName;
     }
@@ -128,4 +120,12 @@
     public void setExtName(String extName) {
         this.extName = extName;
     }
+
+    public String getEpsgCode() {
+        return epsgCode;
+    }
+
+    public void setEpsgCode(String epsgCode) {
+        this.epsgCode = epsgCode;
+    }
 }
diff --git a/src/main/java/com/lf/server/service/all/BaseUploadService.java b/src/main/java/com/lf/server/service/all/BaseUploadService.java
index a6ce5ae..f0a614d 100644
--- a/src/main/java/com/lf/server/service/all/BaseUploadService.java
+++ b/src/main/java/com/lf/server/service/all/BaseUploadService.java
@@ -1,6 +1,6 @@
 package com.lf.server.service.all;
 
-import com.lf.server.entity.ctrl.TabMapperEntity;
+import com.lf.server.entity.data.DirEntity;
 import com.lf.server.entity.data.MetaFileEntity;
 import com.lf.server.helper.*;
 import org.apache.commons.logging.Log;
@@ -190,31 +190,16 @@
     /**
      * 鏌ヨ鏄犲皠
      */
-    public List<TabMapperEntity> selectMappers(String subPath) {
-        String root = pathHelper.getConfig().getTempPath() + File.separator + subPath;
-
-        File file = new File(root);
-        if (!file.exists() && !file.isDirectory()) {
-            return null;
+    public List<MetaFileEntity> selectMappers(List<MetaFileEntity> metas, DirEntity dir, String epsgCode) {
+        List<MetaFileEntity> list = new ArrayList<>();
+        for (MetaFileEntity meta : metas) {
+            //
         }
 
-        File[] files = file.listFiles();
-        if (null == files || files.length == 0) {
-            return null;
-        }
-
-        File zipFile = new File(root + "_zip");
-        if (!zipFile.exists() || !zipFile.isDirectory()) {
-            zipFile.mkdirs();
-        }
-
-        return getMappers(zipFile.getPath(), files);
+        return list;
     }
 
-    /**
-     * 鑾峰彇鏄犲皠
-     */
-    private List<TabMapperEntity> getMappers(String zipPath, File[] files) {
+    /*private List<TabMapperEntity> getMappers(String zipPath, File[] files) {
         String temp = pathHelper.getConfig().getTempPath();
 
         List<TabMapperEntity> list = new ArrayList<>();
@@ -253,9 +238,6 @@
         return list;
     }
 
-    /**
-     * 鑾峰彇Shp鏂囦欢
-     */
     private void getShpFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
         List<String> files = new ArrayList<>();
         getShpFiles(subPath, files);
@@ -268,9 +250,6 @@
         }
     }
 
-    /**
-     * 鑾峰彇Shp鏂囦欢
-     */
     private void getShpFiles(String shpPath, List<String> list) {
         File file = new File(shpPath);
 
@@ -291,9 +270,6 @@
         }
     }
 
-    /**
-     * 鑾峰彇Gdb鏂囦欢
-     */
     private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
         List<String> files = new ArrayList<>();
         getGdbFiles(subPath, files);
@@ -308,9 +284,6 @@
         }
     }
 
-    /**
-     * 鑾峰彇Gdb鏂囦欢
-     */
     private void getGdbFiles(String shpPath, List<String> list) {
         File file = new File(shpPath);
 
@@ -331,7 +304,7 @@
 
             getGdbFiles(f.getPath(), list);
         }
-    }
+    }*/
 
     private boolean isGdbFile(File f) {
         if (f.getName().toLowerCase().endsWith(GDB)) {
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 e334464..6fc62f5 100644
--- a/src/main/java/com/lf/server/service/data/FmeService.java
+++ b/src/main/java/com/lf/server/service/data/FmeService.java
@@ -119,9 +119,9 @@
         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.polyTolerance));
-        list.add(new NameValueEntity("S_XCDRC", fme.lineTolerance));
-        list.add(new NameValueEntity("S_DCDRC", fme.pointTolerance));
+        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));
@@ -228,7 +228,7 @@
         // S_RKBG锛氫负鍏ュ簱琛ㄦ牸鐨勫畬鏁磋矾寰勶紝澶氫釜浠ヨ嫳鏂囬�楀彿闅斿紑
         List<NameValueEntity> list = getKeyValues("琛ㄦ牸鍏ュ簱");
         list.add(new NameValueEntity("S_RKBG", meta.getPath()));
-        list.add(new NameValueEntity("COORDSYS", meta.getCs()));
+        list.add(new NameValueEntity("COORDSYS", meta.getEpsgCode()));
         list.add(new NameValueEntity("dirid", meta.getDirid()));
         list.add(new NameValueEntity("depid", meta.getDepid()));
         list.add(new NameValueEntity("verid", meta.getVerid()));

--
Gitblit v1.9.3