Commit a3ecc23b authored by jiuping's avatar jiuping

部门负责人发起流程找上级人审批

parent 84569c6c
......@@ -7,6 +7,7 @@ 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.springframework.context.annotation.Lazy;
......@@ -24,6 +25,7 @@ import static java.util.Collections.emptySet;
*
* @author 捷道源码
*/
@Slf4j
public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssignScript {
@Resource
......@@ -48,8 +50,10 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
if (dept == null) { // 找不到发起人的部门,所以无法使用该规则
return emptySet();
} else {
log.error("1111:{}-{}", dept.getLeaderUserId(), startUserId);
if (dept.getLeaderUserId().equals(startUserId)) {
DeptRespDTO parentDept = deptApi.getDept(dept.getParentId());
log.error("2222:{}", parentDept);
if (parentDept != null) { // 找不到父级部门,所以只好结束寻找。原因是:例如说,级别比较高的人,所在部门层级比较少
dept = parentDept;
} else {
......@@ -65,6 +69,8 @@ public abstract class BpmTaskAssignLeaderAbstractScript implements BpmTaskAssign
dept = parentDept;
}
}
log.error("3333:{}", dept);
return dept.getLeaderUserId() != null ? asSet(dept.getLeaderUserId()) : emptySet();
}
......
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