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

基金详情

parent cba329f9
......@@ -101,33 +101,39 @@ public interface ProductApi {
@GetMapping("/dynamic/retreat")
CommonResp<DynamicRetreatVO> getDynamicRetreatInfo(@RequestParam("id") String id);
@ApiOperation("私有基金详情")
//**********************************************************私有基金start**********************************************************
@ApiOperation("私有基金详情 - 私有基金")
@GetMapping("/privatefund/detail")
CommonResp<ProductInfoVO> getPrivateDetail(@RequestParam("id") String id);
@ApiOperation("私有基金历史业绩")
@ApiOperation("私有基金历史业绩 - 私有基金")
@GetMapping("/privatefund/historyprofit")
CommonResp<List<TrackRecordVO>> getHistoryprofit(@RequestParam("id") String id);
@ApiOperation("历史净值")
@ApiOperation("历史净值 - 私有基金")
@GetMapping("/privatefund/track/net")
CommonResp<Page<TrackNetVO>> getPrivateFundTrackNetListInfo(@ApiParam("产品id") @RequestParam("id") String id, @ApiParam("分页对象") Pageable page);
@ApiOperation("风险评估")
@ApiOperation("风险评估 - 私有基金")
@GetMapping("/privatefund/get/risk/rating")
CommonResp<List<RiskRatingVO>> getPrivateFundRiskRatingInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("获取私募产品")
@ApiOperation("获取私募产品 - 私有基金")
@GetMapping("/privatefund/list")
CommonResp<List<ProductInfoVO>> getPrivateFundList(@ApiParam("产品id") @RequestParam("ids") List<String> ids);
@ApiOperation(value = "根据Id查询私募产品基本信息")
@PostMapping(value = "/fundInfo/simpleList", produces = {"application/json"})
CommonResp<List<FundInfoSimpleListResp>> simpleList(@RequestBody List<String> idList);
@ApiOperation("推荐基金 - 私有基金")
@GetMapping("/privatefund/list")
CommonResp<List<FundSameResp>> getRemmendPrivateFundList();
@ApiOperation(value = "根据Id查询私有产品基本信息")
@ApiOperation(value = "根据Id查询私有产品基本信息 - 私有基金")
@PostMapping(value = "/privateFundInfo/simpleList", produces = {"application/json"})
CommonResp<List<FundInfoSimpleListResp>> privateSimpleList(@RequestBody List<String> idList);
//**********************************************************私有基金 end**********************************************************
@ApiOperation(value = "根据Id查询私募产品基本信息")
@PostMapping(value = "/fundInfo/simpleList", produces = {"application/json"})
CommonResp<List<FundInfoSimpleListResp>> simpleList(@RequestBody List<String> idList);
@ApiOperation("对比指数")
@GetMapping("/fund/indexes")
......
package com.tanpu.fund.controller;
import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.req.NetReq;
......@@ -155,6 +156,12 @@ public class ProductController implements ProductApi {
return CommonResp.success(this.productService.getPrivateFundList(ids));
}
@TanpuInterfaceLoginAuth
@Override
public CommonResp<List<FundSameResp>> getRemmendPrivateFundList() {
return CommonResp.success(this.productService.getRemmendPrivateFundList());
}
@Override
public CommonResp<List<FundInfoSimpleListResp>> simpleList(List<String> idList) {
return CommonResp.success(productService.getSimpleList(idList));
......
......@@ -66,4 +66,6 @@ public interface ProductService {
List<FundInfoSimpleListResp> getPrivateSimpleList(List<String> idList);
List<FundSameResp> querySamefund(String fundId);
List<FundSameResp> getRemmendPrivateFundList();
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Lists;
import com.tanpu.common.auth.UserInfoThreadLocalHolder;
import com.tanpu.common.enums.BizEnums;
import com.tanpu.common.enums.Constant;
import com.tanpu.common.model.Page;
......@@ -1347,18 +1348,11 @@ public class ProductServiceImpl implements ProductService, Constant {
if (CollectionUtils.isNotEmpty(fundCountList)) {
detailResp.setNear1YearProfit(BigDecimalUtil.toString(fundCountList.get(0).getRet1y(), 2));
detailResp.setRet1y(BigDecimalUtil.toString(fundCountList.get(0).getRet1y(), 2));
detailResp.setRetYtd(BigDecimalUtil.toString(fundCountList.get(0).getRetYtd(), 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;
}
......@@ -1533,6 +1527,41 @@ public class ProductServiceImpl implements ProductService, Constant {
return null;
}
@Override
public List<FundSameResp> getRemmendPrivateFundList() {
IfaImportedFundInfoExample example = new IfaImportedFundInfoExample();
example.createCriteria().andIfaIdEqualTo(UserInfoThreadLocalHolder.getserInfo().getId()).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundInfo> importedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example);
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedFundInfo::getId).collect(Collectors.toList());
IfaImportedFundCountExample countExample = new IfaImportedFundCountExample();
countExample.createCriteria().andFundIdIn(fundIdList).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundCount> importedFundCountList = ifaImportedFundCountMapper.selectByExample(countExample);
Map<String, IfaImportedFundCount> fundCountMap;
if (CollectionUtils.isNotEmpty(importedFundCountList)) {
fundCountMap = importedFundCountList.stream().collect(Collectors.toMap(IfaImportedFundCount::getFundId, c -> c));
} else {
fundCountMap = null;
}
importedFundInfoList.stream().map(item -> {
FundSameResp p = FundSameResp.builder()
.fundId(item.getId())
.fundName(item.getFundName())
.build();
if (fundCountMap != null && fundCountMap.containsKey(item.getId())) {
p.setRet1y(BigDecimalUtil.toString(fundCountMap.get(item.getId()).getRet1y(), 2));
}
return p;
}).collect(Collectors.toList());
return null;
}
private ArrayList<TrackRecordVO> getPrivateFundTrackRecordVOS(IfaImportedFundCount fundCount) {
return Lists.newArrayList(
new TrackRecordVO("近三个月", multiply100(fundCount.getRet3m()), multiply100(fundCount.getRet3mBm1())),
......
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