Compare commits
3 Commits
bb6058be9c
...
ebf09cfe1f
| Author | SHA1 | Date |
|---|---|---|
|
|
ebf09cfe1f | |
|
|
a6fa3f0d59 | |
|
|
5af549321b |
|
|
@ -22,6 +22,8 @@ public class FileInfoVO {
|
||||||
|
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
|
||||||
|
private String categoryId;
|
||||||
|
|
||||||
private Integer dataType;
|
private Integer dataType;
|
||||||
|
|
||||||
private Integer dataStatus;
|
private Integer dataStatus;
|
||||||
|
|
|
||||||
|
|
@ -229,52 +229,15 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
.setEffectFlag(EffectFlagEnum.EFFECT.code)
|
.setEffectFlag(EffectFlagEnum.EFFECT.code)
|
||||||
.setFileCode(fileCode)
|
.setFileCode(fileCode)
|
||||||
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
|
.setSaveStatus(EleDataSaveStatusEnum.SUCCESS.code)
|
||||||
.setPrjDir(false);
|
.setDataOwn(dataOwnCode);
|
||||||
|
|
||||||
// 文件名加”_1“,存为新文件
|
// 文件名加”_1“,存为新文件
|
||||||
if (count > 0) {
|
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);
|
edFileInfoService.resetFileInfoName(newEdFileInfo);
|
||||||
>>>>>>> test
|
|
||||||
}
|
}
|
||||||
|
|
||||||
edFileInfoService.saveOrUpdate(newEdFileInfo);
|
edFileInfoService.saveOrUpdate(newEdFileInfo);
|
||||||
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
|
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath(), dataOwnCode);
|
||||||
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
|
FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
|
||||||
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
|
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
|
||||||
|
|
||||||
|
|
@ -282,7 +245,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
|
||||||
EdFileRelation relation = new EdFileRelation();
|
EdFileRelation relation = new EdFileRelation();
|
||||||
relation.setId1(id);
|
relation.setId1(id);
|
||||||
relation.setId2(newEdFileInfo.getId());
|
relation.setId2(newEdFileInfo.getId());
|
||||||
relation.setRelationship(descrption);
|
relation.setRelationship(desc);
|
||||||
createRelation(relation);
|
createRelation(relation);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<result column="file_note" property="fileNote"/>
|
<result column="file_note" property="fileNote"/>
|
||||||
<result column="file_version" property="fileVersion"/>
|
<result column="file_version" property="fileVersion"/>
|
||||||
<result column="parent_id" property="parentId"/>
|
<result column="parent_id" property="parentId"/>
|
||||||
|
<result column="category_id" property="categoryId"/>
|
||||||
<result column="data_type" property="dataType"/>
|
<result column="data_type" property="dataType"/>
|
||||||
<result column="data_status" property="dataStatus"/>
|
<result column="data_status" property="dataStatus"/>
|
||||||
<result column="save_status" property="saveStatus"/>
|
<result column="save_status" property="saveStatus"/>
|
||||||
|
|
@ -29,7 +30,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryFileList" resultMap="FileInfoResultMap" >
|
<select id="queryFileList" resultMap="FileInfoResultMap" >
|
||||||
SELECT *
|
SELECT *, LEFT(file_code, 6 ) as category_id
|
||||||
FROM ed_file_info
|
FROM ed_file_info
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue