wxf пре 2 година
родитељ
комит
36fe82a188

+ 9 - 6
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRequestFundsServiceImpl.java

@@ -18,7 +18,9 @@ import com.fjhx.account.service.account.AccountRequestFundsService;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.entity.corporation.po.Corporation;
 import com.fjhx.common.service.corporation.CorporationService;
+import com.fjhx.flow.entity.flow.po.FlowExample;
 import com.fjhx.flow.entity.flow.po.FlowInfo;
+import com.fjhx.flow.service.flow.FlowExampleService;
 import com.fjhx.flow.service.flow.FlowInfoService;
 import com.obs.services.internal.ServiceException;
 import com.ruoyi.common.core.domain.BasePo;
@@ -57,7 +59,7 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
     private ISysUserService sysUserService;
 
     @Autowired
-    private FlowInfoService flowInfoService;
+    private FlowExampleService flowExampleService;
 
     /**
      * 查询请款列表
@@ -90,10 +92,10 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
         List<SysDept> sysDeptList = sysDeptService.list();
         Map<Long, List<SysDept>> sysDeptMap = sysDeptList.stream().collect(Collectors.groupingBy(SysDept::getDeptId));
 
-        //根据业务ID列表获取流程Id列表
+        //根据业务ID列表获取流程实例Id列表
         List<Long> ids = records.stream().map(AccountRequestFundsVo::getId).collect(Collectors.toList());
-        List<FlowInfo> flowInfos = flowInfoService.getFlowInfoId(ids);
-        Map<Long, List<FlowInfo>> flowInfoMap = flowInfos.stream().collect(Collectors.groupingBy(FlowInfo::getBusinessId));
+        List<FlowExample> flowExamples = flowExampleService.list(Wrappers.<FlowExample>lambdaQuery().in(FlowExample::getBusinessId, ids));
+        Map<Long, List<FlowExample>> flowInfoMap = flowExamples.stream().collect(Collectors.groupingBy(FlowExample::getBusinessId));
 
 
         for (AccountRequestFundsVo record : records) {
@@ -110,15 +112,16 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
             }
 
             //赋值流程ID
-            List<FlowInfo> flowInfoList = flowInfoMap.get(record.getId());
+            List<FlowExample> flowInfoList = flowInfoMap.get(record.getId());
             if (ObjectUtil.isEmpty(flowInfoList)){
-                throw new ServiceException("数据有误:该请款没有找到流程信息");
+                throw new ServiceException("数据有误:该请款没有找到流程详情信息信息");
             }
             record.setFlowInfoId(flowInfoList.get(0).getId());
         }
 
         // 赋值用户名称
         UserUtil.assignmentNickName(records, BasePo::getCreateUser,AccountRequestFundsVo::setUserName);
+        DynamicDataSourceContextHolder.poll();
         return page;
     }