Commit 1d459cdc authored by zp's avatar zp

init-config

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