From 6c7bcfdca5c3c24befde65aa085b11e60b4df62b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com>
Date: Tue, 1 Mar 2022 10:24:28 +0800
Subject: [PATCH 1/7] v2.1.0
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 957559a..e896e2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
com.chinaunicom.ebtp
mall-ebtp-cloud-parent
- 2.0.1-SNAPSHOT
+ 2.1.0-SNAPSHOT
com.chinaunicom.mall.ebtp
@@ -20,7 +20,7 @@
com.chinaunicom.mall.ebtp
uboot-core
- 2.0.1-SNAPSHOT
+ 2.1.0-SNAPSHOT
From b5d302ccb2609e1644598d729be283f591e4748a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?=
Date: Mon, 21 Mar 2022 09:27:21 +0800
Subject: [PATCH 2/7] v2.1.1
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index e896e2f..3fa172b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
com.chinaunicom.ebtp
mall-ebtp-cloud-parent
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
com.chinaunicom.mall.ebtp
@@ -20,7 +20,7 @@
com.chinaunicom.mall.ebtp
uboot-core
- 2.1.0-SNAPSHOT
+ 2.1.1-SNAPSHOT
From b7a3edbae2ed35857f95395154fc63ae937b2e9b Mon Sep 17 00:00:00 2001
From: zhangqinbin <181961702@qq.com>
Date: Tue, 22 Mar 2022 11:34:36 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E9=98=BB=E6=96=AD=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../crypconfigure/crypto/helper/Utils.java | 70 +++++++++----------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java
index 3db4dd4..9dd156d 100644
--- a/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java
+++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/crypconfigure/crypto/helper/Utils.java
@@ -294,31 +294,31 @@ public final class Utils {
}
}
- public static Properties parseGrpcUrl(String url) {
- if (isNullOrEmpty(url)) {
- throw new RuntimeException("URL cannot be null or empty");
- }
-
- Properties props = new Properties();
- final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)";
- final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher m = p.matcher(url);
- if (m.matches()) {
- props.setProperty("protocol", m.group(1));
- props.setProperty("host", m.group(2));
- props.setProperty("port", m.group(3));
-
- String protocol = props.getProperty("protocol");
- if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) {
- throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol));
- }
- } else {
- throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");
- }
-
- // TODO: allow all possible formats of the URL
- return props;
- }
+// public static Properties parseGrpcUrl(String url) {
+// if (isNullOrEmpty(url)) {
+// throw new RuntimeException("URL cannot be null or empty");
+// }
+//
+// Properties props = new Properties();
+// final String regex = "([^:]+)[:]//([^:]+)[:]([0-9]+)";
+// final Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
+// Matcher m = p.matcher(url);
+// if (m.matches()) {
+// props.setProperty("protocol", m.group(1));
+// props.setProperty("host", m.group(2));
+// props.setProperty("port", m.group(3));
+//
+// String protocol = props.getProperty("protocol");
+// if (!"grpc".equals(protocol) && !"grpcs".equals(protocol)) {
+// throw new RuntimeException(format("Invalid protocol expected grpc or grpcs and found %s.", protocol));
+// }
+// } else {
+// throw new RuntimeException("URL must be of the format protocol://host:port. Found: '" + url + "'");
+// }
+//
+// // TODO: allow all possible formats of the URL
+// return props;
+// }
/**
* Check if the strings Grpc url is valid
@@ -326,16 +326,16 @@ public final class Utils {
* @param url
* @return Return the io.seata.core.exception that indicates the error or null if ok.
*/
- public static Exception checkGrpcUrl(String url) {
- try {
-
- parseGrpcUrl(url);
- return null;
-
- } catch (Exception e) {
- return e;
- }
- }
+// public static Exception checkGrpcUrl(String url) {
+// try {
+//
+// parseGrpcUrl(url);
+// return null;
+//
+// } catch (Exception e) {
+// return e;
+// }
+// }
/**
* Check if a string is null or empty.
From c48cdc5b024fd0bee82838736126587cb385069b Mon Sep 17 00:00:00 2001
From: fuqingji <51312040@qq.com>
Date: Tue, 22 Mar 2022 16:11:28 +0800
Subject: [PATCH 4/7] 20220315-bugs
---
.../service/impl/ExpertSignatureServiceImpl.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 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 722b64e..18f1151 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
@@ -125,20 +125,18 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
File f = new File(path + "merged.pdf");
FileOutputStream fos = null;
- FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true);
try {
+ FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true);
fos = new FileOutputStream(f);
com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx");
doc.save(fos, SaveFormat.PDF);
+ fos.flush();
} catch (Exception e) {
log.info(ExceptionUtil.stacktraceToString(e));
} finally {
- source.close();
- addObj.close();
- if (fos != null) {
- fos.flush();
- fos.close();
- }
+ IOUtils.closeQuietly(source);
+ IOUtils.closeQuietly(addObj);
+ IOUtils.closeQuietly(fos);
}
From c6414bcaafd3b8be65526b86ba7d1841510cd0ec Mon Sep 17 00:00:00 2001
From: zhangyx <1254353766@qq.com>
Date: Fri, 1 Apr 2022 09:54:52 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=87=AA=E5=B7=B1feign?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mall/ebtp/extend/feign/client/DocumentCenterService.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
index 87fbd34..e0bd11a 100644
--- a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
+++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
@@ -14,8 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
*/
@FeignClient(value = "${mconfig.feign.name.documentcenter}",
- fallbackFactory = DocumentCenterServiceFallbackFactory.class,
- configuration = FeignConfiguration.class)
+ fallbackFactory = DocumentCenterServiceFallbackFactory.class)
public interface DocumentCenterService {
/**
From 539711d13a3e175ec3fd8246a17ac300ab245396 Mon Sep 17 00:00:00 2001
From: zhangyx <1254353766@qq.com>
Date: Fri, 1 Apr 2022 10:53:49 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../feign/client/DocumentCenterService.java | 4 +-
.../feign/config/FeignConfiguration.java | 92 -------------------
2 files changed, 1 insertion(+), 95 deletions(-)
delete mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
index 87fbd34..104406c 100644
--- a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
+++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/client/DocumentCenterService.java
@@ -1,7 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.feign.client;
import com.chinaunicom.mall.ebtp.extend.feign.client.factory.DocumentCenterServiceFallbackFactory;
-import com.chinaunicom.mall.ebtp.extend.feign.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -14,8 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
*/
@FeignClient(value = "${mconfig.feign.name.documentcenter}",
- fallbackFactory = DocumentCenterServiceFallbackFactory.class,
- configuration = FeignConfiguration.class)
+ fallbackFactory = DocumentCenterServiceFallbackFactory.class)
public interface DocumentCenterService {
/**
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java
deleted file mode 100644
index 58f0ad7..0000000
--- a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.chinaunicom.mall.ebtp.extend.feign.config;
-
-import com.alibaba.fastjson.JSONObject;
-import com.chinaunicom.mall.ebtp.extend.feign.utils.UrlConstants;
-import feign.RequestInterceptor;
-import feign.RequestTemplate;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpHeaders;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.DataOutputStream;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-@Slf4j
-@Configuration
-public class FeignConfiguration implements RequestInterceptor {
-
- @Override
- public void apply(RequestTemplate requestTemplate) {
- ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
- if (attributes != null) {
- HttpServletRequest request = attributes.getRequest();
- log.info("token=======requestTemplate.headers" + requestTemplate.headers());
- String access_token = request.getHeader("Authorization");
- log.info("token=======" + access_token);
- if (access_token == null || StringUtils.isBlank(access_token)) {
- access_token = getAccessToken();
- log.info("token=======access_token===" + access_token);
- requestTemplate.header(HttpHeaders.AUTHORIZATION, "Bearer " + access_token);
- }
- } else {
- String access_token = getAccessToken();
- log.info("token=======attributes==null===" + access_token);
- requestTemplate.header(HttpHeaders.AUTHORIZATION, "Bearer " + access_token);
- }
- }
-
- public static String getAccessToken() {
- StringBuffer strBf = new StringBuffer();
- try {
- URL realUrl = new URL(UrlConstants.clientHttpUrl);
- //将realUrl以 open方法返回的urlConnection 连接强转为HttpURLConnection连接 (标识一个url所引用的远程对象连接)
- HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();// 此时cnnection只是为一个连接对象,待连接中
- //设置连接输出流为true,默认false (post请求是以流的方式隐式的传递参数)
- connection.setDoOutput(true);
- //设置连接输入流为true
- connection.setDoInput(true);
- //设置请求方式为post
- connection.setRequestMethod("POST");
- //post请求缓存设为false
- connection.setUseCaches(false);
- //设置该HttpURLConnection实例是否自动执行重定向
- connection.setInstanceFollowRedirects(true);
- //设置请求头里面的各个属性 (以下为设置内容的类型,设置为经过urlEncoded编码过的from参数)
- connection.setRequestProperty("Content-Type", "application/json;charset=utf-8");
- //建立连接 (请求未开始,直到connection.getInputStream()方法调用时才发起,以上各个参数设置需在此方法之前进行)
- connection.connect();
- //创建输入输出流,用于往连接里面输出携带的参数,(输出内容为?后面的内容)
- DataOutputStream dataout = new DataOutputStream(connection.getOutputStream());
-// String query = data.toString();
-// //将参数输出到连接
-// dataout.write(query.getBytes("UTF-8"));
- // 输出完成后刷新并关闭流
- dataout.flush();
- dataout.close(); // 重要且易忽略步骤 (关闭流,切记!)
- BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
- String lines;
- while ((lines = reader.readLine()) != null) {
- lines = new String(lines.getBytes(), "utf-8");
- strBf.append(lines);
- }
- reader.close();
- connection.disconnect();
- log.info("toke返回数据:---------------------- " + strBf.toString());
- } catch (Exception e) {
- log.info("toke返回数据:---------------------- " + e.getMessage());
- }
- JSONObject json = JSONObject.parseObject(strBf.toString());
- if ((boolean) json.get("success")) {
- return ((JSONObject) json.get("data")).get("value").toString();
- }
- return null;
- }
-}
-
From d66c21740bb4b70972d98fbc6717f1b1f899b572 Mon Sep 17 00:00:00 2001
From: zhangyx <1254353766@qq.com>
Date: Fri, 1 Apr 2022 13:50:04 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mall/ebtp/extend/feign/config/FeignConfiguration.java | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/feign/config/FeignConfiguration.java
deleted file mode 100644
index e69de29..0000000