From 9502fef140289b098531c265c4676035796783b1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 3 Aug 2025 19:16:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9A=E3=80=90bpm=20=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E3=80=91BpmSequentialMultiInstanceBehavior?= =?UTF-8?q?=20=E5=85=BC=E5=AE=B9=20CallActivity=E3=80=81SubProcess=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../behavior/BpmSequentialMultiInstanceBehavior.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java b/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java index 21b4f9ee8..e48b1f95d 100644 --- a/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java +++ b/yudao-module-bpm/yudao-module-bpm-server/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java @@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; import lombok.Setter; -import org.flowable.bpmn.model.Activity; -import org.flowable.bpmn.model.CallActivity; -import org.flowable.bpmn.model.FlowElement; -import org.flowable.bpmn.model.UserTask; +import org.flowable.bpmn.model.*; import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior; @@ -85,6 +82,12 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB @Override protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) { + // 参见 https://t.zsxq.com/53Meo 情况 + if (execution.getCurrentFlowElement() instanceof CallActivity + || execution.getCurrentFlowElement() instanceof SubProcess) { + super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); + return; + } // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F super.collectionExpression = null; super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId()); From a277987139b55e5cabce96bf8ef73cb45299e507 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 3 Aug 2025 19:39:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E3=80=90framework=20=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E3=80=91GlobalExceptionHandler=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=20guava=20UncheckedExecutionException=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8Chttps://t.zsxq.com/UszdH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao-spring-boot-starter-web/pom.xml | 8 +++++++- .../web/core/handler/GlobalExceptionHandler.java | 14 ++++++++++++++ .../controller/admin/auth/AuthController.http | 10 ++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index ac1ab3dfc..0943f9f5a 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -61,7 +61,13 @@ true - + + + com.google.guava + guava + provided + + org.jsoup jsoup diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java index 627a5ea78..abab1ce51 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/handler/GlobalExceptionHandler.java @@ -17,6 +17,7 @@ import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import com.fasterxml.jackson.databind.exc.InvalidFormatException; +import com.google.common.util.concurrent.UncheckedExecutionException; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; @@ -111,6 +112,9 @@ public class GlobalExceptionHandler { if (ex instanceof AccessDeniedException) { return accessDeniedExceptionHandler(request, (AccessDeniedException) ex); } + if (ex instanceof UncheckedExecutionException && ex.getCause() != ex) { + return allExceptionHandler(request, ex.getCause()); + } return defaultExceptionHandler(request, ex); } @@ -266,6 +270,16 @@ public class GlobalExceptionHandler { return CommonResult.error(FORBIDDEN); } + /** + * 处理 Guava UncheckedExecutionException + * + * 例如说,缓存加载报错,可见 https://t.zsxq.com/UszdH + */ + @ExceptionHandler(value = UncheckedExecutionException.class) + public CommonResult uncheckedExecutionExceptionHandler(HttpServletRequest req, UncheckedExecutionException ex) { + return allExceptionHandler(req, ex.getCause()); + } + /** * 处理业务异常 ServiceException * diff --git a/yudao-module-system/yudao-module-system-server/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.http b/yudao-module-system/yudao-module-system-server/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.http index f42dfcd03..f21eb5268 100644 --- a/yudao-module-system/yudao-module-system-server/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.http +++ b/yudao-module-system/yudao-module-system-server/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.http @@ -21,6 +21,16 @@ tenant-id: {{adminTenantId}} "password": "admin123" } +### 请求 /login 接口 => 失败(租户不存在) +POST {{baseUrl}}/system/auth/login +Content-Type: application/json +tenant-id: 2 + +{ + "username": "admin", + "password": "admin123" +} + ### 请求 /get-permission-info 接口 => 成功 GET {{baseUrl}}/system/auth/get-permission-info Authorization: Bearer {{token}}