From 2f07df24db44a6ae121ee68f855c6a63b372d8ce Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期二, 29 八月 2023 17:47:27 +0800
Subject: [PATCH] 修改核销报错
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java
index 809d920..9238a1c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/helper/encrypt/ResultInterceptor.java
@@ -1,8 +1,10 @@
package com.panzhihua.service_community.model.helper.encrypt;
-import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
-import com.panzhihua.common.model.helper.encrypt.IEncryptDecrypt;
-import lombok.extern.slf4j.Slf4j;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Objects;
+import java.util.Properties;
+
import org.apache.ibatis.executor.resultset.ResultSetHandler;
import org.apache.ibatis.plugin.*;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,10 +13,10 @@
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Objects;
-import java.util.Properties;
+import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass;
+import com.panzhihua.common.model.helper.encrypt.IEncryptDecrypt;
+
+import lombok.extern.slf4j.Slf4j;
/**
* 解密拦截器
@@ -22,9 +24,7 @@
* @author cedoo
* @since 2021-4-1 10:40:52
*/
-@Intercepts({
- @Signature(type = ResultSetHandler.class, method = "handleResultSets", args={Statement.class})
-})
+@Intercepts({@Signature(type = ResultSetHandler.class, method = "handleResultSets", args = {Statement.class})})
@ConditionalOnProperty(value = "domain.decrypt", havingValue = "true")
@Component
@Slf4j
@@ -37,32 +37,31 @@
@Override
public Object intercept(Invocation invocation) throws Throwable {
Object result = invocation.proceed();
- if (Objects.isNull(result)){
+ if (Objects.isNull(result)) {
return null;
}
if (result instanceof ArrayList) {
- ArrayList resultList = (ArrayList) result;
- if (resultList!=null && resultList.size()>0 && needToDecrypt(resultList.get(0))){
+ ArrayList resultList = (ArrayList)result;
+ if (resultList != null && resultList.size() > 0 && needToDecrypt(resultList.get(0))) {
for (int i = 0; i < resultList.size(); i++) {
encryptDecrypt.decrypt(resultList.get(i));
}
}
- }else {
- if (needToDecrypt(result)){
+ } else {
+ if (needToDecrypt(result)) {
encryptDecrypt.decrypt(result);
}
}
return result;
}
- public boolean needToDecrypt(Object object){
- if(object!=null) {
+ public boolean needToDecrypt(Object object) {
+ if (object != null) {
Class<?> objectClass = object.getClass();
- EncryptDecryptClass encryptDecryptClass = AnnotationUtils.findAnnotation(objectClass, EncryptDecryptClass.class);
- if (Objects.nonNull(encryptDecryptClass)) {
- return true;
- }
+ EncryptDecryptClass encryptDecryptClass =
+ AnnotationUtils.findAnnotation(objectClass, EncryptDecryptClass.class);
+ return Objects.nonNull(encryptDecryptClass);
}
return false;
}
--
Gitblit v1.7.1