From 93140c2060fc1a0075ac1283380c959101a85a30 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Wed, 14 Jan 2026 13:24:55 +0800 Subject: [PATCH] =?UTF-8?q?redis=20=E6=96=AD=E5=90=8E=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomerFormServiceImpl.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/main/java/com/hxgk/lowcode/service/impl/CustomerFormServiceImpl.java b/src/main/java/com/hxgk/lowcode/service/impl/CustomerFormServiceImpl.java index f55d5b5..2bba596 100644 --- a/src/main/java/com/hxgk/lowcode/service/impl/CustomerFormServiceImpl.java +++ b/src/main/java/com/hxgk/lowcode/service/impl/CustomerFormServiceImpl.java @@ -18,6 +18,10 @@ import org.apache.commons.lang3.StringUtils; import org.apache.http.protocol.HTTP; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.RedisConnectionFailureException; +import org.springframework.data.redis.RedisSystemException; +import org.springframework.retry.annotation.Backoff; +import org.springframework.retry.annotation.Retryable; import org.springframework.stereotype.Service; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -62,6 +66,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { //根据用户权限查询表单列表 //@Override + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class},// + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public Tree getCustomerFormListOld(String key, String token) { @@ -314,6 +323,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { @Override //根据用户权限查询表单列表 + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class}, + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public Tree getCustomerFormList(String key, String token) { //查询出所有表单 @@ -906,6 +920,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { */ @Override + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class}, + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public ArrayList getAsfDataTitles(String key, String token,String glbbddbd,String formId, String dataTitle,String rangeFormula, String rangeString, String hideFormula, String hideString,String masterOnField, String fillFieldsMaster, JSONArray fillFieldsChild) { //关联表单的id String AsfFormId = formId; @@ -2279,6 +2298,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { } //返回boolean currentUser的maindeparment是否在targetOrgOrPerson及其直接父级组织列表中 @Override + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class}, + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public Boolean queryIfOrgOrPersonContainsCurrentUser(String key, String token, String targetOrgOrPerson, String condition, String right) { if(right.equals("当前用户")){ //获取当前用户信息 从redis中根据userkey和usertoken拿到userdetail @@ -2409,6 +2433,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { } @Override + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class}, + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public Boolean queryHideRoleCondition(String key, String token, String targetOrgOrPerson, String condition, String currentUser) { //获取用户信息 从redis中根据userkey和usertoken拿到userdetail Map keytokenmap = new HashMap<>(); @@ -2439,6 +2468,11 @@ public class CustomerFormServiceImpl implements CustomerFormService { } @Override + @Retryable( + value = {RedisConnectionFailureException.class, RedisSystemException.class}, + maxAttempts = 3, + backoff = @Backoff(delay = 100, multiplier = 2) + ) public ArrayList getAsfTableFill(String key, String token, String asfFormId, String glbbddbd, String currentVal,JSONArray fillFieldsChild) { //获取当前用户信息 从redis中根据userkey和usertoken拿到userdetail Map keytokenmap = new HashMap<>();