功能修改:调整生成的PDF文件 文件名称添加文件后缀 防止生成同名文件

This commit is contained in:
gaoxiongzaq
2023-04-23 11:25:39 +08:00
parent f8c7ce647c
commit 98992b3d76
3 changed files with 6 additions and 4 deletions

View File

@@ -40,7 +40,8 @@ public class CadFilePreviewImpl implements FilePreview {
String baseUrl = BaseUrlFilter.getBaseUrl();
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
String fileName = fileAttribute.getName();
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + "pdf";
String suffix = fileAttribute.getSuffix();
String pdfName = fileName.substring(0, fileName.lastIndexOf(".")) + suffix +"." + "pdf" ; //生成文件添加类型后缀 防止同名文件
String outFilePath = FILE_DIR + pdfName;
// 判断之前是否已转换过,如果转换过,直接返回,否则执行转换
if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(pdfName) || !ConfigConstants.isCacheEnabled()) {