From cdedd387b6f0c6c02644dcf96c8f9a35e30465cb Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Wed, 3 Jan 2024 09:07:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?WPS=20=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B0=B4=E5=8D=B0=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ebtp/extend/wps/entity/KingSoftWpsPreviewVo.java | 5 +++++ .../mall/ebtp/extend/wps/entity/WatermarkConfig.java | 9 +++++++++ .../ebtp/extend/wps/service/impl/WpsServiceImpl.java | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/WatermarkConfig.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/KingSoftWpsPreviewVo.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/KingSoftWpsPreviewVo.java index 61c7922..2894331 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/KingSoftWpsPreviewVo.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/KingSoftWpsPreviewVo.java @@ -46,4 +46,9 @@ public class KingSoftWpsPreviewVo { */ private String fileLastModifiedTime; + /** + * 水印 + */ + private WatermarkConfig watermarkConfig; + } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/WatermarkConfig.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/WatermarkConfig.java new file mode 100644 index 0000000..9540e4e --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/entity/WatermarkConfig.java @@ -0,0 +1,9 @@ +package com.chinaunicom.mall.ebtp.extend.wps.entity; + +import lombok.Data; + +@Data +public class WatermarkConfig { + private String type = "0"; + private String value = "empty"; +} 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 ae95af3..ad54a97 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 @@ -786,7 +786,7 @@ public class WpsServiceImpl implements WpsService { wpsService.kswpublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtUm+H78uT39TOsgS5XdbIuC0BRLiktqbuI3F9VFbPWDcX15Ptb2u2yTCSOB0Gl+yI+hqpClyV9nyjnu0LgoWpsIDZSLVLdrltYKz9N8jwXKhybomT2EuYU7hzWT1Ea4fkIBfYMCl+BQYSkXD6eqObg4mq2/wUFUVX/+/vjsMShwIDAQAB"; wpsService.kswprivateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAK1Sb4fvy5Pf1M6yBLld1si4LQFEuKS2pu4jcX1UVs9YNxfXk+1va7bJMJI4HQaX7Ij6GqkKXJX2fKOe7QuChamwgNlItUt2uW1grP03yPBcqHJuiZPYS5hTuHNZPURrh+QgF9gwKX4FBhKRcPp6o5uDiarb/BQVRVf/7++OwxKHAgMBAAECgYA77iY8hdEJx7qo4es6QVVUQELnjmCeK74a18yVPoVp2qHqL5Op5P4EzRprZNW8gum6D2kKjFepTvqYBQsIENCwY3a6iKQf+8kwJ/GhVP+7uT3bnxdQFNXA99ujVu7Q2nFQZYAYJWiuMOQKGWrVJperlli0Ip3htCNmtTaviVfAcQJBANTAbX210K1zWe40nSxuuc6ONBqK/YF5hkqKpWB/XzfgFgQ4tPOfvWnnp0pt9rWUV9PzO6NYr2ya60yu2Y6aE+kCQQDQjhfdIid458UOYbjAixY5ONZOcswFQi77pk6MB5Cp8aHn8gHtapDnXt5DiHhqzJCya31FYYoqGtp/4fIntRzvAkA1N2Dr5fOpv0XKcLyz5YpyoV1lGkko/sXZlW6igZnGtzWqnqicm+NcP0a4NmNUriN978SGKmPO7b1XtBDVO7MpAkA/Q1sp0Tp4CpZUDoCkp4xOP1eC5H/O+IyX+ZLKF2Fiq9GZMmgzRKhABx8VDUi53OPnu4N8kGIA87RkJn32XZIxAkAtL+skd+5wkL71VZVnZafLIjWlJM/RKxqyaLbF8irT2sq2+ae8A19hfXj3zT7CeLn5xjKP1/cuGakeOBL8cNaw"; wpsService.appName = "biz-service-ebtp-extend"; - //String jm = RSA.encrypt("1538803364727304192_20231219095538_0_doc_客户端测试子项目1-XY926020101-服务费通知书-杭州安恒信息技术股份有限公司",wpsService.kswpublicKey); + String jm = RSA.encrypt("1538803364727304192_20231219095538_0_doc",wpsService.kswpublicKey); //System.out.println(jm); // String jm = "FmwOetVUoBs0M9rjHUpWhkSu3HWI+fujD5fh+Gwv/XQo3h5JpMghBMHdLpcgVtRYSxfvOROWyi4sUiooEm8yNU5GYmxR7LE/wvecp4fFMXeEtOgHnX4dNzITBorcqWjqS286a7LGCKAmC33CO7gP/lQewPPHiu9qzueWESLGsxM="; From 975b34256443409f28589cf4c1c5d9f30e513e20 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Wed, 3 Jan 2024 09:36:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?WPS=20=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B0=B4=E5=8D=B0=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ebtp/extend/wps/service/impl/WpsServiceImpl.java | 10 ++++++++-- .../mall/ebtp/extend/wps/util/HttpsUtils.java | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) 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 ad54a97..e3be2fa 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 @@ -607,9 +607,15 @@ public class WpsServiceImpl implements WpsService { dataJson = JSON.toJSONString(vo); } - String retJson = HttpUtils.httpPost(url, dataJson);//httpPost(kswpsurl,json); + //String retJson = HttpUtils.httpPost(url, dataJson);//httpPost(kswpsurl,json); + String retJson = ""; + if(url.indexOf("https://")>=0){ + retJson = HttpsUtils.UrlPost(url, "utf-8", dataJson); + }else{ + retJson = HttpUtils.httpPost(url, dataJson); + } + log.info("ret:"+retJson); - //String retJson = HttpUtils.httpPost(kswpsurl,json); KingSoftWpsRet ret = JSON.parseObject(retJson,KingSoftWpsRet.class); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java index ac2bc6b..b0c7de0 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java @@ -19,7 +19,7 @@ import java.util.Map; @Slf4j public class HttpsUtils { - + public static String UrlPost(String url,String charSet, String json){ return UrlPost(url,charSet,json,null); } @@ -104,6 +104,7 @@ public class HttpsUtils { return str; } + private static class TrustAnyTrustManager implements X509TrustManager { @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {