|
@@ -18,6 +18,8 @@ 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.FlowInfo;
|
|
|
+import com.fjhx.flow.service.flow.FlowInfoService;
|
|
|
import com.obs.services.internal.ServiceException;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
@@ -54,6 +56,9 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FlowInfoService flowInfoService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询请款列表
|
|
|
* @param dto
|
|
@@ -68,6 +73,8 @@ public class AccountRequestFundsServiceImpl extends ServiceImpl<AccountRequestFu
|
|
|
wrapper.like(ObjectUtil.isNotEmpty(dto.getKeyword()),"arf.payment_remarks",dto.getKeyword());
|
|
|
wrapper.orderByDesc("ap.status","arf.payment_time","arf.create_time");
|
|
|
Page<AccountRequestFundsVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ //赋值部门名称、归属公司名称
|
|
|
+ List<AccountRequestFundsVo> records = page.getRecords();
|
|
|
|
|
|
//切换数据源
|
|
|
DynamicDataSourceContextHolder.push(SourceConstant.COMMON);
|
|
@@ -83,24 +90,35 @@ 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列表
|
|
|
+ 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<AccountRequestFundsVo> records = page.getRecords();
|
|
|
for (AccountRequestFundsVo record : records) {
|
|
|
+ //赋值部门信息
|
|
|
List<SysDept> sysDepts = sysDeptMap.get(record.getDepartmentId());
|
|
|
if (ObjectUtil.isNotEmpty(sysDepts)){
|
|
|
record.setDeptName(sysDepts.get(0).getDeptName());
|
|
|
}
|
|
|
+
|
|
|
+ //赋值公司信息
|
|
|
List<Corporation> corporations = corporationMap.get(record.getCorporationId());
|
|
|
if (ObjectUtil.isNotEmpty(corporations)){
|
|
|
record.setCorporationName(corporations.get(0).getName());
|
|
|
}
|
|
|
|
|
|
+ //赋值流程ID
|
|
|
+ List<FlowInfo> flowInfoList = flowInfoMap.get(record.getId());
|
|
|
+ if (ObjectUtil.isEmpty(flowInfoList)){
|
|
|
+ throw new ServiceException("数据有误:该请款没有找到流程信息");
|
|
|
+ }
|
|
|
+ record.setFlowInfoId(flowInfoList.get(0).getId());
|
|
|
}
|
|
|
|
|
|
// 赋值用户名称
|
|
|
UserUtil.assignmentNickName(records, BasePo::getCreateUser,AccountRequestFundsVo::setUserName);
|
|
|
-
|
|
|
return page;
|
|
|
}
|
|
|
|