diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/config/ElePropertyConfig.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/config/ElePropertyConfig.java index 76acba6..1f21526 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/config/ElePropertyConfig.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/config/ElePropertyConfig.java @@ -68,6 +68,7 @@ public class ElePropertyConfig { @Value("${backup.remote.port}") private int remotePort; + @Getter @Value("${winPrefix}") private String winPrefix = ""; diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/ChatService.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/ChatService.java index be3830e..f4b5e48 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/ChatService.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/ChatService.java @@ -128,7 +128,7 @@ public class ChatService { } else { FileUtil.writeFromStream(file.getInputStream(), srcPath); if (Arrays.asList("doc", "docx").contains(fileType)) { - OfficeFileUtil.doc2pdf(srcPath, pdfPath); + OfficeFileUtil.doc2pdf(srcPath, pdfPath, elePropertyConfig.getWinPrefix()); } else { OfficeFileUtil.ppt2pdf(srcPath, pdfPath); } diff --git a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java index 29169ca..0b0326d 100644 --- a/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java +++ b/electrmangnetic/src/main/java/com/electromagnetic/industry/software/manage/service/serviceimpl/EdFileInfoServiceImpl.java @@ -1344,18 +1344,20 @@ public class EdFileInfoServiceImpl extends ServiceImpl preview(String id, HttpServletResponse response, int dataOwnCode) { String fileSaveTmpPath = null; + String wordPath = null; try { EdFileInfo fileInfo = this.baseMapper.selectById(id); Assert.isTrue(Objects.nonNull(fileInfo), "文件不存在"); String fileDbPath = commonService.getDbPath(fileInfo.getFilePath()); String fileSysPath = commonService.getFileSysPath(fileInfo.getId()); fileSaveTmpPath = elePropertyConfig.getEleTmpPath() + File.separator + IdUtil.fastSimpleUUID() + "." + fileInfo.getFileType(); + wordPath = new String(fileSaveTmpPath); FileUtil.copy(fileSysPath, fileSaveTmpPath, true); EleCommonUtil.decryptFile(fileSaveTmpPath, SecureUtil.aes(elePropertyConfig.getFileEncPasswd().getBytes())); if (Arrays.asList("doc", "docx").contains(fileInfo.getFileType())) { String pdfTmpPath = elePropertyConfig.getEleTmpPath() + File.separator + fileInfo.getId() + ".pdf"; - OfficeFileUtil.doc2pdf(fileSaveTmpPath, pdfTmpPath); + OfficeFileUtil.doc2pdf(fileSaveTmpPath, pdfTmpPath, elePropertyConfig.getWinPrefix()); fileSaveTmpPath = pdfTmpPath; } @@ -1385,6 +1387,9 @@ public class EdFileInfoServiceImpl extends ServiceImpl