Commit 4bc264b8 authored by 张亚辉's avatar 张亚辉

组合基金查询

parent a51e21f8
...@@ -1010,12 +1010,12 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1010,12 +1010,12 @@ public class ProductServiceImpl implements ProductService, Constant {
// 策略集合 // 策略集合
List<FundCount> fundCounts = this.fundCountMapper.selectByExample(reqFilterResult(req)); List<FundCount> fundCounts = this.fundCountMapper.selectByExample(reqFilterResult(req));
List<String> list = fundCounts.stream().map(FundCount::getFundId).collect(Collectors.toList()); // List<String> list = fundCounts.stream().map(FundCount::getFundId).collect(Collectors.toList());
List<ProductInfoVO> vos = new ArrayList<>(); List<ProductInfoVO> vos = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(req.getFundIds())) {
vos = getProductInfoVOS(fundCounts, list, 1); vos = getProductInfoVOS(fundCounts, req.getFundIds(), 1);
} }
return vos; return vos;
...@@ -1155,9 +1155,11 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1155,9 +1155,11 @@ public class ProductServiceImpl implements ProductService, Constant {
private List<ProductInfoVO> getProductInfoVOS(List<FundCount> fundCounts, List<String> list, Integer productType) { private List<ProductInfoVO> getProductInfoVOS(List<FundCount> fundCounts, List<String> list, Integer productType) {
FundInfoExample example = new FundInfoExample(); FundInfoExample example = new FundInfoExample();
example.createCriteria().andIdIn(list).andDeleteTagEqualTo(ZERO_NUM); example.createCriteria().andIdIn(list).andDeleteTagEqualTo(ZERO_NUM);
example.setOrderByClause("create_time desc");
List<FundInfo> fundInfos = this.fundInfoMapper.selectByExample(example); List<FundInfo> fundInfos = this.fundInfoMapper.selectByExample(example);
Map<String, FundInfo> fundInfoMap = fundInfos.stream().collect(Collectors.toMap(FundInfo::getId, f -> f)); // Map<String, FundInfo> fundInfoMap = fundInfos.stream().collect(Collectors.toMap(FundInfo::getId, f -> f));
Map<String, FundCount> fundCountMap = fundCounts.stream().collect(Collectors.toMap(FundCount::getFundId, f -> f));
// 指数indexId // 指数indexId
/*List<String> ls = fundInfos.stream().filter(f -> StringUtils.isNotEmpty(f.getPrimaryBenchmarkId())) /*List<String> ls = fundInfos.stream().filter(f -> StringUtils.isNotEmpty(f.getPrimaryBenchmarkId()))
...@@ -1171,7 +1173,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1171,7 +1173,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// 查询研报信息是否有研报 // 查询研报信息是否有研报
// Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet())); // Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet()));
return fundCounts.stream().map(p -> getProductInfoVO(fundInfoMap, rateMappingMap, p, null, productType)) return fundInfos.stream().map(p -> getProductInfoVO(fundCountMap, rateMappingMap, p, null, productType))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
...@@ -1180,11 +1182,13 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1180,11 +1182,13 @@ public class ProductServiceImpl implements ProductService, Constant {
// return fundInfoCustomMapper.getFundInfoReport(ids); // return fundInfoCustomMapper.getFundInfoReport(ids);
// } // }
private ProductInfoVO getProductInfoVO(Map<String, FundInfo> fundInfoMap, Map<String, FundRateMapping> rateMappingMap, private ProductInfoVO getProductInfoVO(Map<String, FundInfo> fundCountMap, Map<String, FundRateMapping> rateMappingMap,
FundCount fundCount, FundInfo fundInfo,
Set<String> fundInfoReports, Integer productType) { Set<String> fundInfoReports, Integer productType) {
ProductInfoVO vo = new ProductInfoVO(); ProductInfoVO vo = new ProductInfoVO();
BeanUtils.copyProperties(fundCount, vo); if (fundCountMap.containsKey(fundInfo.getId())) {
BeanUtils.copyProperties(fundCount, vo);
}
vo.setProductType(productType); vo.setProductType(productType);
vo.setRet1m(multiply100(fundCount.getRet1m())); vo.setRet1m(multiply100(fundCount.getRet1m()));
vo.setRet1y(multiply100(fundCount.getRet1y())); vo.setRet1y(multiply100(fundCount.getRet1y()));
......
...@@ -10,9 +10,9 @@ management.endpoints.web.base-path = /myhealth ...@@ -10,9 +10,9 @@ management.endpoints.web.base-path = /myhealth
management.endpoint.health.enabled=true management.endpoint.health.enabled=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
spring.datasource.url=jdbc:mysql://47.101.189.151:31931/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false spring.datasource.url=jdbc:mysql://tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username=dev spring.datasource.username=tamp
spring.datasource.password=qimeng123 spring.datasource.password=@imeng123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
company.oss.prefix = https://tamp-pro.oss-cn-shanghai.aliyuncs.com/ company.oss.prefix = https://tamp-pro.oss-cn-shanghai.aliyuncs.com/
......
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