Commit f354a8ea authored by 张亚辉's avatar 张亚辉

无净值基金推荐

parent cf692241
......@@ -1677,32 +1677,35 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 10);
List<IfaImportedFundInfo> importedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example);
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedFundInfo::getId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(importedFundInfoList)) {
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedFundInfo::getId).collect(Collectors.toList());
IfaImportedFundCountExample countExample = new IfaImportedFundCountExample();
countExample.createCriteria().andFundIdIn(fundIdList).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundCount> importedFundCountList = ifaImportedFundCountMapper.selectByExample(countExample);
IfaImportedFundCountExample countExample = new IfaImportedFundCountExample();
countExample.createCriteria().andFundIdIn(fundIdList).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundCount> importedFundCountList = ifaImportedFundCountMapper.selectByExample(countExample);
Map<String, IfaImportedFundCount> fundCountMap;
if (CollectionUtils.isNotEmpty(importedFundCountList)) {
fundCountMap = importedFundCountList.stream().collect(Collectors.toMap(IfaImportedFundCount::getFundId, c -> c));
} else {
fundCountMap = null;
}
Map<String, IfaImportedFundCount> fundCountMap;
if (CollectionUtils.isNotEmpty(importedFundCountList)) {
fundCountMap = importedFundCountList.stream().collect(Collectors.toMap(IfaImportedFundCount::getFundId, c -> c));
} else {
fundCountMap = null;
}
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
importedFundInfoList.forEach(item -> {
FundSameResp p = FundSameResp.builder()
.fundId(item.getId())
.fundName(item.getFundName())
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.build();
return importedFundInfoList.stream().map(item -> {
FundSameResp p = FundSameResp.builder()
.fundId(item.getId())
.fundName(item.getFundName())
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.build();
if (fundCountMap != null && fundCountMap.containsKey(item.getId())) {
p.setRet1y(BigDecimalUtil.toString(fundCountMap.get(item.getId()).getRet1y(), 2));
}
});
if (fundCountMap != null && fundCountMap.containsKey(item.getId())) {
p.setRet1y(BigDecimalUtil.toString(fundCountMap.get(item.getId()).getRet1y(), 2));
}
return p;
}).collect(Collectors.toList());
}
return new ArrayList<>(0);
}
......@@ -2415,16 +2418,16 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 10);
List<IfaImportedNonavFund> importedFundInfoList = ifaImportedNonavFundMapper.selectByExample(example);
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedNonavFund::getId).collect(Collectors.toList());
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
if (CollectionUtils.isNotEmpty(importedFundInfoList)) {
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedNonavFund::getId).collect(Collectors.toList());
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
importedFundInfoList.forEach(item -> {
FundSameResp p = FundSameResp.builder()
.fundId(item.getId())
.fundName(item.getFundName())
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.build();
});
return importedFundInfoList.stream().map(item -> FundSameResp.builder()
.fundId(item.getId())
.fundName(item.getFundName())
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.build()).collect(Collectors.toList());
}
return new ArrayList<>(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment