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

无净值基金推荐

parent cf692241
...@@ -1677,32 +1677,35 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1677,32 +1677,35 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 10); PageMethod.startPage(1, 10);
List<IfaImportedFundInfo> importedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example); 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(); IfaImportedFundCountExample countExample = new IfaImportedFundCountExample();
countExample.createCriteria().andFundIdIn(fundIdList).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); countExample.createCriteria().andFundIdIn(fundIdList).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundCount> importedFundCountList = ifaImportedFundCountMapper.selectByExample(countExample); List<IfaImportedFundCount> importedFundCountList = ifaImportedFundCountMapper.selectByExample(countExample);
Map<String, IfaImportedFundCount> fundCountMap; Map<String, IfaImportedFundCount> fundCountMap;
if (CollectionUtils.isNotEmpty(importedFundCountList)) { if (CollectionUtils.isNotEmpty(importedFundCountList)) {
fundCountMap = importedFundCountList.stream().collect(Collectors.toMap(IfaImportedFundCount::getFundId, c -> c)); fundCountMap = importedFundCountList.stream().collect(Collectors.toMap(IfaImportedFundCount::getFundId, c -> c));
} else { } else {
fundCountMap = null; fundCountMap = null;
} }
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes(); List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
importedFundInfoList.forEach(item -> { return importedFundInfoList.stream().map(item -> {
FundSameResp p = FundSameResp.builder() FundSameResp p = FundSameResp.builder()
.fundId(item.getId()) .fundId(item.getId())
.fundName(item.getFundName()) .fundName(item.getFundName())
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0) .isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.build(); .build();
if (fundCountMap != null && fundCountMap.containsKey(item.getId())) { if (fundCountMap != null && fundCountMap.containsKey(item.getId())) {
p.setRet1y(BigDecimalUtil.toString(fundCountMap.get(item.getId()).getRet1y(), 2)); p.setRet1y(BigDecimalUtil.toString(fundCountMap.get(item.getId()).getRet1y(), 2));
} }
}); return p;
}).collect(Collectors.toList());
}
return new ArrayList<>(0); return new ArrayList<>(0);
} }
...@@ -2415,16 +2418,16 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -2415,16 +2418,16 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 10); PageMethod.startPage(1, 10);
List<IfaImportedNonavFund> importedFundInfoList = ifaImportedNonavFundMapper.selectByExample(example); List<IfaImportedNonavFund> importedFundInfoList = ifaImportedNonavFundMapper.selectByExample(example);
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedNonavFund::getId).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(importedFundInfoList)) {
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes(); List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedNonavFund::getId).collect(Collectors.toList());
List<String> checkFundIdList = feignClientForDiagnose.getFundCollectInfo(fundIdList).getAttributes();
importedFundInfoList.forEach(item -> { return importedFundInfoList.stream().map(item -> FundSameResp.builder()
FundSameResp p = FundSameResp.builder() .fundId(item.getId())
.fundId(item.getId()) .fundName(item.getFundName())
.fundName(item.getFundName()) .isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0)
.isCheck(CollectionUtils.isNotEmpty(checkFundIdList) ? (checkFundIdList.contains(item.getId()) ? 1 : 0) : 0) .build()).collect(Collectors.toList());
.build(); }
});
return new ArrayList<>(0); 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