From 1f08a2725e337233d2c9719f8c04deea622a92de Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Thu, 17 Feb 2022 23:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=20Flowable=20=20?= =?UTF-8?q?=E5=88=86=E9=85=8Dleader=20=E5=AE=A1=E6=89=B9=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-module-bpm/yudao-module-bpm-impl-flowable/pom.xml | 4 ++++ .../flowable/core/behavior/BpmUserTaskActivityBehavior.java | 3 +++ .../behavior/script/impl/BpmTaskAssignLeaderX1Script.java | 3 +++ .../behavior/script/impl/BpmTaskAssignLeaderX2Script.java | 5 +++++ 4 files changed, 15 insertions(+) diff --git a/yudao-module-bpm/yudao-module-bpm-impl-flowable/pom.xml b/yudao-module-bpm/yudao-module-bpm-impl-flowable/pom.xml index ea48aaf90..ffd2412e5 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-flowable/pom.xml +++ b/yudao-module-bpm/yudao-module-bpm-impl-flowable/pom.xml @@ -26,6 +26,10 @@ cn.iocoder.boot yudao-spring-boot-starter-flowable + + cn.iocoder.boot + yudao-spring-boot-starter-biz-data-permission + org.flowable flowable-spring-boot-starter-actuator diff --git a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmUserTaskActivityBehavior.java b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmUserTaskActivityBehavior.java index e364b3199..fb2551cbc 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmUserTaskActivityBehavior.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmUserTaskActivityBehavior.java @@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; +import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRule; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO; import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum; @@ -183,6 +185,7 @@ public class BpmUserTaskActivityBehavior extends UserTaskActivityBehavior { if (CollUtil.isEmpty(assigneeUserIds)) { return; } + //TODO 芋艿 这里有数据权限的问题。默认会加上数据权限 dept_id IN (deptId). 导致查询不到数据 Map userMap = adminUserApi.getUserMap(assigneeUserIds); assigneeUserIds.removeIf(id -> { AdminUserRespDTO user = userMap.get(id); diff --git a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX1Script.java b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX1Script.java index 55e7df7b8..fef8ecc4b 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX1Script.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX1Script.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.behavior.script.impl; +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; +import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRule; import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskRuleScriptEnum; import org.flowable.task.service.impl.persistence.entity.TaskEntity; import org.springframework.stereotype.Component; @@ -15,6 +17,7 @@ import java.util.Set; public class BpmTaskAssignLeaderX1Script extends BpmTaskAssignLeaderAbstractScript { @Override + @DataPermission(excludeRules = DeptDataPermissionRule.class) public Set calculateTaskCandidateUsers(TaskEntity task) { return calculateTaskCandidateUsers(task, 1); } diff --git a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX2Script.java b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX2Script.java index a4455ea40..ccb4b944e 100644 --- a/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX2Script.java +++ b/yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderX2Script.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.behavior.script.impl; +import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; +import cn.iocoder.yudao.framework.datapermission.core.dept.rule.DeptDataPermissionRule; import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskRuleScriptEnum; import org.flowable.task.service.impl.persistence.entity.TaskEntity; import org.springframework.stereotype.Component; @@ -14,7 +16,10 @@ import java.util.Set; @Component public class BpmTaskAssignLeaderX2Script extends BpmTaskAssignLeaderAbstractScript { + @Override + //不需要处理数据权限, 不然会有问题,查询不到数据 + @DataPermission(excludeRules = DeptDataPermissionRule.class) public Set calculateTaskCandidateUsers(TaskEntity task) { return calculateTaskCandidateUsers(task, 2); }