From e58cd13785d441c2fd24736e138774256850fce3 Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Wed, 14 May 2025 11:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=99=88?= =?UTF-8?q?=E7=BB=8D=E9=91=AB=20=E6=97=A5=E6=9C=9F=EF=BC=9A2025/5/14=2011?= =?UTF-8?q?=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E8=B4=A6=E6=88=B7=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9F=A5=E8=AF=A2=E4=BF=9D=E5=AD=98=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/sys/plugin/operation/BankSaveOP.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/BankSaveOP.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/BankSaveOP.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/BankSaveOP.java new file mode 100644 index 0000000..a32838d --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/operation/BankSaveOP.java @@ -0,0 +1,60 @@ +package shkd.sys.sys.plugin.operation; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.PreparePropertysEventArgs; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.entity.plugin.args.BeforeOperationArgs; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; + +import java.util.List; + +public class BankSaveOP extends AbstractOperationServicePlugIn { + + + @Override + public void onPreparePropertys(PreparePropertysEventArgs e) { + super.onPreparePropertys(e); + } + + @Override + public void beforeExecuteOperationTransaction(BeforeOperationArgs e) { + super.beforeExecuteOperationTransaction(e); + DynamicObject[] dataEntities = e.getDataEntities(); + + + if("banksave".equals(e.getOperationKey()) ) { //按钮操作编码 + + if(dataEntities != null && dataEntities.length != 0) { + + for(int i = 0;i < dataEntities.length;i ++) { + + DynamicObject dynamicObject = dataEntities[i]; + dynamicObject.set("kdretflag", null); //数据赋值 + + if(dynamicObject != null) { + //通过基础资料或单据标识 的id 获取数据 + DynamicObject bei_transdetail = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), "bei_transdetail"); + + if(bei_transdetail != null ) { + bei_transdetail.set("kdretflag", null); //数据赋值 + SaveServiceHelper.save(new DynamicObject[] {bei_transdetail}); + + + } + + } + dataEntities[i]=dynamicObject; + } + } + } + e.setDataEntities(dataEntities); + } + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + } +}