管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-01-30 50d9090b3d282b928fe9b09a61f408cc2b278abe
1
已修改1个文件
37 ■■■■■ 文件已修改
src/main/java/com/lf/server/service/data/UploadService.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/UploadService.java
@@ -60,8 +60,10 @@
    public List<MetaEntity> insertFiles(UserEntity ue, List<MetaFileEntity> list, HttpServletRequest req) {
        checkMetaFiles(ue, list);
        excelLoader(list, req);
        loadData(list);
        copyFiles(list);
        return dataLoader(list);
        return insertMetas(list);
    }
    /**
@@ -76,6 +78,7 @@
            mf.setCreateTime(createTime);
            mf.setDepid(ue.getDepid());
            mf.setPath(tempPath + File.separator + mf.getPath());
            mf.setMsg(null);
            File f = new File(mf.getPath());
            if (!f.exists()) {
@@ -84,7 +87,7 @@
            MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
            if (null != old) {
                mf.setMsg("文件已入库");
                mf.setMsg("已入库");
            }
        }
    }
@@ -118,7 +121,6 @@
            if (null != mf.getMsg()) {
                continue;
            }
            if (StaticData.XLS.equals(mf.getExtName()) || StaticData.XLSX.equals(mf.getExtName())) {
                xlsList.add(mf);
            }
@@ -201,19 +203,9 @@
    /**
     * 加载数据
     */
    private List<MetaEntity> dataLoader(List<MetaFileEntity> list) {
        loadData(list);
        copyFiles(list);
        return insertMetas(list);
    }
    /**
     * 加载数据
     */
    private void loadData(List<MetaFileEntity> list) {
        for (MetaFileEntity mf : list) {
            if (StringHelper.isEmpty(mf.getEntity())) {
            if (null != mf.getMsg() || StringHelper.isEmpty(mf.getEntity())) {
                continue;
            }
            if (StaticData.SHP.equals(mf.getExtName()) || StaticData.GDB.equals(mf.getExtName())) {
@@ -238,9 +230,15 @@
            return;
        }
        File file = new File(mf.getPath());
        if (!file.exists()) {
            mf.setMsg("文件丢失");
            return;
        }
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), tabName);
        if (old != null) {
            mf.setMsg("文件已入库");
        if (null != old) {
            mf.setMsg("已入库");
            return;
        }
@@ -340,10 +338,7 @@
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
        if (null != old) {
            mf.setPath(old.getPath());
            mf.setTab(old.getTab());
            mf.setEntity(old.getLayer());
            mf.setRows(old.getRows());
            mf.setMsg("已入库");
            file.delete();
            return 0;
        }
@@ -413,7 +408,7 @@
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
        if (null != old) {
            mf.setPath(old.getPath());
            mf.setMsg("已入库");
            FileHelper.deleteFiles(file);
            return;
        }