文档翻译,将翻译后的文件,输出doc格式。

This commit is contained in:
wangzhijiang
2022-09-29 11:04:02 +08:00
parent d0b93b1b7a
commit cf4256c796
@@ -115,8 +115,9 @@ public class TranslationDocumentUtils {
//翻译后的文件路径
String translateAfterFilePath = uploadpath + "/tempZip/translationTempFile";
String translateAfterFileName = sourceOssFile.getFileName().substring(0, sourceOssFile.getFileName().lastIndexOf("."));
try {
translateAfterFile = createTranslateAfterFile(translateAfterFilePath, translateAfterSb.toString(),sourceOssFile.getFileName());
translateAfterFile = createTranslateAfterFile(translateAfterFilePath, translateAfterSb.toString(),translateAfterFileName);
} catch (Exception ex) {
ex.printStackTrace();
logger.error("翻译文档-写入文档失败:" + ex.getMessage());
@@ -137,7 +138,7 @@ public class TranslationDocumentUtils {
if (!newFilePath.exists()) {
newFilePath.mkdirs();
}
translateAfterFilePath = translateAfterFilePath + "/" + fileName;
translateAfterFilePath = translateAfterFilePath + "/" + fileName + ".doc";
File newFile = new File(translateAfterFilePath);
if (!newFile.exists()) {
newFile.createNewFile();