解决冲突

This commit is contained in:
s2042968 2025-02-24 17:23:18 +08:00
parent a6fa3f0d59
commit ebf09cfe1f
1 changed files with 3 additions and 40 deletions

View File

@ -229,52 +229,15 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
.setEffectFlag(EffectFlagEnum.EFFECT.code)
.setFileCode(fileCode)
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
.setPrjDir(false);
.setDataOwn(dataOwnCode);
// 文件名加_1存为新文件
if (count > 0) {
<<<<<<< HEAD
edFileInfoService.handUploadRepeatFile(parentId, file, 3, dataOwnCode);
} else {
EdFileInfo parentFolderInfo = edFileInfoService.getOne(Wrappers.lambdaQuery(EdFileInfo.class)
.eq(EdFileInfo::getId, parentId)
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
String codePathByDbPath = commonService.getCodePathByDbPath(parentFolderInfo.getFilePath());
String fileCode = commonService.createFileCode(codePathByDbPath, suffix, FILE_START_VERSION, newEdFileInfo.getFileTime());
newEdFileInfo.setParentId(parentId)
.setFileCode(fileCode)
.setFileName(mainName)
.setFileType(suffix)
.setFileContent(EleCommonUtil.parse(file.getInputStream(), suffix))
.setFileVersion(FILE_START_VERSION)
.setFileSize(file.getSize())
.setFilePath(parentFolderInfo.getFilePath() + MYSQL_FILE_PATH_SPLIT + newEdFileInfo.getId())
.setDataType(EleDataTypeEnum.FILE.code)
.setDataStatus(PublishEnum.PUBLISHED.getCode())
.setEffectFlag(EffectFlagEnum.EFFECT.code)
.setFileCode(fileCode)
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
.setDataOwn(dataOwnCode);
edFileInfoService.saveOrUpdate(newEdFileInfo);
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath(), dataOwnCode);
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
// fileSystemService.save(FileUtil.getInputStream(fileDestPath), fileDestPath); // 这里会导致文件大小为0考虑到当前的系统为OS文件系统暂不处理
// 创建文件关系
EdFileRelation relation = new EdFileRelation();
relation.setId1(id);
relation.setId2(newEdFileInfo.getId());
relation.setRelationship(desc);
createRelation(relation);
=======
edFileInfoService.resetFileInfoName(newEdFileInfo);
>>>>>>> test
}
edFileInfoService.saveOrUpdate(newEdFileInfo);
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath(), dataOwnCode);
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
@ -282,7 +245,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
EdFileRelation relation = new EdFileRelation();
relation.setId1(id);
relation.setId2(newEdFileInfo.getId());
relation.setRelationship(descrption);
relation.setRelationship(desc);
createRelation(relation);
} catch (Exception e) {