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

基金详情

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