Commit 1d459cdc authored by zp's avatar zp

init-config

parent 2c67fc51
...@@ -76,7 +76,7 @@ target ...@@ -76,7 +76,7 @@ target
.classpath .classpath
.factorypath .factorypath
.project .project
.settings .settings/
.vscode/ .vscode/
src/main/java/pm/Generator.java src/main/java/pm/Generator.java
......
...@@ -31,10 +31,8 @@ import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose; ...@@ -31,10 +31,8 @@ import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose;
import com.tanpu.fund.feign.user.FeignClientForFatools; import com.tanpu.fund.feign.user.FeignClientForFatools;
import com.tanpu.fund.mapper.generator.*; import com.tanpu.fund.mapper.generator.*;
import com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper; import com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper;
import com.tanpu.fund.service.ProductCommonService;
import com.tanpu.fund.service.ProductService; import com.tanpu.fund.service.ProductService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.list.TreeList;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.validator.routines.BigDecimalValidator; import org.apache.commons.validator.routines.BigDecimalValidator;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
...@@ -111,9 +109,6 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -111,9 +109,6 @@ public class ProductServiceImpl implements ProductService, Constant {
@Resource @Resource
private IfaImportedFundNavMapper ifaImportedFundNavMapper; private IfaImportedFundNavMapper ifaImportedFundNavMapper;
@Resource
private ProductCommonService productCommonService;
@Resource @Resource
private FeignClientForFatools fatools; private FeignClientForFatools fatools;
...@@ -133,7 +128,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -133,7 +128,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List<ProductInfoVO> vos = new ArrayList<>(); List<ProductInfoVO> vos = new ArrayList<>();
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
vos = getProductInfoVOS(fundCounts, list, 1); vos = getProductInfoVOS(fundCounts, list);
} }
return new Page<>(req.getPage(), page.getTotal(), vos); return new Page<>(req.getPage(), page.getTotal(), vos);
...@@ -158,7 +153,6 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -158,7 +153,6 @@ public class ProductServiceImpl implements ProductService, Constant {
vo.setProductName(fundInfo.getFundShortName()); vo.setProductName(fundInfo.getFundShortName());
vo.setDesc(fundInfo.getDescInfo()); vo.setDesc(fundInfo.getDescInfo());
List<String> ls = Lists.newArrayList(fundInfo.getPrimaryBenchmarkId());
/*// 产品编码 /*// 产品编码
Map<String, List<IndexesProfile>> indexIdMap = getIndexIdMap(ls); Map<String, List<IndexesProfile>> indexIdMap = getIndexIdMap(ls);
getProductCode(indexIdMap, vo, fundInfo);*/ getProductCode(indexIdMap, vo, fundInfo);*/
...@@ -220,10 +214,10 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -220,10 +214,10 @@ public class ProductServiceImpl implements ProductService, Constant {
if (vo.getSubstrategy() != null) { if (vo.getSubstrategy() != null) {
CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup()); CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
if (listCommonResp.isSuccess()) { if (listCommonResp.isSuccess()) {
SysConstantResp sysConstantResp = listCommonResp.getAttributes().stream().filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode())).findFirst().orElse(null); listCommonResp.getAttributes().stream()
if (sysConstantResp != null) { .filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
vo.setStrategyName(sysConstantResp.getConstantName()); .findFirst()
} .ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName()));
} }
} }
...@@ -793,7 +787,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -793,7 +787,7 @@ public class ProductServiceImpl implements ProductService, Constant {
if (i < fundNavs.size() - 1) { if (i < fundNavs.size() - 1) {
FundNav pre = fundNavs.get(i + 1); FundNav pre = fundNavs.get(i + 1);
if (pre.getNav().compareTo(BigDecimal.ZERO) == 1) { if (pre.getNav().compareTo(BigDecimal.ZERO) > 0) {
BigDecimal dailyIncrease = f.getNav().subtract(pre.getNav()).divide(pre.getNav(), 4, BigDecimal.ROUND_HALF_UP); BigDecimal dailyIncrease = f.getNav().subtract(pre.getNav()).divide(pre.getNav(), 4, BigDecimal.ROUND_HALF_UP);
vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease)); vo.setDailyIncrease(BigDecimalUtil.multiply100(dailyIncrease));
} }
...@@ -1030,7 +1024,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1030,7 +1024,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List<ProductInfoVO> vos = new ArrayList<>(); List<ProductInfoVO> vos = new ArrayList<>();
if (CollectionUtils.isNotEmpty(req.getFundIds())) { if (CollectionUtils.isNotEmpty(req.getFundIds())) {
vos = getProductInfoVOS(fundCounts, req.getFundIds(), 1); vos = getProductInfoVOS(fundCounts, req.getFundIds());
} }
return vos; return vos;
...@@ -1167,7 +1161,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1167,7 +1161,7 @@ public class ProductServiceImpl implements ProductService, Constant {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
private List<ProductInfoVO> getProductInfoVOS(List<FundCount> fundCounts, List<String> list, Integer productType) { private List<ProductInfoVO> getProductInfoVOS(List<FundCount> fundCounts, List<String> list) {
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"); example.setOrderByClause("create_time desc");
...@@ -1199,7 +1193,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1199,7 +1193,7 @@ public class ProductServiceImpl implements ProductService, Constant {
} }
} }
return fundInfos.stream().map(p -> getProductInfoVO(fundCountMap, rateMappingMap, p, null, productType, fundNavMap)) return fundInfos.stream().map(p -> getProductInfoVO(fundCountMap, rateMappingMap, p, fundNavMap))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
...@@ -1210,7 +1204,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1210,7 +1204,7 @@ public class ProductServiceImpl implements ProductService, Constant {
private ProductInfoVO getProductInfoVO(Map<String, FundCount> fundCountMap, Map<String, FundRateMapping> rateMappingMap, private ProductInfoVO getProductInfoVO(Map<String, FundCount> fundCountMap, Map<String, FundRateMapping> rateMappingMap,
FundInfo fundInfo, FundInfo fundInfo,
Set<String> fundInfoReports, Integer productType, Map<String, FundNav> fundNavMap) { Map<String, FundNav> fundNavMap) {
ProductInfoVO vo = new ProductInfoVO(); ProductInfoVO vo = new ProductInfoVO();
if (fundCountMap.containsKey(fundInfo.getId())) { if (fundCountMap.containsKey(fundInfo.getId())) {
FundCount fundCount = fundCountMap.get(fundInfo.getId()); FundCount fundCount = fundCountMap.get(fundInfo.getId());
...@@ -1221,7 +1215,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1221,7 +1215,7 @@ public class ProductServiceImpl implements ProductService, Constant {
vo.setRetIncep(multiply100(fundCount.getRetIncep())); vo.setRetIncep(multiply100(fundCount.getRetIncep()));
vo.setCumulativeProfit(BigDecimalUtil.toString(fundCount.getCumulativeNav())); vo.setCumulativeProfit(BigDecimalUtil.toString(fundCount.getCumulativeNav()));
} }
vo.setProductType(productType); vo.setProductType(1);
String fundId = fundInfo.getId(); String fundId = fundInfo.getId();
vo.setFundId(fundId); vo.setFundId(fundId);
...@@ -1235,11 +1229,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1235,11 +1229,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// 风险等级 // 风险等级
vo.setRiskLevel(fundInfo.getRiskLevel()); vo.setRiskLevel(fundInfo.getRiskLevel());
if (fundInfoReports != null && fundInfoReports.contains(fundId)) { vo.setIsReport(0);
vo.setIsReport(1);
} else {
vo.setIsReport(0);
}
vo.setIsAppoint(fundInfo.getType()); vo.setIsAppoint(fundInfo.getType());
// 最新净值 // 最新净值
...@@ -1434,10 +1424,10 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1434,10 +1424,10 @@ public class ProductServiceImpl implements ProductService, Constant {
if (detailResp.getSubstrategy() != null) { if (detailResp.getSubstrategy() != null) {
CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup()); CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
if (listCommonResp.isSuccess()) { if (listCommonResp.isSuccess()) {
SysConstantResp sysConstantResp = listCommonResp.getAttributes().stream().filter(item -> StringUtils.equals(String.valueOf(detailResp.getSubstrategy()), item.getConstantCode())).findFirst().orElse(null); listCommonResp.getAttributes().stream()
if (sysConstantResp != null) { .filter(item -> StringUtils.equals(String.valueOf(detailResp.getSubstrategy()), item.getConstantCode())).
detailResp.setStrategyName(sysConstantResp.getConstantName()); findFirst()
} .ifPresent(sysConstantResp -> detailResp.setStrategyName(sysConstantResp.getConstantName()));
} }
} }
......
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