管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-10 872bd1b076818750af70ff6966c0f9b0c11606ed
1
已修改3个文件
76 ■■■■ 文件已修改
src/main/java/com/lf/server/entity/all/StaticData.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/MetaFileEntity.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/BaseUploadService.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/StaticData.java
@@ -12,7 +12,7 @@
    /**
     * 权限排除路径:/proxy
     */
    public static String[] EXCLUDE_PATH = new String[]{"/swagger", "/sign/", "/fmeIt/", "/error", "/floatserver/"};
    public static String[] EXCLUDE_PATH = new String[]{"/swagger", "/sign/", "/fmeit/", "/floatserver/", "/error"};
    /**
     * 数值:4
@@ -75,6 +75,11 @@
    public final static String XLS = ".xls";
    /**
     * SHP文件
     */
    public final static String SHP = ".shp";
    /**
     * MDB文件
     */
    public final static String MDB = ".mdb";
src/main/java/com/lf/server/entity/data/MetaFileEntity.java
@@ -33,6 +33,10 @@
    private String epsgCode;
    private String tab;
    private String entity;
    public String getEventid() {
        return eventid;
    }
@@ -128,4 +132,20 @@
    public void setEpsgCode(String epsgCode) {
        this.epsgCode = epsgCode;
    }
    public String getTab() {
        return tab;
    }
    public void setTab(String tab) {
        this.tab = tab;
    }
    public String getEntity() {
        return entity;
    }
    public void setEntity(String entity) {
        this.entity = entity;
    }
}
src/main/java/com/lf/server/service/all/BaseUploadService.java
@@ -191,6 +191,7 @@
        List<MetaFileEntity> list = new ArrayList<>();
        for (MetaFileEntity meta : metas) {
            meta.setEventid(StringHelper.getGuid());
            meta.setDirid(dir.getId());
            meta.setDepid(ue.getDepid());
            meta.setVerid(ver.getId());
@@ -256,12 +257,24 @@
                continue;
            }
            boolean isShp = StaticData.SHP.equals(extName);
            if (isGdb) {
                //
                continue;
            }
            MetaFileEntity mf = createMetaFileEntity(meta);
            mf.setName(fileName);
            mf.setExtName(extName);
            mf.setSizes(FileHelper.sizeToMb(f.length()));
            mf.setPath(f.getPath().substring(subPath.length()));
            mf.setGuid(FileHelper.getFileMd5(f.getPath()));
            if (isShp) {
                mf.setTab(fileName);
                //
            } else {
                mf.setGuid(FileHelper.getFileMd5(f.getPath()));
            }
            list.add(mf);
        }
        return list;
@@ -272,6 +285,7 @@
     */
    private MetaFileEntity createMetaFileEntity(MetaFileEntity meta) {
        MetaFileEntity mf = new MetaFileEntity();
        mf.setEventid(StringHelper.getGuid());
        mf.setDirid(meta.getDirid());
        mf.setDepid(meta.getDepid());
        mf.setVerid(meta.getVerid());
@@ -332,6 +346,20 @@
        }
    }
    private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
        List<String> files = new ArrayList<>();
        getGdbFiles(subPath, files);
        String root = pathHelper.getConfig().getTempPath() + File.separator;
        for (String file : files) {
            String path = file.replace(root, "");
            List<String> tabs = GdbHelper.getTabNames(file);
            for (String tab : tabs) {
                list.add(new TabMapperEntity(sourceName, "gdb", tab, path));
            }
        }
    }*/
    private void getShpFiles(String shpPath, List<String> list) {
        File file = new File(shpPath);
@@ -348,20 +376,6 @@
            if (f.getName().toLowerCase().endsWith(".shp")) {
                list.add(f.getPath());
            }
        }
    }
    private void getGdbFiles(String sourceName, String subPath, List<TabMapperEntity> list) {
        List<String> files = new ArrayList<>();
        getGdbFiles(subPath, files);
        String root = pathHelper.getConfig().getTempPath() + File.separator;
        for (String file : files) {
            String path = file.replace(root, "");
            List<String> tabs = GdbHelper.getTabNames(file);
            for (String tab : tabs) {
                list.add(new TabMapperEntity(sourceName, "gdb", tab, path));
            }
        }
    }
@@ -386,8 +400,11 @@
            getGdbFiles(f.getPath(), list);
        }
    }*/
    }
    /**
     * 是/否为GDB文件
     */
    private boolean isGdbFile(File f) {
        if (f.isDirectory() && f.getName().toLowerCase().endsWith(StaticData.GDB)) {
            File[] files = f.listFiles();