Compare commits

..

No commits in common. "ebf09cfe1f66fbe90fdade356572cabd5b490e45" and "bb6058be9caaec8853a2a1bfa7e58b28a09ebf36" have entirely different histories.

3 changed files with 41 additions and 7 deletions

View File

@ -22,8 +22,6 @@ public class FileInfoVO {
private String parentId;
private String categoryId;
private Integer dataType;
private Integer dataStatus;

View File

@ -229,15 +229,52 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
.setEffectFlag(EffectFlagEnum.EFFECT.code)
.setFileCode(fileCode)
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
.setDataOwn(dataOwnCode);
.setPrjDir(false);
// 文件名加_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(), dataOwnCode);
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
@ -245,7 +282,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
EdFileRelation relation = new EdFileRelation();
relation.setId1(id);
relation.setId2(newEdFileInfo.getId());
relation.setRelationship(desc);
relation.setRelationship(descrption);
createRelation(relation);
} catch (Exception e) {

View File

@ -11,7 +11,6 @@
<result column="file_note" property="fileNote"/>
<result column="file_version" property="fileVersion"/>
<result column="parent_id" property="parentId"/>
<result column="category_id" property="categoryId"/>
<result column="data_type" property="dataType"/>
<result column="data_status" property="dataStatus"/>
<result column="save_status" property="saveStatus"/>
@ -30,7 +29,7 @@
</select>
<select id="queryFileList" resultMap="FileInfoResultMap" >
SELECT *, LEFT(file_code, 6 ) as category_id
SELECT *
FROM ed_file_info
<where>