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
98f6e80d
Commit
98f6e80d
authored
Mar 18, 2021
by
zp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 47.100.44.39:zhoupeng/tamp_fund
parents
44d6575e
e6caf7b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
271 additions
and
33 deletions
+271
-33
.factorypath
.factorypath
+206
-0
.gitignore
.gitignore
+3
-1
org.eclipse.jdt.apt.core.prefs
.settings/org.eclipse.jdt.apt.core.prefs
+4
-0
ProductServiceImpl.java
.../java/com/tanpu/fund/service/impl/ProductServiceImpl.java
+58
-32
No files found.
.factorypath
0 → 100644
View file @
98f6e80d
This diff is collapsed.
Click to expand it.
.gitignore
View file @
98f6e80d
...
...
@@ -70,7 +70,9 @@ typings/
*.iml
out
gen
.classpath
.project
.settings
# maven
target
...
...
.settings/org.eclipse.jdt.apt.core.prefs
0 → 100644
View file @
98f6e80d
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
src/main/java/com/tanpu/fund/service/impl/ProductServiceImpl.java
View file @
98f6e80d
...
...
@@ -813,17 +813,17 @@ public class ProductServiceImpl implements ProductService, Constant {
return
Lists
.
newArrayList
(
new
RiskRatingVO
(
"最近一年"
,
multiply100
(
fundCount
.
getMaxdrawdown1y
()),
multiply100
(
fundCount
.
getStddev1y
()),
multiply100
(
fundCount
.
getSharperatio1y
()),
multiply100
(
fundCount
.
getRet1y
())),
multiply100
(
fundCount
.
getStddev1y
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatio1y
()),
multiply100
(
fundCount
.
getRet1y
())),
new
RiskRatingVO
(
"最近二年"
,
multiply100
(
fundCount
.
getMaxdrawdown2y
()),
multiply100
(
fundCount
.
getStddev2y
()),
multiply100
(
fundCount
.
getSharperatio2y
()),
multiply100
(
fundCount
.
getRet2yA
())),
multiply100
(
fundCount
.
getStddev2y
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatio2y
()),
multiply100
(
fundCount
.
getRet2yA
())),
new
RiskRatingVO
(
"最近三年"
,
multiply100
(
fundCount
.
getMaxdrawdown3y
()),
multiply100
(
fundCount
.
getStddev3y
()),
multiply100
(
fundCount
.
getSharperatio3y
()),
multiply100
(
fundCount
.
getRet3yA
())),
multiply100
(
fundCount
.
getStddev3y
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatio3y
()),
multiply100
(
fundCount
.
getRet3yA
())),
new
RiskRatingVO
(
"最近四年"
,
multiply100
(
fundCount
.
getMaxdrawdown4y
()),
multiply100
(
fundCount
.
getStddev4y
()),
multiply100
(
fundCount
.
getSharperatio4y
()),
multiply100
(
fundCount
.
getRet4yA
())),
multiply100
(
fundCount
.
getStddev4y
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatio4y
()),
multiply100
(
fundCount
.
getRet4yA
())),
new
RiskRatingVO
(
"最近五年"
,
multiply100
(
fundCount
.
getMaxdrawdown5y
()),
multiply100
(
fundCount
.
getStddev5y
()),
multiply100
(
fundCount
.
getSharperatio5y
()),
multiply100
(
fundCount
.
getRet5yA
())),
multiply100
(
fundCount
.
getStddev5y
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatio5y
()),
multiply100
(
fundCount
.
getRet5yA
())),
new
RiskRatingVO
(
"成立以来"
,
multiply100
(
fundCount
.
getMaxdrawdownIncep
()),
multiply100
(
fundCount
.
getStddevIncep
()),
multiply100
(
fundCount
.
getSharperatioIncep
()),
multiply100
(
fundCount
.
getRetIncepA
())));
multiply100
(
fundCount
.
getStddevIncep
()),
BigDecimalUtil
.
toString
(
fundCount
.
getSharperatioIncep
()),
multiply100
(
fundCount
.
getRetIncepA
())));
}
@Override
...
...
@@ -878,20 +878,25 @@ public class ProductServiceImpl implements ProductService, Constant {
String
fundId
=
managerMappingList
.
get
(
0
).
getFundId
();
vo
.
setId
(
fundId
);
FundInfo
info
=
infoMap
.
get
(
fundId
);
vo
.
setFundName
(
info
.
getFundShortName
());
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
info
.
getPrimaryBenchmarkId
()));
FundCount
fundCount
=
fundCountMap
.
get
(
fundId
);
if
(
fundCount
!=
null
)
{
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setNet
(
new
Net
(
fundCount
.
getEndDate
()
==
null
?
null
:
fundCount
.
getEndDate
().
getTime
(),
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
(),
4
),
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
(),
4
)));
}
if
(
infoMap
!=
null
)
{
if
(
infoMap
.
containsKey
(
fundId
))
{
FundInfo
info
=
infoMap
.
get
(
fundId
);
vo
.
setFundName
(
info
.
getFundShortName
());
vo
.
setRatioId
(
ProductEnums
.
IndexEnum
.
getValue
(
info
.
getPrimaryBenchmarkId
()));
}
if
(
infoMap
.
get
(
fundId
)
!=
null
)
{
FundInfo
fundInfo
=
infoMap
.
get
(
fundId
);
vo
.
setTime
(
timeLong
(
fundInfo
.
getRegisterDate
()));
vo
.
setInceptionDate
(
timeLong
(
fundInfo
.
getInceptionDate
()));
FundCount
fundCount
=
fundCountMap
.
get
(
fundId
);
if
(
fundCount
!=
null
)
{
vo
.
setRetIncep
(
multiply100
(
fundCount
.
getRetIncep
()));
vo
.
setNet
(
new
Net
(
fundCount
.
getEndDate
()
==
null
?
null
:
fundCount
.
getEndDate
().
getTime
(),
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
(),
4
),
BigDecimalUtil
.
toString
(
fundCount
.
getCumulativeNav
(),
4
)));
}
if
(
infoMap
.
get
(
fundId
)
!=
null
)
{
FundInfo
fundInfo
=
infoMap
.
get
(
fundId
);
vo
.
setTime
(
timeLong
(
fundInfo
.
getRegisterDate
()));
vo
.
setInceptionDate
(
timeLong
(
fundInfo
.
getInceptionDate
()));
}
}
// 设置代表基金id 其他基金信息
getDelegateById
(
i
.
getId
(),
map
,
infoMap
,
fundCountMap
,
vo
);
...
...
@@ -1410,10 +1415,9 @@ public class ProductServiceImpl implements ProductService, Constant {
detailResp
.
setRegisterNumber
(
fundInfo
.
getRegisterNumber
());
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
.
setNear1YearProfit
(
BigDecimalUtil
.
multiply100
(
fundCountList
.
get
(
0
).
getRet1y
()));
detailResp
.
setRet1y
(
BigDecimalUtil
.
multiply100
(
fundCountList
.
get
(
0
).
getRet1y
()));
detailResp
.
setRetYtd
(
BigDecimalUtil
.
multiply100
(
fundCountList
.
get
(
0
).
getRetYtd
()));
}
//子策略名称
...
...
@@ -1474,15 +1478,37 @@ public class ProductServiceImpl implements ProductService, Constant {
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
IfaImportedFundNav:
:
getPriceDate
))),
ArrayList:
:
new
));
return
new
Page
<>(
page
,
startPage
.
getTotal
(),
fundNavs
.
stream
()
.
sorted
(
Comparator
.
comparing
(
IfaImportedFundNav:
:
getPriceDate
).
reversed
())
.
map
(
f
->
{
TrackNetVO
vo
=
new
TrackNetVO
();
vo
.
setPriceDate
(
DateUtil
.
format
(
f
.
getPriceDate
(),
DatePattern
.
NORM_DATE_PATTERN
));
vo
.
setNav
(
BigDecimalUtil
.
toString
(
f
.
getNav
(),
4
));
vo
.
setCumulativeNav
(
BigDecimalUtil
.
toString
(
f
.
getCumulativeNav
(),
4
));
return
vo
;
}).
collect
(
Collectors
.
toList
()));
//计算 日涨幅=(今日净值-前一日净值)/前一日净值
List
<
TrackNetVO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
fundNavs
.
size
();
i
++)
{
IfaImportedFundNav
f
=
fundNavs
.
get
(
i
);
TrackNetVO
vo
=
new
TrackNetVO
();
vo
.
setDailyIncrease
(
"0.00"
);
//日涨幅
{
if
(
i
<
fundNavs
.
size
()
-
1
)
{
IfaImportedFundNav
pre
=
fundNavs
.
get
(
i
+
1
);
if
(
pre
.
getNav
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
BigDecimal
dailyIncrease
=
f
.
getNav
().
subtract
(
pre
.
getNav
()).
divide
(
pre
.
getNav
(),
4
,
BigDecimal
.
ROUND_HALF_UP
);
vo
.
setDailyIncrease
(
BigDecimalUtil
.
multiply100
(
dailyIncrease
));
}
}
}
vo
.
setPriceDate
(
DateUtil
.
format
(
f
.
getPriceDate
(),
DatePattern
.
NORM_DATE_PATTERN
));
vo
.
setNav
(
BigDecimalUtil
.
toString
(
f
.
getNav
(),
4
));
vo
.
setCumulativeNav
(
BigDecimalUtil
.
toString
(
f
.
getCumulativeNav
(),
4
));
vo
.
setCumulativeNavWithdrawal
(
BigDecimalUtil
.
toString
(
f
.
getCumulativeNav
(),
4
));
list
.
add
(
vo
);
}
if
(
list
.
size
()
>
page
.
getPageSize
())
{
//移除最后一条
list
.
remove
(
list
.
size
()
-
1
);
}
return
new
Page
<>(
page
,
startPage
.
getTotal
(),
list
);
}
@Override
...
...
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