From 1f3617008e5fe26bce5fb2870b28c4bd9d39f238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=B4=B5=E5=BC=BA?= Date: Fri, 15 Aug 2025 15:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E8=B4=A2=E8=B5=8E=E5=9B=9E=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convert/FinancialConvertPlugin.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 main/java/shjh/jhzj7/fi/fi/plugin/convert/FinancialConvertPlugin.java diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/convert/FinancialConvertPlugin.java b/main/java/shjh/jhzj7/fi/fi/plugin/convert/FinancialConvertPlugin.java new file mode 100644 index 0000000..f30d365 --- /dev/null +++ b/main/java/shjh/jhzj7/fi/fi/plugin/convert/FinancialConvertPlugin.java @@ -0,0 +1,69 @@ +package shjh.jhzj7.fi.fi.plugin.convert; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.dataentity.metadata.dynamicobject.DynamicProperty; +import kd.bos.dataentity.resource.ResManager; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.ExtendedDataEntitySet; +import kd.bos.entity.botp.plugin.AbstractConvertPlugIn; +import kd.bos.entity.botp.plugin.args.AfterBuildQueryParemeterEventArgs; +import kd.bos.entity.botp.plugin.args.AfterConvertEventArgs; +import kd.bos.entity.botp.runtime.ConvertConst; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; +import kd.sdk.plugin.Plugin; +import kd.tmc.cim.common.enums.RedeemWayEnum; +import kd.tmc.fbp.common.helper.TmcBotpHelper; +import kd.tmc.fbp.common.helper.TmcDataServiceHelper; +import kd.tmc.fbp.common.util.EmptyUtil; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 动态表单插件 + * 理财赎回下推收款处理 + */ +public class FinancialConvertPlugin extends AbstractConvertPlugIn implements Plugin { + + private final static Log logger = LogFactory.getLog(FinancialConvertPlugin.class); + + @Override + public void afterConvert(AfterConvertEventArgs e) { + logger.info("进入 afterConvert 方法,开始处理理财赎回单据转换逻辑..."); + + ExtendedDataEntity[] extendedDataEntities = e.getTargetExtDataEntitySet().FindByEntityKey("cas_recbill"); + for (ExtendedDataEntity billEntity : extendedDataEntities) { + // 获取单据数据包 + DynamicObject bill = billEntity.getDataEntity(); + DynamicObject yym=null; + if ("cim_redeem".equals(bill.getString("sourcebilltype"))){ + // 获取单据体数据包——【收款明细】 + DynamicObjectCollection collection = bill.getDynamicObjectCollection("entry"); + if (collection == null || collection.isEmpty()) { + logger.warn("目标单据体数据为空,跳过处理。"); + continue; + } + if (collection.size()==2){ + for (DynamicObject dynamicObject : collection) { + DynamicObject shjh_yym = dynamicObject.getDynamicObject("shjh_yym"); + if (shjh_yym!=null){ + yym=dynamicObject.getDynamicObject("shjh_yym"); + }else { + dynamicObject.set("shjh_yym",yym); + } + } + bill.set("entry",collection); + } + } + + } + logger.info("afterConvert 方法执行完毕。"); + } + +} \ No newline at end of file