Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_fund
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周鹏
tamp_fund
Commits
c7b8ac61
Commit
c7b8ac61
authored
Mar 04, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into dev
parents
1cbffca9
9c532829
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
22 deletions
+56
-22
FundInfoCustomMapper.java
...pu/fund/mapper/generator/custom/FundInfoCustomMapper.java
+8
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+37
-22
FundInfoCustomMapper.xml
...main/resources/mybatis/customize/FundInfoCustomMapper.xml
+11
-0
No files found.
src/main/java/com/tanpu/fund/mapper/generator/custom/FundInfoCustomMapper.java
View file @
c7b8ac61
...
...
@@ -29,6 +29,14 @@ public interface FundInfoCustomMapper {
List
<
FundNav
>
getFundInfoLastNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
/**
* 获取基金最新净值
*
* @param fundIdList
* @return
*/
List
<
FundNav
>
getFundInfoNewNet
(
@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
);
}
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
c7b8ac61
...
...
@@ -1174,7 +1174,18 @@ public class ProductServiceImpl implements ProductService, Constant {
// 查询研报信息是否有研报
// Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet()));
return
fundInfos
.
stream
().
map
(
p
->
getProductInfoVO
(
fundCountMap
,
rateMappingMap
,
p
,
null
,
productType
))
//查询净值
Map
<
String
,
FundNav
>
fundNavMap
;
{
List
<
FundNav
>
navList
=
fundInfoCustomMapper
.
getFundInfoNewNet
(
list
);
if
(
CollectionUtils
.
isNotEmpty
(
navList
))
{
fundNavMap
=
navList
.
stream
().
collect
(
Collectors
.
toMap
(
FundNav:
:
getFundId
,
c
->
c
));
}
else
{
fundNavMap
=
null
;
}
}
return
fundInfos
.
stream
().
map
(
p
->
getProductInfoVO
(
fundCountMap
,
rateMappingMap
,
p
,
null
,
productType
,
fundNavMap
))
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -1183,45 +1194,49 @@ public class ProductServiceImpl implements ProductService, Constant {
// return fundInfoCustomMapper.getFundInfoReport(ids);
// }
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
Fund
Info
>
fundCountMap
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
private
ProductInfoVO
getProductInfoVO
(
Map
<
String
,
Fund
Count
>
fundCountMap
,
Map
<
String
,
FundRateMapping
>
rateMappingMap
,
FundInfo
fundInfo
,
Set
<
String
>
fundInfoReports
,
Integer
productType
)
{
Set
<
String
>
fundInfoReports
,
Integer
productType
,
Map
<
String
,
FundNav
>
fundNavMap
)
{
ProductInfoVO
vo
=
new
ProductInfoVO
();
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
FundCount
fundCount
=
fundCountMap
.
get
(
fundInfo
.
getId
());
BeanUtils
.
copyProperties
(
fundCount
,
vo
);
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
vo
.
setRet1y
(
multiply100
(
fundCount
.
getRet1y
()));
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
}
vo
.
setProductType
(
productType
);
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
vo
.
setRet1y
(
multiply100
(
fundCount
.
getRet1y
()));
String
fundId
=
fundCount
.
getFundId
();
String
fundId
=
fundInfo
.
getId
();
vo
.
setFundId
(
fundId
);
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setCumulativeProfit
(
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
()));
if
(
fundInfoMap
.
get
(
fundId
)
!=
null
)
{
FundInfo
fundInfo
=
fundInfoMap
.
get
(
fundId
);
// 指数id
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
fundInfo
.
getPrimaryBenchmarkId
()));
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
// getProductCode(indexIdMap, vo, fundInfo);
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
// 指数id
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
fundInfo
.
getPrimaryBenchmarkId
()));
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
// getProductCode(indexIdMap, vo, fundInfo);
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
// 风险等级
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
}
// 风险等级
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
if
(
fundInfoReports
!=
null
&&
fundInfoReports
.
contains
(
fundId
))
{
vo
.
setIsReport
(
1
);
}
else
{
vo
.
setIsReport
(
0
);
}
vo
.
setIsAppoint
(
fund
Count
.
getType
());
vo
.
setIsAppoint
(
fund
Info
.
getType
());
// 最新净值
vo
.
setNet
(
new
Net
(
fundCount
.
getEndDate
().
getTime
(),
BigDecimalUtil
.
toString
(
fundCount
.
getNetNav
(),
4
),
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
(),
4
)));
if
(
fundNavMap
.
containsKey
(
fundId
))
{
FundNav
fundNav
=
fundNavMap
.
get
(
fundId
);
vo
.
setNet
(
new
Net
(
fundNav
.
getPriceDate
().
getTime
(),
BigDecimalUtil
.
toString
(
fundNav
.
getNav
(),
4
),
BigDecimalUtil
.
toString
(
fundNav
.
getCumulativeNavWithdrawal
(),
4
)));
}
getMinInvestmentShare
(
rateMappingMap
,
fund
Count
.
getFund
Id
(),
vo
);
getMinInvestmentShare
(
rateMappingMap
,
fund
Info
.
get
Id
(),
vo
);
return
vo
;
}
...
...
src/main/resources/mybatis/customize/FundInfoCustomMapper.xml
View file @
c7b8ac61
...
...
@@ -30,4 +30,15 @@
AND delete_tag = 0
</select>
<select
id=
"getFundInfoNewNet"
parameterType=
"java.lang.String"
resultType=
"com.tanpu.fund.entity.generator.FundNav"
>
select res.* from
(SELECT * FROM tamp_product.fund_nav WHERE fund_id in
<foreach
close=
")"
collection=
"list"
item=
"fundId"
open=
"("
separator=
","
>
#{fundId}
</foreach>
order BY price_date desc) res
GROUP BY res.fund_id;
AND delete_tag = 0
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment