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