Commit c34bfa19 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge remote-tracking branch 'origin/master'

parents e868005e bc7217ae
......@@ -7,10 +7,8 @@ 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 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;
......@@ -49,6 +47,15 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
dept = getStartUserDept(startUserId);
if (dept == null) { // 找不到发起人的部门,所以无法使用该规则
return emptySet();
} else {
if (dept.getLeaderUserId().equals(startUserId)) {
DeptRespDTO parentDept = deptApi.getDept(dept.getParentId());
if (parentDept != null) { // 找不到父级部门,所以只好结束寻找。原因是:例如说,级别比较高的人,所在部门层级比较少
dept = parentDept;
} else {
return emptySet();
}
}
}
} else {
DeptRespDTO parentDept = deptApi.getDept(dept.getParentId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment