diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/other/MaterialinbillToNoContractBotpPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/other/MaterialinbillToNoContractBotpPlugin.java index bf7d3d3..3c3c1b6 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/other/MaterialinbillToNoContractBotpPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/other/MaterialinbillToNoContractBotpPlugin.java @@ -1,5 +1,6 @@ package zcgj.zcdev.zcdev.fs.plugin.other; +import com.google.common.collect.Sets; import kd.bos.coderule.api.CodeRuleInfo; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; @@ -9,10 +10,8 @@ import kd.bos.entity.botp.plugin.args.AfterConvertEventArgs; import kd.bos.servicehelper.coderule.CodeRuleServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 入库单下推无合同付款申请单botp插件 @@ -22,7 +21,7 @@ public class MaterialinbillToNoContractBotpPlugin extends AbstractConvertPlugIn @Override public void afterConvert(AfterConvertEventArgs e) { super.afterConvert(e); - // 获取已生成的资产卡片 + // 获取已生成的对公报销单 ExtendedDataEntity[] billDataEntitys = e.getTargetExtDataEntitySet().FindByEntityKey("er_publicreimbursebill"); // 构造 ExtendedDataEntity 时需要的索引值 @@ -47,8 +46,11 @@ public class MaterialinbillToNoContractBotpPlugin extends AbstractConvertPlugIn DynamicObjectCollection expenseentryentity = dataEntity.getDynamicObjectCollection("expenseentryentity"); for (DynamicObject expenseentry : expenseentryentity) { String invoiceno = expenseentry.getString("invoiceno_entry"); + Set invoiceNos = Sets.newHashSet((Iterable)Arrays.stream(invoiceno.split(",")).collect(Collectors.toSet())); long aLong = expenseentry.getLong("id"); - expensEntryMap.put(invoiceno, aLong); + for (String invoiceNo : invoiceNos) { + expensEntryMap.put(invoiceNo, aLong); + } } //发票明细分录