Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
9dc9f2d6
Commit
9dc9f2d6
authored
Aug 06, 2024
by
jiuping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
找问题测试
parent
163c2e41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
BpmTaskAssignLeaderAbstractScript.java
...havior/script/impl/BpmTaskAssignLeaderAbstractScript.java
+9
-2
No files found.
yudao-module-bpm/yudao-module-bpm-impl-flowable/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/script/impl/BpmTaskAssignLeaderAbstractScript.java
View file @
9dc9f2d6
...
...
@@ -7,10 +7,9 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import
cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO
;
import
cn.iocoder.yudao.module.system.api.user.AdminUserApi
;
import
cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.flowable.engine.delegate.DelegateExecution
;
import
org.flowable.engine.runtime.ProcessInstance
;
import
org.flowable.task.service.impl.persistence.entity.TaskEntity
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.util.Assert
;
...
...
@@ -26,6 +25,7 @@ import static java.util.Collections.emptySet;
*
* @author 捷道源码
*/
@Slf4j
public
abstract
class
BpmTaskAssignLeaderAbstractScript
implements
BpmTaskAssignScript
{
@Resource
...
...
@@ -41,31 +41,38 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
// 获得发起人
ProcessInstance
processInstance
=
bpmProcessInstanceService
.
getProcessInstance
(
execution
.
getProcessInstanceId
());
Long
startUserId
=
NumberUtils
.
parseLong
(
processInstance
.
getStartUserId
());
log
.
error
(
"111:{}"
,
startUserId
);
// 获得对应 leve 的部门
DeptRespDTO
dept
=
null
;
for
(
int
i
=
0
;
i
<
level
;
i
++)
{
// 获得 level 对应的部门
if
(
dept
==
null
)
{
dept
=
getStartUserDept
(
startUserId
);
log
.
error
(
"222:{}"
,
dept
);
if
(
dept
==
null
)
{
// 找不到发起人的部门,所以无法使用该规则
return
emptySet
();
}
}
else
{
log
.
error
(
"333:{}"
,
dept
.
getParentId
());
DeptRespDTO
parentDept
=
deptApi
.
getDept
(
dept
.
getParentId
());
if
(
parentDept
==
null
)
{
// 找不到父级部门,所以只好结束寻找。原因是:例如说,级别比较高的人,所在部门层级比较少
break
;
}
dept
=
parentDept
;
log
.
error
(
"444:{}"
,
parentDept
);
}
}
return
dept
.
getLeaderUserId
()
!=
null
?
asSet
(
dept
.
getLeaderUserId
())
:
emptySet
();
}
private
DeptRespDTO
getStartUserDept
(
Long
startUserId
)
{
log
.
error
(
"555:{}"
,
startUserId
);
AdminUserRespDTO
startUser
=
adminUserApi
.
getUser
(
startUserId
);
if
(
startUser
.
getDeptId
()
==
null
)
{
// 找不到部门,所以无法使用该规则
return
null
;
}
log
.
error
(
"6666:{}"
,
startUser
.
getDeptId
());
return
deptApi
.
getDept
(
startUser
.
getDeptId
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment