Commit 1bf73bd6 authored by 张亚辉's avatar 张亚辉

指数

parent 7febcd23
...@@ -5,6 +5,7 @@ import com.github.pagehelper.page.PageMethod; ...@@ -5,6 +5,7 @@ import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.tanpu.common.enums.Constant; import com.tanpu.common.enums.Constant;
import com.tanpu.common.enums.product.ProductEnums;
import com.tanpu.common.model.Page; import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable; import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.FundInfoVO; import com.tanpu.common.model.product.FundInfoVO;
...@@ -12,47 +13,13 @@ import com.tanpu.common.model.product.req.ExternalReq; ...@@ -12,47 +13,13 @@ import com.tanpu.common.model.product.req.ExternalReq;
import com.tanpu.common.model.product.req.NetReq; import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq; import com.tanpu.common.model.product.req.ProductInfoReq;
import com.tanpu.common.model.product.req.ProductListReq; import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.BonusRatioVO; import com.tanpu.common.model.product.resp.*;
import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundCompanyVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
import com.tanpu.common.model.product.resp.FundManagerVO;
import com.tanpu.common.model.product.resp.FundRecordVO;
import com.tanpu.common.model.product.resp.FundSameResp;
import com.tanpu.common.model.product.resp.Net;
import com.tanpu.common.model.product.resp.NetVO;
import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.common.model.product.resp.RiskRatingVO;
import com.tanpu.common.model.product.resp.TrackNetVO;
import com.tanpu.common.model.product.resp.TrackRecordVO;
import com.tanpu.common.model.product.resp.UnitNetVO;
import com.tanpu.common.model.tanpuroom.Type; import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.utils.BigDecimalUtil; import com.tanpu.common.utils.BigDecimalUtil;
import com.tanpu.fund.entity.generator.CompanyInfo; import com.tanpu.fund.entity.generator.*;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnel;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample;
import com.tanpu.fund.entity.generator.FundCount;
import com.tanpu.fund.entity.generator.FundCountExample;
import com.tanpu.fund.entity.generator.FundDistribution;
import com.tanpu.fund.entity.generator.FundDistributionExample;
import com.tanpu.fund.entity.generator.FundInfo;
import com.tanpu.fund.entity.generator.FundInfoExample;
import com.tanpu.fund.entity.generator.FundManagerMapping;
import com.tanpu.fund.entity.generator.FundManagerMappingExample;
import com.tanpu.fund.entity.generator.PersonCompanyPositionMapping;
import com.tanpu.fund.entity.generator.PersonCompanyPositionMappingExample;
import com.tanpu.fund.entity.generator.PersonnelInfo;
import com.tanpu.fund.entity.generator.PersonnelInfoExample;
import com.tanpu.fund.enums.ProTypeEnums; import com.tanpu.fund.enums.ProTypeEnums;
import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose; import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose;
import com.tanpu.fund.mapper.generator.CompanyInfoMapper; import com.tanpu.fund.mapper.generator.*;
import com.tanpu.fund.mapper.generator.CompanyTnaPersonnelMapper;
import com.tanpu.fund.mapper.generator.FundCountMapper;
import com.tanpu.fund.mapper.generator.FundDistributionMapper;
import com.tanpu.fund.mapper.generator.FundInfoMapper;
import com.tanpu.fund.mapper.generator.FundManagerMappingMapper;
import com.tanpu.fund.mapper.generator.PersonCompanyPositionMappingMapper;
import com.tanpu.fund.mapper.generator.PersonnelInfoMapper;
import com.tanpu.fund.service.ProductPrivateService; import com.tanpu.fund.service.ProductPrivateService;
import com.tanpu.fund.utils.LongUtil; import com.tanpu.fund.utils.LongUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -62,12 +29,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -62,12 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.tanpu.common.utils.BigDecimalUtil.multiply100; import static com.tanpu.common.utils.BigDecimalUtil.multiply100;
...@@ -260,7 +222,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -260,7 +222,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
FundInfo info = infoMap.get(fundId); FundInfo info = infoMap.get(fundId);
vo.setFundName(info.getFundShortName()); vo.setFundName(info.getFundShortName());
vo.setRatioId(info.getPrimaryBenchmarkId()); vo.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
FundCount fundCount = fundCountMap.get(fundId); FundCount fundCount = fundCountMap.get(fundId);
if (fundCount != null) { if (fundCount != null) {
vo.setRetIncep(multiply100(fundCount.getRetIncep())); vo.setRetIncep(multiply100(fundCount.getRetIncep()));
...@@ -308,7 +270,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -308,7 +270,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
if (infoMap.get(fundId) != null) { if (infoMap.get(fundId) != null) {
FundInfo fundInfo = infoMap.get(fundId); FundInfo fundInfo = infoMap.get(fundId);
infoVO.setFundName(fundInfo.getFundShortName()); infoVO.setFundName(fundInfo.getFundShortName());
infoVO.setRatioId(fundInfo.getPrimaryBenchmarkId()); infoVO.setRatioId(ProductEnums.IndexEnum.getValue(fundInfo.getPrimaryBenchmarkId()));
if (fundInfo.getInceptionDate() != null) { if (fundInfo.getInceptionDate() != null) {
infoVO.setInceptionDate(fundInfo.getInceptionDate().getTime()); infoVO.setInceptionDate(fundInfo.getInceptionDate().getTime());
} }
...@@ -430,7 +392,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -430,7 +392,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
FundInfo info = mapFundInfo.get(fundCount.getFundId()); FundInfo info = mapFundInfo.get(fundCount.getFundId());
vo.setTime(info.getRegisterDate() == null ? null : info.getRegisterDate().getTime()); vo.setTime(info.getRegisterDate() == null ? null : info.getRegisterDate().getTime());
vo.setFundId(fundCount.getFundId()); vo.setFundId(fundCount.getFundId());
vo.setRatioId(info.getPrimaryBenchmarkId()); vo.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
vo.setInceptionDate(info.getInceptionDate() == null ? null : info.getInceptionDate().getTime()); vo.setInceptionDate(info.getInceptionDate() == null ? null : info.getInceptionDate().getTime());
vo.setFundName(info.getFundShortName()); vo.setFundName(info.getFundShortName());
vo.setNet(new Net(fundCount.getEndDate().getTime(), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4))); vo.setNet(new Net(fundCount.getEndDate().getTime(), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4)));
...@@ -457,7 +419,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -457,7 +419,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
vo1.setRet1y(multiply100(f.getRet1y())); vo1.setRet1y(multiply100(f.getRet1y()));
vo1.setRatioId(info.getPrimaryBenchmarkId()); vo1.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
return vo1; return vo1;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
......
...@@ -559,7 +559,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -559,7 +559,7 @@ public class ProductServiceImpl implements ProductService, Constant {
FundInfo fundInfo = infoMap.get(f.getFundId()); FundInfo fundInfo = infoMap.get(f.getFundId());
netVO.setProductName(fundInfo.getFundShortName()); netVO.setProductName(fundInfo.getFundShortName());
netVO.setRatioId(fundInfo.getPrimaryBenchmarkId()); netVO.setRatioId(ProductEnums.IndexEnum.getValue(fundInfo.getPrimaryBenchmarkId()));
netVO.setAboutYearProfit(multiply100(f.getRet6m())); netVO.setAboutYearProfit(multiply100(f.getRet6m()));
netVO.setWeekProfit(multiply100(f.getRet1w())); netVO.setWeekProfit(multiply100(f.getRet1w()));
...@@ -691,7 +691,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -691,7 +691,7 @@ public class ProductServiceImpl implements ProductService, Constant {
if (infoMap.get(fundId) != null) { if (infoMap.get(fundId) != null) {
FundInfo fundInfo = infoMap.get(fundId); FundInfo fundInfo = infoMap.get(fundId);
infoVO.setFundName(fundInfo.getFundShortName()); infoVO.setFundName(fundInfo.getFundShortName());
infoVO.setRatioId(fundInfo.getPrimaryBenchmarkId()); infoVO.setRatioId(ProductEnums.IndexEnum.getValue(fundInfo.getPrimaryBenchmarkId()));
} }
infoVO.setRetIncep(multiply100(l.getRetIncep())); infoVO.setRetIncep(multiply100(l.getRetIncep()));
infoVO.setYearProfit(multiply100(l.getRetIncepA())); infoVO.setYearProfit(multiply100(l.getRetIncepA()));
...@@ -875,7 +875,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -875,7 +875,7 @@ public class ProductServiceImpl implements ProductService, Constant {
FundInfo info = infoMap.get(fundId); FundInfo info = infoMap.get(fundId);
vo.setFundName(info.getFundShortName()); vo.setFundName(info.getFundShortName());
vo.setRatioId(info.getPrimaryBenchmarkId()); vo.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
FundCount fundCount = fundCountMap.get(fundId); FundCount fundCount = fundCountMap.get(fundId);
if (fundCount != null) { if (fundCount != null) {
vo.setRetIncep(multiply100(fundCount.getRetIncep())); vo.setRetIncep(multiply100(fundCount.getRetIncep()));
...@@ -1067,7 +1067,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1067,7 +1067,7 @@ public class ProductServiceImpl implements ProductService, Constant {
FundInfo info = mapFundInfo.get(fundCount.getFundId()); FundInfo info = mapFundInfo.get(fundCount.getFundId());
vo.setTime(info.getRegisterDate() == null ? null : info.getRegisterDate().getTime()); vo.setTime(info.getRegisterDate() == null ? null : info.getRegisterDate().getTime());
vo.setFundId(fundCount.getFundId()); vo.setFundId(fundCount.getFundId());
vo.setRatioId(info.getPrimaryBenchmarkId()); vo.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
vo.setInceptionDate(info.getInceptionDate() == null ? null : info.getInceptionDate().getTime()); vo.setInceptionDate(info.getInceptionDate() == null ? null : info.getInceptionDate().getTime());
vo.setFundName(info.getFundShortName()); vo.setFundName(info.getFundShortName());
vo.setNet(new Net(fundCount.getEndDate().getTime(), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4))); vo.setNet(new Net(fundCount.getEndDate().getTime(), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4), BigDecimalUtil.toString(fundCount.getCumulativeNav(), 4)));
...@@ -1082,7 +1082,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1082,7 +1082,7 @@ public class ProductServiceImpl implements ProductService, Constant {
vo1.setYearProfit(yearProfit == null ? "0" : yearProfit); vo1.setYearProfit(yearProfit == null ? "0" : yearProfit);
vo1.setFundName(mapFundInfo.get(f.getFundId()).getFundShortName()); vo1.setFundName(mapFundInfo.get(f.getFundId()).getFundShortName());
vo1.setFundId(f.getFundId()); vo1.setFundId(f.getFundId());
vo1.setRatioId(info.getPrimaryBenchmarkId()); vo1.setRatioId(ProductEnums.IndexEnum.getValue(info.getPrimaryBenchmarkId()));
return vo1; return vo1;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
} }
...@@ -1192,7 +1192,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1192,7 +1192,7 @@ public class ProductServiceImpl implements ProductService, Constant {
FundInfo fundInfo = fundInfoMap.get(fundId); FundInfo fundInfo = fundInfoMap.get(fundId);
// 指数id // 指数id
vo.setRatioId(fundInfo.getPrimaryBenchmarkId()); vo.setRatioId(ProductEnums.IndexEnum.getValue(fundInfo.getPrimaryBenchmarkId()));
vo.setProductName(fundInfo.getFundShortName()); vo.setProductName(fundInfo.getFundShortName());
// getProductCode(indexIdMap, vo, fundInfo); // getProductCode(indexIdMap, vo, fundInfo);
vo.setOpenDay(fundInfo.getOpenDay()); vo.setOpenDay(fundInfo.getOpenDay());
......
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