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
9c532829
Commit
9c532829
authored
Mar 04, 2021
by
张亚辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私募
parent
4bc264b8
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 @
9c532829
...
@@ -29,6 +29,14 @@ public interface FundInfoCustomMapper {
...
@@ -29,6 +29,14 @@ public interface FundInfoCustomMapper {
List
<
FundNav
>
getFundInfoLastNet
(
@Param
(
"list"
)
List
<
String
>
fundIdList
);
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})"
)
@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
);
List
<
FilePreviewResp
>
getFilePreviewUrl
(
@Param
(
"list"
)
String
list
);
}
}
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
9c532829
...
@@ -1173,7 +1173,18 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1173,7 +1173,18 @@ public class ProductServiceImpl implements ProductService, Constant {
// 查询研报信息是否有研报
// 查询研报信息是否有研报
// Map<String, Object> fundInfoReport = getFundReport(Lists.newArrayList(fundInfoMap.keySet()));
// 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
());
.
collect
(
Collectors
.
toList
());
}
}
...
@@ -1182,45 +1193,49 @@ public class ProductServiceImpl implements ProductService, Constant {
...
@@ -1182,45 +1193,49 @@ public class ProductServiceImpl implements ProductService, Constant {
// return fundInfoCustomMapper.getFundInfoReport(ids);
// 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
,
FundInfo
fundInfo
,
Set
<
String
>
fundInfoReports
,
Integer
productType
)
{
Set
<
String
>
fundInfoReports
,
Integer
productType
,
Map
<
String
,
FundNav
>
fundNavMap
)
{
ProductInfoVO
vo
=
new
ProductInfoVO
();
ProductInfoVO
vo
=
new
ProductInfoVO
();
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
if
(
fundCountMap
.
containsKey
(
fundInfo
.
getId
()))
{
FundCount
fundCount
=
fundCountMap
.
get
(
fundInfo
.
getId
());
BeanUtils
.
copyProperties
(
fundCount
,
vo
);
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
.
setProductType
(
productType
);
vo
.
setRet1m
(
multiply100
(
fundCount
.
getRet1m
()));
String
fundId
=
fundInfo
.
getId
();
vo
.
setRet1y
(
multiply100
(
fundCount
.
getRet1y
()));
String
fundId
=
fundCount
.
getFundId
();
vo
.
setFundId
(
fundId
);
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
// 指数id
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
fundInfo
.
getPrimaryBenchmarkId
()));
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
fundInfo
.
getPrimaryBenchmarkId
()));
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
vo
.
setProductName
(
fundInfo
.
getFundShortName
());
// getProductCode(indexIdMap, vo, fundInfo);
// getProductCode(indexIdMap, vo, fundInfo);
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setOpenDay
(
fundInfo
.
getOpenDay
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
vo
.
setDesc
(
fundInfo
.
getDescInfo
());
// 风险等级
// 风险等级
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
vo
.
setRiskLevel
(
fundInfo
.
getRiskLevel
());
}
if
(
fundInfoReports
!=
null
&&
fundInfoReports
.
contains
(
fundId
))
{
if
(
fundInfoReports
!=
null
&&
fundInfoReports
.
contains
(
fundId
))
{
vo
.
setIsReport
(
1
);
vo
.
setIsReport
(
1
);
}
else
{
}
else
{
vo
.
setIsReport
(
0
);
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
;
return
vo
;
}
}
...
...
src/main/resources/mybatis/customize/FundInfoCustomMapper.xml
View file @
9c532829
...
@@ -30,4 +30,15 @@
...
@@ -30,4 +30,15 @@
AND delete_tag = 0
AND delete_tag = 0
</select>
</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>
</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