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);//项目实体 + } + } +}