Commit eb99aa0e authored by zp's avatar zp

Merge remote-tracking branch 'origin/v1.2.0' into dev

parents d27b8c97 3d07337d
...@@ -172,6 +172,8 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -172,6 +172,8 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
List<String> fundIds = managerMappings.stream().map(FundManagerMapping::getFundId).distinct() List<String> fundIds = managerMappings.stream().map(FundManagerMapping::getFundId).distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
fundIds.add(id);
FundCountExample example2 = new FundCountExample(); FundCountExample example2 = new FundCountExample();
example2.createCriteria() example2.createCriteria()
.andFundIdIn(fundIds) .andFundIdIn(fundIds)
...@@ -236,14 +238,15 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -236,14 +238,15 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
vo.setInceptionDate(LongUtil.timeLong(fundInfo.getInceptionDate())); vo.setInceptionDate(LongUtil.timeLong(fundInfo.getInceptionDate()));
} }
// 设置代表基金id 其他基金信息 // 设置代表基金id 其他基金信息
getDelegateById(i.getId(), map, infoMap, fundCountMap, vo); getDelegateById(i.getId(), map, infoMap, fundCountMap, vo, isCheckSet);
} }
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private void getDelegateById(String personalId, Map<String, List<FundManagerMapping>> map, private void getDelegateById(String personalId, Map<String, List<FundManagerMapping>> map,
Map<String, FundInfo> infoMap, Map<String, FundCount> fundCountMap, FundManagerVO vo) { Map<String, FundInfo> infoMap, Map<String, FundCount> fundCountMap,
FundManagerVO vo, Set<String> isCheckSet) {
if (CollectionUtils.isNotEmpty(map.get(personalId))) { if (CollectionUtils.isNotEmpty(map.get(personalId))) {
List<FundManagerMapping> mappings = map.get(personalId); List<FundManagerMapping> mappings = map.get(personalId);
...@@ -266,6 +269,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -266,6 +269,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
vo.setFundInfoVOS(list.stream().map(l -> { vo.setFundInfoVOS(list.stream().map(l -> {
FundInfoVO infoVO = new FundInfoVO(); FundInfoVO infoVO = new FundInfoVO();
String fundId = l.getFundId(); String fundId = l.getFundId();
infoVO.setIsCheck(isCheckSet.contains(fundId) ? 1 : 0);
infoVO.setFundId(fundId); infoVO.setFundId(fundId);
if (infoMap.get(fundId) != null) { if (infoMap.get(fundId) != null) {
FundInfo fundInfo = infoMap.get(fundId); FundInfo fundInfo = infoMap.get(fundId);
......
...@@ -580,10 +580,10 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -580,10 +580,10 @@ public class ProductServiceImpl implements ProductService, Constant {
private FundCountExample getFundCountExample(NetReq req) { private FundCountExample getFundCountExample(NetReq req) {
FundCountExample example = new FundCountExample(); FundCountExample example = new FundCountExample();
FundCountExample.Criteria criteria = example.createCriteria() FundCountExample.Criteria criteria = example.createCriteria();
// .andStatusEqualTo(ONE_NUM).andDataSourcesEqualTo(ONE_NUM) // .andStatusEqualTo(ONE_NUM).andDataSourcesEqualTo(ONE_NUM)
// .andDeleteTagEqualTo(ZERO_NUM) // .andDeleteTagEqualTo(ZERO_NUM)
.andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy); // .andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy);
if (CollectionUtils.isNotEmpty(req.getList())) { if (CollectionUtils.isNotEmpty(req.getList())) {
criteria.andSubstrategyIn(req.getList().stream().map(Integer::parseInt).collect(Collectors.toList())); criteria.andSubstrategyIn(req.getList().stream().map(Integer::parseInt).collect(Collectors.toList()));
...@@ -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();
if (fundCountMap.containsKey(fundInfo.getId())) {
BeanUtils.copyProperties(fundCount, vo); 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()));
...@@ -1285,7 +1289,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1285,7 +1289,7 @@ public class ProductServiceImpl implements ProductService, Constant {
FundCountExample example = new FundCountExample(); FundCountExample example = new FundCountExample();
FundCountExample.Criteria criteria = example.createCriteria().andDataSourcesEqualTo(ONE_NUM) FundCountExample.Criteria criteria = example.createCriteria().andDataSourcesEqualTo(ONE_NUM)
// .andStatusEqualTo(ONE_NUM) // .andStatusEqualTo(ONE_NUM)
.andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy) // .andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy)
.andDeleteTagEqualTo(ZERO_NUM); .andDeleteTagEqualTo(ZERO_NUM);
if (CollectionUtils.isNotEmpty(req.getList())) { if (CollectionUtils.isNotEmpty(req.getList())) {
...@@ -1321,7 +1325,8 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1321,7 +1325,8 @@ public class ProductServiceImpl implements ProductService, Constant {
FundCountExample example = new FundCountExample(); FundCountExample example = new FundCountExample();
FundCountExample.Criteria criteria = example.createCriteria().andDataSourcesEqualTo(ONE_NUM) FundCountExample.Criteria criteria = example.createCriteria().andDataSourcesEqualTo(ONE_NUM)
// .andStatusEqualTo(ONE_NUM) // .andStatusEqualTo(ONE_NUM)
.andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy).andDeleteTagEqualTo(ZERO_NUM); // .andSubstrategyNotEqualTo(ProductEnums.FundSubStrategyEnum.COMBINATION.subStrategy)
.andDeleteTagEqualTo(ZERO_NUM);
if (!CollectionUtils.isEmpty(req.getFundIds())) { if (!CollectionUtils.isEmpty(req.getFundIds())) {
criteria.andFundIdIn(req.getFundIds()); criteria.andFundIdIn(req.getFundIds());
......
...@@ -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