From 029ffad9aa30847d2f359b36651c8a432188d313 Mon Sep 17 00:00:00 2001 From: csx <1981897232@qq.com> Date: Wed, 21 Jan 2026 16:14:25 +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/01/21=2010?= =?UTF-8?q?=EF=BC=9A30=20=E5=86=85=E5=AE=B9:=E6=B5=81=E6=B0=B4=E7=94=9F?= =?UTF-8?q?=E5=8D=95api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/AddRecBilllConvertBOTPPlugin.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/AddRecBilllConvertBOTPPlugin.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/AddRecBilllConvertBOTPPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/AddRecBilllConvertBOTPPlugin.java new file mode 100644 index 0000000..ef56b77 --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/other/AddRecBilllConvertBOTPPlugin.java @@ -0,0 +1,44 @@ +package shkd.sys.sys.plugin.other; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.botp.plugin.AbstractConvertPlugIn; +import kd.bos.entity.botp.plugin.args.AfterFieldMappingEventArgs; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import shkd.sys.sys.utils.EmptyUtil; + +/** + * @FileName AddRecBilllConvertBOTPPlugin + * @Description + * @Author csx + * @date 2026-01-21 + **/ +public class AddRecBilllConvertBOTPPlugin extends AbstractConvertPlugIn { + + + @Override + public void afterFieldMapping(AfterFieldMappingEventArgs e) { + super.afterFieldMapping(e); + String targetEntityNumber = this.getTgtMainType().getName(); + ExtendedDataEntity[] billDataEntitys = e.getTargetExtDataEntitySet().FindByEntityKey(targetEntityNumber); + for (ExtendedDataEntity billDataEntity : billDataEntitys) { + DynamicObject targetBill = billDataEntity.getDataEntity(); + String shkd_jhkm = null; + try { + shkd_jhkm = this.getOption().getVariableValue("shkd_jhkm"); + } catch (Exception ex) { + + } + if (shkd_jhkm!=null&& !EmptyUtil.isEmpty(shkd_jhkm)){ + DynamicObject fpm_member_f7 = BusinessDataServiceHelper.loadSingle("fpm_member_f7", "id,number", new QFilter("number", QCP.equals,shkd_jhkm).toArray()); + DynamicObjectCollection entry = targetBill.getDynamicObjectCollection("entry"); + for (DynamicObject dynamicObject : entry) { + dynamicObject.set("shkd_jhkm",fpm_member_f7); + } + } + } + } +}