Commit 490ff777 authored by zp's avatar zp

Merge branch 'dev' of 47.100.44.39:zhoupeng/tamp_fund into dev

parents b3202932 4c802a4b
...@@ -4,6 +4,7 @@ import com.tanpu.common.model.Page; ...@@ -4,6 +4,7 @@ import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable; import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.req.ProductListReq; import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.DynamicRetreatVO; import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
import com.tanpu.common.model.product.resp.ProductInfoVO; import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.common.resp.CommonResp; import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.api.model.req.NetReq; import com.tanpu.fund.api.model.req.NetReq;
...@@ -118,4 +119,12 @@ public interface ProductApi { ...@@ -118,4 +119,12 @@ public interface ProductApi {
@ApiOperation("获取私募产品") @ApiOperation("获取私募产品")
@GetMapping("/privatefund/list") @GetMapping("/privatefund/list")
CommonResp<List<ProductInfoVO>> getPrivateFundList(@ApiParam("产品id") @RequestParam("ids") List<String> ids); 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(value = "根据Id查询私有产品基本信息")
@PostMapping(value = "/privateFundInfo/simpleList", produces = {"application/json"})
CommonResp<List<FundInfoSimpleListResp>> privateSimpleList(@RequestBody List<String> idList);
} }
...@@ -147,4 +147,14 @@ public class ProductController implements ProductApi { ...@@ -147,4 +147,14 @@ public class ProductController implements ProductApi {
public CommonResp<List<ProductInfoVO>> getPrivateFundList(List<String> ids) { public CommonResp<List<ProductInfoVO>> getPrivateFundList(List<String> ids) {
return CommonResp.success(this.productService.getPrivateFundList(ids)); return CommonResp.success(this.productService.getPrivateFundList(ids));
} }
@Override
public CommonResp<List<FundInfoSimpleListResp>> simpleList(List<String> idList) {
return CommonResp.success(productService.getSimpleList(idList));
}
@Override
public CommonResp<List<FundInfoSimpleListResp>> privateSimpleList(List<String> idList) {
return CommonResp.success(productService.getPrivateSimpleList(idList));
}
} }
...@@ -4,6 +4,7 @@ import com.tanpu.common.model.Page; ...@@ -4,6 +4,7 @@ import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable; import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.req.ProductListReq; import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.DynamicRetreatVO; import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
import com.tanpu.common.model.product.resp.ProductInfoVO; import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.fund.api.model.req.NetReq; import com.tanpu.fund.api.model.req.NetReq;
import com.tanpu.fund.api.model.req.ProductInfoReq; import com.tanpu.fund.api.model.req.ProductInfoReq;
...@@ -59,4 +60,8 @@ public interface ProductService { ...@@ -59,4 +60,8 @@ public interface ProductService {
List<RiskRatingVO> getPrivateFundRiskRating(String id); List<RiskRatingVO> getPrivateFundRiskRating(String id);
List<ProductInfoVO> getPrivateFundList(List<String> ids); List<ProductInfoVO> getPrivateFundList(List<String> ids);
List<FundInfoSimpleListResp> getSimpleList(List<String> idList);
List<FundInfoSimpleListResp> getPrivateSimpleList(List<String> idList);
} }
...@@ -10,8 +10,10 @@ import com.tanpu.common.model.Page; ...@@ -10,8 +10,10 @@ import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable; import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.req.ProductListReq; import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.DynamicRetreatVO; import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
import com.tanpu.common.model.product.resp.Net; import com.tanpu.common.model.product.resp.Net;
import com.tanpu.common.model.product.resp.ProductInfoVO; import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.common.utils.BigDecimalUtil; import com.tanpu.common.utils.BigDecimalUtil;
import com.tanpu.fund.api.model.FundInfoVO; import com.tanpu.fund.api.model.FundInfoVO;
import com.tanpu.fund.api.model.req.NetReq; import com.tanpu.fund.api.model.req.NetReq;
...@@ -1411,7 +1413,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1411,7 +1413,7 @@ public class ProductServiceImpl implements ProductService, Constant {
if (CollectionUtils.isNotEmpty(fundInfoList)) { if (CollectionUtils.isNotEmpty(fundInfoList)) {
return fundInfoList.stream().map(item -> { return fundInfoList.stream().map(item -> {
IfaImportedFundCount importedFundCount = null; IfaImportedFundCount importedFundCount = null;
if (fundCountMap.containsKey(item.getId())) { if (fundCountMap != null && fundCountMap.containsKey(item.getId())) {
importedFundCount = fundCountMap.get(item.getId()); importedFundCount = fundCountMap.get(item.getId());
} }
...@@ -1431,6 +1433,36 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1431,6 +1433,36 @@ public class ProductServiceImpl implements ProductService, Constant {
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public List<FundInfoSimpleListResp> getSimpleList(List<String> idList) {
if (CollectionUtils.isEmpty(idList)) {
return Lists.newArrayListWithCapacity(0);
}
FundInfoExample example = new FundInfoExample();
example.createCriteria().andIdIn(idList);
List<FundInfo> fundInfoList = fundInfoMapper.selectByExample(example);
return fundInfoList.stream().map(fundInfo -> FundInfoSimpleListResp.builder()
.id(fundInfo.getId())
.fundName(fundInfo.getFundName())
.fundShortName(fundInfo.getFundShortName())
.build()).collect(Collectors.toList());
}
@Override
public List<FundInfoSimpleListResp> getPrivateSimpleList(List<String> idList) {
if (CollectionUtils.isEmpty(idList)) {
return Lists.newArrayListWithCapacity(0);
}
IfaImportedFundInfoExample example = new IfaImportedFundInfoExample();
example.createCriteria().andIdIn(idList);
List<IfaImportedFundInfo> ifaImportedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example);
return ifaImportedFundInfoList.stream().map(fundInfo -> FundInfoSimpleListResp.builder()
.id(fundInfo.getId())
.fundName(fundInfo.getFundName())
.fundShortName(fundInfo.getFundName())
.build())
.collect(Collectors.toList());
}
private ArrayList<TrackRecordVO> getPrivateFundTrackRecordVOS(IfaImportedFundCount fundCount) { private ArrayList<TrackRecordVO> getPrivateFundTrackRecordVOS(IfaImportedFundCount fundCount) {
return Lists.newArrayList( return Lists.newArrayList(
new TrackRecordVO("近三个月", multiply100(fundCount.getRet3m()), multiply100(fundCount.getRet3mBm1())), 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