调通了文件移动
This commit is contained in:
parent
d7a818bb3a
commit
28b6c4f772
|
|
@ -677,16 +677,19 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
// 处理MySQL相关逻辑
|
// 处理MySQL相关逻辑
|
||||||
EdFileInfo newEdFileInfo = BeanUtil.copyProperties(srcFileInfo, EdFileInfo.class);
|
EdFileInfo newEdFileInfo = BeanUtil.copyProperties(srcFileInfo, EdFileInfo.class);
|
||||||
newEdFileInfo.newInit();
|
newEdFileInfo.newInit();
|
||||||
|
String dbPathByDbPath = commonService.getCodePathByDbPath(destFolderInfo.getFilePath());
|
||||||
newEdFileInfo.setParentId(targetFolderId)
|
newEdFileInfo.setParentId(targetFolderId)
|
||||||
.setFileVersion(FILE_START_VERSION)
|
.setFileVersion(FILE_START_VERSION)
|
||||||
.setFileName(srcFileInfo.getFileName() + "_1")
|
.setFileName(srcFileInfo.getFileName() + "_1")
|
||||||
.setFileCode(commonService.createFileCode(targetFolderId, srcFileInfo.getFileType(), FILE_START_VERSION, newEdFileInfo.getFileTime()))
|
.setFileCode(commonService.createFileCode(dbPathByDbPath, srcFileInfo.getFileType(), FILE_START_VERSION, newEdFileInfo.getFileTime()))
|
||||||
.setFilePath(destFolderInfo.getFilePath() + MYSQL_FILE_PATH_SPLIT + newEdFileInfo.getId());
|
.setFilePath(destFolderInfo.getFilePath() + MYSQL_FILE_PATH_SPLIT + newEdFileInfo.getId());
|
||||||
|
resetFileInfoName(newEdFileInfo);
|
||||||
this.baseMapper.insert(newEdFileInfo);
|
this.baseMapper.insert(newEdFileInfo);
|
||||||
// 移动文件
|
// 移动文件
|
||||||
String srcFileSysPath = commonService.getFileSysPath(srcFileInfo.getFilePath());
|
String srcFileSysPath = commonService.getFileSysPath(srcFileInfo.getFilePath());
|
||||||
String destFileSysPath = commonService.getFileSysPath(destFolderInfo.getFilePath());
|
String destFileSysPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
|
||||||
fileSystemService.moveFile(srcFileSysPath, destFileSysPath, deleteSrc);
|
fileSystemService.moveFile(srcFileSysPath, destFileSysPath, deleteSrc);
|
||||||
|
this.baseMapper.deleteById(srcFileInfo.getId());
|
||||||
}
|
}
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue