From c66db79acd97d61c1a331ebf9aba51bb2296e0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=9F=B3?= <12105081+xiaoshi_com@user.noreply.gitee.com> Date: Fri, 29 Nov 2024 12:17:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=85=A5=E6=94=AF=E5=87=BA=E5=90=88?= =?UTF-8?q?=E5=90=8C=E7=95=8C=E9=9D=A2=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr/plugin/form/EcContractFromPlugin.java | 18 +++++++ .../pr/plugin/form/OutContractFromPlugin.java | 49 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFromPlugin.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java new file mode 100644 index 0000000..88e405c --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EcContractFromPlugin.java @@ -0,0 +1,18 @@ +package zcgj.zcdev.zcdev.pr.plugin.form; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.sdk.plugin.Plugin; + +import java.util.EventObject; + +/** + * 单据界面插件 + */ +public class EcContractFromPlugin extends AbstractBillPlugIn implements Plugin { + + @Override + public void afterCreateNewData(EventObject e) { + super.afterCreateNewData(e); + + } +} \ No newline at end of file diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFromPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFromPlugin.java new file mode 100644 index 0000000..39438ef --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFromPlugin.java @@ -0,0 +1,49 @@ +package zcgj.zcdev.zcdev.pr.plugin.form; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.sdk.plugin.Plugin; + +/** + * 单据界面插件 + */ +public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin { + + private String entryName = "treelistentry";//分录标识 + + private String ecContract = "";// + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + String changeName = e.getProperty().getName(); + if(changeName.equals(ecContract)){//收入合同字段值改变 + Object outC = this.getModel().getValue(ecContract); + if(outC!=null){ + DynamicObject outContract = (DynamicObject) outC; + DynamicObjectCollection ecCEntrys = outContract.getDynamicObjectCollection(entryName);//获取收入合同合同清单 + for (int i = 0; i < ecCEntrys.size(); i++) { + DynamicObject ecCEntry = ecCEntrys.get(i); + int row = this.getModel().insertEntryRow(entryName, i); + this.getModel().setValue(entryName, ecCEntry.get(""), row); + } + DynamicObjectCollection outCEntry = this.getModel().getEntryEntity(entryName); + if (outCEntry.size() < 0) { + for (int i = 0; i < ecCEntrys.size(); i++) { + outCEntry.add(i, ecCEntrys.get(i)); + } + this.getView().updateView(entryName); + } + outCEntry = this.getModel().getEntryEntity(entryName); + if (outCEntry.size() < 0) { + for (int i = 0; i < ecCEntrys.size(); i++) { + outCEntry.add(ecCEntrys.get(i)); + } + this.getView().updateView(entryName); + } + } + } + } +} \ No newline at end of file