修改对接接口
This commit is contained in:
+20
-1
@@ -563,7 +563,26 @@ public class OnlyOfficeController {
|
|||||||
String attFileId = createTimeLatestOnlineFileLog.getAttFileId();
|
String attFileId = createTimeLatestOnlineFileLog.getAttFileId();
|
||||||
OSSFile ossFile = ossFileService.getById(attFileId);
|
OSSFile ossFile = ossFileService.getById(attFileId);
|
||||||
File file = new File(filePath + ossFile.getUrl());
|
File file = new File(filePath + ossFile.getUrl());
|
||||||
FileSystemResource fileResource = new FileSystemResource(file);
|
|
||||||
|
// 加载文档
|
||||||
|
Document doc = new Document(filePath + ossFile.getUrl());
|
||||||
|
doc.getSections().get(0).getPageSetup().setPageNumberStyle(PageNumberStyle.Roman_Upper);
|
||||||
|
doc.getSections().get(0).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向
|
||||||
|
doc.getSections().get(1).getPageSetup().setOrientation(PageOrientation.Portrait);//纵向
|
||||||
|
|
||||||
|
String downloadDocxFileTempUrl = filePath + "/downloadDocxFileTemp";
|
||||||
|
File downloadDocxFileTempUrlFile = new File(downloadDocxFileTempUrl);
|
||||||
|
|
||||||
|
if (!downloadDocxFileTempUrlFile.exists()) {
|
||||||
|
downloadDocxFileTempUrlFile.mkdirs();
|
||||||
|
}
|
||||||
|
String newFileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
||||||
|
String newFileUrl = downloadDocxFileTempUrl + "/" + newFileName;
|
||||||
|
|
||||||
|
//保存文档
|
||||||
|
doc.saveToFile(newFileUrl);
|
||||||
|
|
||||||
|
FileSystemResource fileResource = new FileSystemResource(newFileUrl);
|
||||||
params2.add("file", fileResource);
|
params2.add("file", fileResource);
|
||||||
|
|
||||||
// 使用HttpEntity对象包装请求体和请求头
|
// 使用HttpEntity对象包装请求体和请求头
|
||||||
|
|||||||
Reference in New Issue
Block a user