From 7d4c91c2e25930ab9cbbcc2a09b87a332c376e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Mon, 23 Aug 2021 15:21:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E4=BD=93=E5=BA=93?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExpertSignatureServiceImpl.java | 9 +++++++-- src/main/resources/application-dev.yml | 1 + src/main/resources/application-local.yml | 1 + src/main/resources/application-mster.yml | 1 + src/main/resources/application-uat.yml | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/signature/service/impl/ExpertSignatureServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/signature/service/impl/ExpertSignatureServiceImpl.java index 29e473c..12fcc34 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/signature/service/impl/ExpertSignatureServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/signature/service/impl/ExpertSignatureServiceImpl.java @@ -44,6 +44,9 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService { @Value("${mconfig.file.upload-address}") private String uploadAddress; + @Value("${mconfig.file.font-address}") + private String fontAddress; + private String getUploadAddress(String assessRoomId) { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); @@ -81,7 +84,9 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService { //上传pdf到文档中心 String pdfId = PropertyUtils.getSnowflakeId(); - attachmentClient.upload(pdfId, entity.getFilename(), pdf); + String filename = entity.getFilename(); + filename = filename.substring(0, filename.lastIndexOf(".")) + ".pdf"; + attachmentClient.upload(pdfId, filename, pdf); return pdfId; } @@ -119,7 +124,7 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService { File f = new File(path + "merged.pdf"); FileOutputStream fos = new FileOutputStream(f); - FontSettings.getDefaultInstance().setFontsFolder("/storage/fonts/",true); + FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true); try { com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx"); doc.save(fos, SaveFormat.PDF); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index ef4944f..f3ea5e3 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -173,6 +173,7 @@ mconfig: documentcenter: core-service-document-center #文档中心 usercenter: core-service-usercenter-public #用户中心 file: + font-address: /storage/fonts/ upload-address: /storage/reviewReport/ document: clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 4f3a9c1..22add41 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -165,6 +165,7 @@ mconfig: documentcenter: core-service-document-center #文档中心 usercenter: core-service-usercenter-public #用户中心 file: + font-address: /storage/fonts/ upload-address: /storage/reviewReport/ document: diff --git a/src/main/resources/application-mster.yml b/src/main/resources/application-mster.yml index aacb2f2..53412c8 100644 --- a/src/main/resources/application-mster.yml +++ b/src/main/resources/application-mster.yml @@ -168,6 +168,7 @@ mconfig: documentcenter: core-service-document-center #文档中心 usercenter: core-service-usercenter-public #用户中心 file: + font-address: /storage/fonts/ upload-address: /storage/reviewReport/ document: clientHttpUrl: http://10.238.25.112:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 diff --git a/src/main/resources/application-uat.yml b/src/main/resources/application-uat.yml index 5d1ae5c..c176d9b 100644 --- a/src/main/resources/application-uat.yml +++ b/src/main/resources/application-uat.yml @@ -168,6 +168,7 @@ mconfig: documentcenter: core-service-document-center #文档中心 usercenter: core-service-usercenter-public #用户中心 file: + font-address: /storage/fonts/ upload-address: /storage/reviewReport/ document: clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749