优化代码。
This commit is contained in:
parent
eac95e140f
commit
83ff46efc3
|
|
@ -173,7 +173,7 @@ public class CommonService {
|
|||
}
|
||||
|
||||
public String createFileCode(String parentId, String fileType, int version, String timeStr) {
|
||||
if (fileType.equals(EleDataTypeEnum.FOLDER.desc)) {
|
||||
if (fileType.equals(EleDataTypeEnum.FOLDER.desc) || StrUtil.isEmpty(fileType)) {
|
||||
return parentId + "00" + version + timeStr;
|
||||
}
|
||||
FileFormat fileFormat = fileFormatService.getBaseMapper().selectOne(Wrappers.lambdaQuery(FileFormat.class).eq(FileFormat::getSuffixName, fileType));
|
||||
|
|
|
|||
|
|
@ -1109,7 +1109,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
String destFilePath = commonService.getFileSysPath(destSaveFileInfo.getFilePath(), dataOwnCode);
|
||||
fileSystemService.copyFile(srcFilePath, destFilePath);
|
||||
return destSaveFileInfo;
|
||||
} else if (strategy == FileRepeatEnum.NEW.code) {
|
||||
} else {
|
||||
// 文件名加“_1”,版本号从100开始
|
||||
// 处理MySQL相关逻辑
|
||||
EdFileInfo newEdFileInfo = BeanUtil.copyProperties(srcFileInfo, EdFileInfo.class);
|
||||
|
|
@ -1128,7 +1128,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
fileSystemService.copyFile(srcFileSysPath, destFileSysPath);
|
||||
return newEdFileInfo;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
|
|||
Loading…
Reference in New Issue