|
|
|
@@ -64,21 +64,27 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
customerParams = queryParams.getCustomer(); |
|
|
|
demandParams = queryParams.getDemand(); |
|
|
|
} |
|
|
|
|
|
|
|
InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); |
|
|
|
|
|
|
|
LambdaQueryWrapper<InvestDemandEntity> queryWrapperDemand = new LambdaQueryWrapper<>(demandParams); |
|
|
|
InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, customerParams)); |
|
|
|
if (CollectionUtils.isEmpty(customers.getRecords())) { |
|
|
|
return investPage; |
|
|
|
List<InvestDemandEntity> demandList = demandService.list(new LambdaQueryWrapper<>(demandParams)); |
|
|
|
LambdaQueryWrapper<InvestCustomerEntity> queryWrapperCustomer = new LambdaQueryWrapper<>(customerParams); |
|
|
|
InvestPageResult<InvestCustomerEntity> customers; |
|
|
|
if (Objects.isNull(InvestUserContext.getDataUser())) { |
|
|
|
queryWrapperCustomer.in(ObjectUtils.allNotNull(params.getDemandOwner()),InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
|
} else { |
|
|
|
if(CollectionUtils.isEmpty(demandList)) { |
|
|
|
return investPage; |
|
|
|
} else { |
|
|
|
queryWrapperCustomer.in(InvestCustomerEntity::getId, getIds(demandList, InvestDemandEntity::getCustomerId)); |
|
|
|
} |
|
|
|
} |
|
|
|
queryWrapperDemand.in(InvestDemandEntity::getCustomerId, getIds(customers.getRecords(), InvestCustomerEntity::getId)); |
|
|
|
|
|
|
|
List<InvestDemandEntity> demandList = demandService.list(queryWrapperDemand); |
|
|
|
|
|
|
|
customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); |
|
|
|
List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords()); |
|
|
|
BeanUtils.copyProperties(customers, investPage); |
|
|
|
investPage.setRecords(resultList); |
|
|
|
if (CollectionUtils.isEmpty(customers.getRecords())) { |
|
|
|
return investPage; |
|
|
|
} |
|
|
|
|
|
|
|
return investPage; |
|
|
|
} |
|
|
|
|
|
|
|
|