Browse Source

请款流程实例id问题处理

yzc 2 years ago
parent
commit
3db22e2589

+ 8 - 3
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRequestFundsServiceImpl.java

@@ -93,9 +93,14 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
         DynamicDataSourceContextHolder.push(SourceConstant.BASE);
 
         // 赋值流程实例id
-        flowExampleService.attributeAssign(records, BaseIdPo::getId, (item, flowExample) -> {
-            item.setFlowInfoId(flowExample.getId());
-        });
+        List<Long> accountRequestFundsIds = records.stream().map(AccountRequestFundsVo::getId).collect(Collectors.toList());
+        if (ObjectUtil.isNotEmpty(accountRequestFundsIds)) {
+            Map<Long, Long> arfMap = flowExampleService.mapKV(FlowExample::getBusinessId, FlowExample::getId,
+                    q -> q.in(FlowExample::getBusinessId, accountRequestFundsIds));
+            for (AccountRequestFundsVo record : records) {
+                record.setFlowInfoId(arfMap.get(record.getId()));
+            }
+        }
 
         // 查询部门id列表
         List<Long> deptIdList = records.stream()