动态制定审批人
This commit is contained in:
parent
b195128499
commit
d597a997da
|
@ -0,0 +1,31 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.workflow;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.workflow.api.AgentExecution;
|
||||
import kd.bos.workflow.engine.extitf.IWorkflowPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支出合同动态设置某个节点审批人
|
||||
*/
|
||||
public class DynamicSetPMApprovalFlowPlugin implements IWorkflowPlugin {
|
||||
|
||||
|
||||
//根据【经理】制定当前节点的审批人
|
||||
@Override
|
||||
public List<Long> calcUserIds(AgentExecution execution) {
|
||||
List<Long> ApproversIdList = new ArrayList<>();
|
||||
// 获取单据id
|
||||
String pkId = execution.getBusinessKey();
|
||||
// 获取单据体中的【经理】字段,,将用户设置为当前单据的当前节点的审批人
|
||||
DynamicObject obj = BusinessDataServiceHelper.loadSingle(pkId, "zcgj_test_work_bill");
|
||||
DynamicObject zcgjManger = obj.getDynamicObject("zcgj_manger");
|
||||
long userId = zcgjManger.getLong("id");
|
||||
ApproversIdList.add(userId);
|
||||
// 返回审批人的id集合
|
||||
return ApproversIdList;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue