管道基础大数据平台系统开发-【后端】-Server
3
13693261870
2023-01-09 28b8826749e910010e748a3bf085f8615ed628b6
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;
@@ -147,21 +147,17 @@
        List<MetaFileEntity> list = new ArrayList<>();
        for (File f : files) {
            String fileName = FileHelper.getFileName(f.getPath());
            if (null != extList) {
                String extName = FileHelper.getExtension(fileName);
                if (!extList.contains(extName)) {
                    continue;
                }
            String extName = FileHelper.getExtension(fileName);
            if (null != extList && !extList.contains(extName)) {
                continue;
            }
            double sizes = FileHelper.sizeToMb(f.length());
            String filePath = subPath + File.separator + fileName;
            MetaFileEntity mf = new MetaFileEntity();
            mf.setName(fileName);
            mf.setSizes(sizes);
            mf.setPath(filePath);
            mf.setGuid(FileHelper.getFileMd5(f.getPath()));
            mf.setExtName(extName);
            mf.setSizes(FileHelper.sizeToMb(f.length()));
            mf.setPath(subPath + File.separator + fileName);
            // mf.setGuid(FileHelper.getFileMd5(f.getPath()))
            list.add(mf);
        }
@@ -194,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<>();
@@ -257,9 +238,6 @@
        return list;
    }
    /**
     * 获取Shp文件
     */
    private void getShpFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
        List<String> files = new ArrayList<>();
        getShpFiles(subPath, files);
@@ -272,9 +250,6 @@
        }
    }
    /**
     * 获取Shp文件
     */
    private void getShpFiles(String shpPath, List<String> list) {
        File file = new File(shpPath);
@@ -295,9 +270,6 @@
        }
    }
    /**
     * 获取Gdb文件
     */
    private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
        List<String> files = new ArrayList<>();
        getGdbFiles(subPath, files);
@@ -312,9 +284,6 @@
        }
    }
    /**
     * 获取Gdb文件
     */
    private void getGdbFiles(String shpPath, List<String> list) {
        File file = new File(shpPath);
@@ -335,7 +304,7 @@
            getGdbFiles(f.getPath(), list);
        }
    }
    }*/
    private boolean isGdbFile(File f) {
        if (f.getName().toLowerCase().endsWith(GDB)) {