From 6c8080810276e539f874d2d898fe05890cdd4a5c Mon Sep 17 00:00:00 2001 From: ggxl <194689125@qq.com> Date: Sat, 30 Nov 2024 14:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E6=8B=89=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E9=87=87=E8=B4=AD=E9=9C=80=E6=B1=82=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formplugin/UpdateDrawPurDataPlugin.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java diff --git a/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java b/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java new file mode 100644 index 0000000..9dd01da --- /dev/null +++ b/main/java/shkd/repc/rebm/formplugin/UpdateDrawPurDataPlugin.java @@ -0,0 +1,32 @@ +package shkd.repc.rebm.formplugin; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.events.AfterDoOperationEventArgs; +import kd.sdk.plugin.Plugin; + +/** + * 单据界面插件 + */ +public class UpdateDrawPurDataPlugin extends AbstractBillPlugIn implements Plugin { + + @Override + public void afterDoOperation(AfterDoOperationEventArgs args) { + super.afterDoOperation(args); + String operateKey = args.getOperateKey(); + if ("draw".equals(operateKey)) { + IDataModel model = this.getModel(); + int rowIndex = model.getEntryCurrentRowIndex("bidsection"); + DynamicObjectCollection bidSections = model.getEntryEntity("bidsection"); + DynamicObject dynamicObject1 = bidSections.get(rowIndex); + DynamicObject dynamicObject2 = bidSections.get(bidSections.size() - 1); + + DynamicObjectCollection projectEntries = dynamicObject1.getDynamicObjectCollection("projectentry"); + projectEntries.addAll(dynamicObject2.getDynamicObjectCollection("projectentry")); + model.deleteEntryRow("bidsection", bidSections.size() - 1); + this.getView().updateView("projectentry"); + } + } +} \ No newline at end of file