入库单下推无合同付款申请单botp插件

This commit is contained in:
zhangzhiguo 2025-10-31 11:18:45 +08:00
parent 27f8682764
commit 97bab7d834
1 changed files with 8 additions and 6 deletions

View File

@ -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<String> 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);
}
}
//发票明细分录