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 e6aaf85..0dd1268 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 @@ -614,7 +614,14 @@ 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); @@ -942,6 +949,7 @@ public class WpsServiceImpl implements WpsService { //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="; 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 {