From 07300e443a101beb0769ebe554ecb29672ec1546 Mon Sep 17 00:00:00 2001 From: pan-houxiang <2663608154@qq.com> Date: Tue, 9 Dec 2025 14:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=89=8C=E3=80=81=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=BF=9D=E5=AD=98=E5=90=8E=E6=93=8D=E4=BD=9C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E5=8F=B0id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/plugin/operate/sys/BrandSaveAfterOp.java | 13 ++++++++++++- .../app/plugin/operate/sys/SupSaveAfterOp.java | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java b/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java index 1c0be82..4ea3106 100644 --- a/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java +++ b/lc123/cloud/app/plugin/operate/sys/BrandSaveAfterOp.java @@ -3,15 +3,26 @@ package tqq9.lc123.cloud.app.plugin.operate.sys; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; +import oadd.org.apache.commons.lang3.StringUtils; /** * 单据操作插件 + * 品牌保存后设置中台品牌id */ public class BrandSaveAfterOp extends AbstractOperationServicePlugIn implements Plugin { @Override public void afterExecuteOperationTransaction(AfterOperationArgs e) { super.afterExecuteOperationTransaction(e); - + DynamicObject[] dataEntities = e.getDataEntities(); + for (DynamicObject dataEntity : dataEntities) { + String tqq9_ztsupplierid = dataEntity.getString("tqq9_ztbrandid"); + if (StringUtils.isBlank(tqq9_ztsupplierid)) { + dataEntity.set("tqq9_ztbrandid", dataEntity.getPkValue()); + SaveServiceHelper.save(new DynamicObject[]{dataEntity}); + } + } } } \ No newline at end of file diff --git a/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java b/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java index 21b32e7..f0f0815 100644 --- a/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java +++ b/lc123/cloud/app/plugin/operate/sys/SupSaveAfterOp.java @@ -1,16 +1,29 @@ package tqq9.lc123.cloud.app.plugin.operate.sys; +import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; +import oadd.org.apache.commons.lang3.StringUtils; /** * 单据操作插件 + * 供应商保存后设置中台供应商id */ public class SupSaveAfterOp extends AbstractOperationServicePlugIn implements Plugin { @Override public void afterExecuteOperationTransaction(AfterOperationArgs e) { super.afterExecuteOperationTransaction(e); + DynamicObject[] dataEntities = e.getDataEntities(); + for (DynamicObject dataEntity : dataEntities) { + 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