Commit e938cb88 authored by etscript's avatar etscript

添加机构产品池基金净值搜索接口

parent 9b1e8af5
......@@ -20,4 +20,8 @@ public interface ProductForPcApi {
@GetMapping("/get/privatefund/newnet")
CommonResp<List<Net>> getPrivatefundNewnet(@RequestParam("list") List<String> list);
@ApiOperation("获取私有基金最新净值")
@GetMapping("/get/orgfund/newnet")
CommonResp<List<Net>> getOrgfundNewnet(@RequestParam("list") List<String> list);
}
......@@ -25,4 +25,9 @@ public class ProductForPcController implements ProductForPcApi {
public CommonResp<List<Net>> getPrivatefundNewnet(List<String> list) {
return CommonResp.success(productForPcService.getPrivatefundNewnet(list));
}
@Override
public CommonResp<List<Net>> getOrgfundNewnet(List<String> list) {
return CommonResp.success(productForPcService.getPrivatefundNewnet(list));
}
}
......@@ -46,6 +46,8 @@ public interface FundInfoCustomMapper {
*/
List<FundNav> getPrivateFundInfoNewNet(@Param("list") List<String> fundIdList);
List<FundNav> getOrgFundInfoNewNet(@Param("list") List<String> fundIdList);
@Select("select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list})")
List<FilePreviewResp> getFilePreviewUrl(@Param("list") String list);
......
......@@ -12,4 +12,7 @@ public interface ProductForPcService {
List<Net> getFundNewnet(List<String> list);
List<Net> getPrivatefundNewnet(List<String> list);
List<Net> getOrgfundNewnet(List<String> list);
}
......@@ -49,4 +49,18 @@ public class ProductForPcServiceImpl implements ProductForPcService {
}
return new ArrayList<>(0);
}
@Override
public List<Net> getOrgfundNewnet(List<String> list) {
List<FundNav> fundInfoNewNet = fundInfoCustomMapper.getOrgFundInfoNewNet(list);
if (CollectionUtils.isNotEmpty(fundInfoNewNet)) {
return fundInfoNewNet.stream().map(item -> Net.builder()
.fundId(item.getFundId())
.netDate(item.getPriceDate().getTime())
.netValue(BigDecimalUtil.toString(item.getNav(), 4))
.cumulativeNav(BigDecimalUtil.toString(item.getCumulativeNavWithdrawal(), 4))
.build()).collect(Collectors.toList());
}
return new ArrayList<>(0);
}
}
......@@ -66,4 +66,22 @@
left join ifa_imported_fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
</select>
<select id="getOrgFundInfoNewNet" parameterType="java.lang.String" resultType="com.tanpu.fund.entity.generator.FundNav">
select
res.id as id,
res.fund_id as fundId,
res.price_date as priceDate,
res.nav as nav,
res.cumulative_nav as cumulativeNav,
res.cumulative_nav_withdrawal as cumulativeNavWithdrawal,
res.ishigh_or_low as ishighOrLow,
res.tohigh_nav_ratio as tohighNavRatio
from
(SELECT fund_id, max(price_date) as price_date FROM org_fund_nav WHERE fund_id in
<foreach close=")" collection="list" item="fundId" open="(" separator=",">
#{fundId}
</foreach> GROUP by fund_id) t
left join org_fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
</select>
</mapper>
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