From 1a853e798846d80c6c8b15ffb22b74c59a9101f5 Mon Sep 17 00:00:00 2001 From: sez Date: Fri, 12 Dec 2025 17:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=90=8E=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=8F=B0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java b/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java index f0f0815..0179100 100644 --- a/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java +++ b/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java @@ -1,6 +1,7 @@ package tqq9.lc123.cloud.app.plugin.operate.sys; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.operate.result.OperationResult; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; import kd.bos.servicehelper.BusinessDataServiceHelper; @@ -8,6 +9,8 @@ import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import oadd.org.apache.commons.lang3.StringUtils; +import java.util.List; + /** * 单据操作插件 * 供应商保存后设置中台供应商id @@ -17,13 +20,16 @@ public class SupSaveAfterOp extends AbstractOperationServicePlugIn implements Pl @Override public void afterExecuteOperationTransaction(AfterOperationArgs e) { super.afterExecuteOperationTransaction(e); - DynamicObject[] dataEntities = e.getDataEntities(); - for (DynamicObject dataEntity : dataEntities) { + OperationResult operationResult = this.getOperationResult(); + List successPkIds = operationResult.getSuccessPkIds(); + for (Object successPkId : successPkIds) { + DynamicObject dataEntity = BusinessDataServiceHelper.loadSingle(successPkId, "bd_supplier"); String tqq9_ztsupplierid = dataEntity.getString("tqq9_ztsupplierid"); if (StringUtils.isBlank(tqq9_ztsupplierid)) { dataEntity.set("tqq9_ztsupplierid", dataEntity.getPkValue()); SaveServiceHelper.save(new DynamicObject[]{dataEntity}); } } + } } \ No newline at end of file