管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-05-31 cf3c21eb0e6b4c4c96c9b4f3a5070dd842ccde3d
src/main/java/com/lf/server/service/data/UploadService.java
@@ -22,6 +22,7 @@
/**
 * 数据上传服务类
 *
 * @author WWW
 */
@Service
@@ -71,7 +72,7 @@
        copyFiles(list);
        insertMetas(list);
        if (xlsList.size() > 0) {
            excelLoader(xlsList, req);
            String guid = excelLoader(xlsList, req);
        }
    }
@@ -94,11 +95,22 @@
                mf.setMsg("文件丢失");
            }
            MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
            MetaEntity old = metaService.selectByGuid(mf.getGuid(), getDirCode(mf), null);
            if (null != old) {
                mf.setMsg("已存在");
            }
        }
    }
    /**
     * 获取目录编码
     */
    private String getDirCode(MetaFileEntity mf) {
        if (StringHelper.isEmpty(mf.getDircode())) {
            return null;
        }
        return StringHelper.getRightLike(mf.getDircode().substring(0, 2));
    }
    /**
@@ -107,9 +119,12 @@
    private List<MetaFileEntity> getExcelFiles(List<MetaFileEntity> list) {
        List<MetaFileEntity> xlsList = new ArrayList<>();
        for (MetaFileEntity mf : list) {
            if (null != mf.getMsg() && isExcel(mf)) {
            if (null == mf.getMsg() && isExcel(mf)) {
                xlsList.add(mf);
            }
        }
        if (xlsList.isEmpty()) {
            return xlsList;
        }
        String xlsBasePath = getXlsPath(xlsList.get(0).getPath());
@@ -204,7 +219,7 @@
            return;
        }
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), tabName);
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), getDirCode(mf), tabName);
        if (null != old) {
            mf.setMsg("已存在");
            return;
@@ -311,7 +326,7 @@
            return -1;
        }
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null, null);
        if (null != old) {
            mf.setMsg("已存在");
            file.delete();
@@ -380,7 +395,7 @@
            return;
        }
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null);
        MetaEntity old = metaService.selectByGuid(mf.getGuid(), null, null);
        if (null != old) {
            mf.setMsg("已存在");
            FileHelper.deleteFiles(file);