Commit cba329f9 authored by 张亚辉's avatar 张亚辉

基金详情

parent 88db936d
...@@ -103,7 +103,7 @@ public interface ProductApi { ...@@ -103,7 +103,7 @@ public interface ProductApi {
@ApiOperation("私有基金详情") @ApiOperation("私有基金详情")
@GetMapping("/privatefund/detail") @GetMapping("/privatefund/detail")
CommonResp<PrivateFundDetailResp> getPrivateDetail(@RequestParam("id") String id); CommonResp<ProductInfoVO> getPrivateDetail(@RequestParam("id") String id);
@ApiOperation("私有基金历史业绩") @ApiOperation("私有基金历史业绩")
@GetMapping("/privatefund/historyprofit") @GetMapping("/privatefund/historyprofit")
......
...@@ -119,7 +119,7 @@ public class ProductController implements ProductApi { ...@@ -119,7 +119,7 @@ public class ProductController implements ProductApi {
} }
@Override @Override
public CommonResp<PrivateFundDetailResp> getPrivateDetail(String id) { public CommonResp<ProductInfoVO> getPrivateDetail(String id) {
if (StringUtils.isEmpty(id)) { if (StringUtils.isEmpty(id)) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE); return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
} }
......
...@@ -51,7 +51,7 @@ public interface ProductService { ...@@ -51,7 +51,7 @@ public interface ProductService {
DynamicRetreatVO getDynamicRetreat(String id); DynamicRetreatVO getDynamicRetreat(String id);
PrivateFundDetailResp getPrivateDetail(String id); ProductInfoVO getPrivateDetail(String id);
List<TrackRecordVO> getHistoryprofit(String id); List<TrackRecordVO> getHistoryprofit(String id);
......
...@@ -178,9 +178,6 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -178,9 +178,6 @@ public class ProductServiceImpl implements ProductService, Constant {
vo.setManagerName(fundManagerVO.getManagerName()); vo.setManagerName(fundManagerVO.getManagerName());
} }
//TODO zhoupeng 查询基金是否加自选 isCheck
// vo.setIsCheck();
return vo; return vo;
} }
...@@ -1333,7 +1330,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1333,7 +1330,7 @@ public class ProductServiceImpl implements ProductService, Constant {
} }
@Override @Override
public PrivateFundDetailResp getPrivateDetail(String id) { public ProductInfoVO getPrivateDetail(String id) {
IfaImportedFundInfo fundInfo = ifaImportedFundInfoMapper.selectByPrimaryKey(id); IfaImportedFundInfo fundInfo = ifaImportedFundInfoMapper.selectByPrimaryKey(id);
//查询收益率 //查询收益率
...@@ -1341,18 +1338,27 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1341,18 +1338,27 @@ public class ProductServiceImpl implements ProductService, Constant {
example.createCriteria().andFundIdEqualTo(id).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); example.createCriteria().andFundIdEqualTo(id).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundCount> fundCountList = ifaImportedFundCountMapper.selectByExample(example); List<IfaImportedFundCount> fundCountList = ifaImportedFundCountMapper.selectByExample(example);
PrivateFundDetailResp detailResp = PrivateFundDetailResp.builder() ProductInfoVO detailResp = new ProductInfoVO();
.fundId(fundInfo.getId()) detailResp.setFundId(fundInfo.getId());
.fundName(fundInfo.getFundName()) detailResp.setFundName(fundInfo.getFundName());
.registerNumber(fundInfo.getRegisterNumber()) detailResp.setProductName(fundInfo.getFundName());
.build(); detailResp.setRegisterNumber(fundInfo.getRegisterNumber());
if (CollectionUtils.isNotEmpty(fundCountList)) { if (CollectionUtils.isNotEmpty(fundCountList)) {
detailResp.setNear1YearProfit(BigDecimalUtil.toString(fundCountList.get(0).getRet1y(), 2)); detailResp.setNear1YearProfit(BigDecimalUtil.toString(fundCountList.get(0).getRet1y(), 2));
detailResp.setRet1y(BigDecimalUtil.toString(fundCountList.get(0).getRet1y(), 2));
detailResp.setNet(Net.builder().netDate(fundCountList.get(0).getPriceDate().getTime()) detailResp.setNet(Net.builder().netDate(fundCountList.get(0).getPriceDate().getTime())
.netValue(BigDecimalUtil.toString(fundCountList.get(0).getNetNav())).build()); .netValue(BigDecimalUtil.toString(fundCountList.get(0).getNetNav())).build());
} }
detailResp.setInceptionDate(fundInfo.getInceptionDate() != null ? fundInfo.getInceptionDate().getTime() : null);
List<FundManagerVO> fundManagerVOList = this.getFundManager(id);
if (CollectionUtils.isNotEmpty(fundManagerVOList)) {
FundManagerVO fundManagerVO = fundManagerVOList.get(0);
detailResp.setManagerId(fundManagerVO.getManagerId());
detailResp.setManagerName(fundManagerVO.getManagerName());
}
return detailResp; return detailResp;
} }
...@@ -1517,12 +1523,10 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1517,12 +1523,10 @@ public class ProductServiceImpl implements ProductService, Constant {
infoExample.createCriteria().andIdIn(fundIdList); infoExample.createCriteria().andIdIn(fundIdList);
Map<String, String> fundMap = fundInfoMapper.selectByExample(infoExample).stream().collect(Collectors.toMap(FundInfo::getId, FundInfo::getFundShortName)); Map<String, String> fundMap = fundInfoMapper.selectByExample(infoExample).stream().collect(Collectors.toMap(FundInfo::getId, FundInfo::getFundShortName));
//TODO zhoupeng 查询基金是否加自选 isCheck
return fundCounts.stream().map(item -> FundSameResp.builder() return fundCounts.stream().map(item -> FundSameResp.builder()
.fundId(item.getFundId()) .fundId(item.getFundId())
.fundName(fundMap.get(item.getFundId())) .fundName(fundMap.get(item.getFundId()))
.ret1y(BigDecimalUtil.toString(item.getRet1y(), 2)) .ret1y(BigDecimalUtil.toString(item.getRet1y(), 2))
// .isCheck()
.build()).collect(Collectors.toList()); .build()).collect(Collectors.toList());
} }
......
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