管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-19 0b2de8c74823749cd184d0708cee17c49593ef39
src/main/java/com/lf/server/service/data/DataUploadService.java
@@ -34,8 +34,17 @@
            for (MetaFileEntity mf : list) {
                // 移动文件
                File file = new File(temp + File.separator + mf.getPath());
                File newFile = new File(root + File.separator + mf.getName());
                file.renameTo(newFile);
                File newFile = new File(root + File.separator + mf.getGuid());
                MetaFileEntity old = metaFileService.selectByGuid(mf.getGuid());
                String filePath = null;
                if (null == old) {
                    filePath = newFile.getPath();
                    file.renameTo(newFile);
                } else {
                    filePath = old.getPath();
                    file.delete();
                }
                // 元数据
                MetaEntity me = createMetaEntity(entity);
@@ -49,7 +58,7 @@
                // 元数据文件
                MetaFileEntity mef = createMetaFileEntity(mf, entity);
                mef.setPath(FileHelper.getRelativePath(newFile.getPath()));
                mef.setPath(FileHelper.getRelativePath(filePath));
                rows = metaFileService.insert(mef);
                if (rows > 0) {