From d597a997da4b67768aa32579d04526964ac37297 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <17621308561@163.com> Date: Tue, 10 Dec 2024 14:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=B6=E5=AE=9A=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicSetPMApprovalFlowPlugin.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java new file mode 100644 index 0000000..6ef761e --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/workflow/DynamicSetPMApprovalFlowPlugin.java @@ -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 calcUserIds(AgentExecution execution) { + List 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; + } +}