From 5d0e35dbb72849635c1fe4beb6365630f04ff35b Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Thu, 21 Dec 2023 15:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E7=BB=93=E6=9E=84=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/ebtp/extend/wps/controller/WpsController.java | 8 +++++--- .../mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java index 5bf4faa..70251fc 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/controller/WpsController.java @@ -192,6 +192,7 @@ public class WpsController { in.setFileName(fileName); in.setUserToken(userToken); in.setType(type); + in.setFileExtension(fileExtension); String str = this.wpsService.getKSWpsUrl(in); try { response.setContentType("text/html;charset=utf-8"); @@ -256,9 +257,10 @@ public class WpsController { @GetMapping("/kingSoft/file2") public boolean getKSFile2(HttpServletRequest request,HttpServletResponse response, @RequestParam("key") String key) { //带后缀 - String fileNameE = this.wpsService.downloadDecrypt(key); + String fileIdName = this.wpsService.downloadDecrypt(key); - String[] fileId = fileNameE.split("."); + String[] fileId = fileIdName.split("."); + log.info(" file2 fileId"+fileId); List businessIdList = new ArrayList<>(); @@ -266,7 +268,7 @@ public class WpsController { Optional optional = attachmentClient.findByBusinessId(businessIdList); - String fileName = fileNameE; + String fileName = fileIdName; String text = " "; byte buf[] = text.getBytes(); String fileLength = String.valueOf(buf.length); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java index 7c65e45..b889005 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java @@ -301,7 +301,7 @@ public class WpsServiceImpl implements WpsService { in.setFileId(fileId); in.setFileName(fileName+"."+extension); in.setType(type); - + in.setFileExtension(extension); return in; } @@ -761,7 +761,7 @@ public class WpsServiceImpl implements WpsService { //String jm = RSA.encrypt("1538803364727304192_20231219095538_0_doc_客户端测试子项目1-XY926020101-服务费通知书-杭州安恒信息技术股份有限公司",wpsService.kswpublicKey); //System.out.println(jm); - String jm = "OYVWJe3COaiuwhNM4Op7K6ijEWEzY0PQUlceNRTX2xL/Ey7opbVA0pFkX/Ky89LjlsnA3kGJgg5l6gtCIsZGK3g/X3zp4amtDu78CmaBbZEmYSHBG4q98DSPVJUMmk0hKPAmhIP+Kclpc0j8V/d2Gg4DpVqDMTZ8HeYh37ai3A=="; + String jm = "LPORqX1zzrE+7DP9gv8vHQ39uTN8+3O5uUhFq42ZsJM4ZGoJL1kwJLhO3vp8ExxXFdjsQj58/KHMzqVEtizmfOexJ8inQUQHaj1j/7tW1TNex+Z+N2Z19LfPgekOBHFJWUwYhwUwvBBD61qD3mdy8qnEoYNTTvkEJ1MoBrVNOHs="; String jem = RSA.decrypt(jm,wpsService.kswprivateKey); System.out.println(jem);