From 97416d354fe08e7739c236568c2ed20d9e7a765c Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Mon, 13 Jan 2025 09:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E7=BB=8F?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr/plugin/operate/ProjectUpdateOp.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/ProjectUpdateOp.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/ProjectUpdateOp.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/ProjectUpdateOp.java new file mode 100644 index 0000000..623cbaa --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/ProjectUpdateOp.java @@ -0,0 +1,23 @@ +package zcgj.zcdev.zcdev.pr.plugin.operate; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.operate.result.OperationResult; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.AddValidatorsEventArgs; +import kd.bos.servicehelper.operation.SaveServiceHelper; + +public class ProjectUpdateOp extends AbstractOperationServicePlugIn { + @Override + public void onAddValidators(AddValidatorsEventArgs e) { + super.onAddValidators(e); + + DynamicObject[] dataEntities1 = e.getDataEntities(); + DynamicObject object = dataEntities1[0]; + DynamicObject pm = object.getDynamicObject("zcgj_pm"); + if (pm == null) { + DynamicObject project = object.getDynamicObject("project"); + project.set("zcgj_pm",pm); + OperationResult saveOperationResult = SaveServiceHelper.saveOperate("ec_project", new DynamicObject[]{project}, null);//项目实体 + } + } +}