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