From e1baf2766ac9b10bd3548b300486473c7377b8e7 Mon Sep 17 00:00:00 2001 From: pan-houxiang <2663608154@qq.com> Date: Fri, 12 Dec 2025 18:03:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=89=8C=E4=BF=9D=E5=AD=98=E5=90=8E?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BF=AE=E6=94=B9=EF=BC=88BrandSaveAfterOp?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java b/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java index 4ea3106..0d2d213 100644 --- a/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java +++ b/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.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 @@ -16,8 +19,10 @@ public class BrandSaveAfterOp extends AbstractOperationServicePlugIn implements @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, "tqq9_brand"); String tqq9_ztsupplierid = dataEntity.getString("tqq9_ztbrandid"); if (StringUtils.isBlank(tqq9_ztsupplierid)) { dataEntity.set("tqq9_ztbrandid", dataEntity.getPkValue());