Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
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
彭熊
fund_report
Commits
d7ad5ea2
Commit
d7ad5ea2
authored
Dec 25, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改净值数据%,模板修改去掉logo
parent
bc46305a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
122 deletions
+122
-122
result_service_v2.py
app/service/result_service_v2.py
+7
-7
monthReportV2.1.html
app/templates/v2/monthReportV2.1.html
+112
-114
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+3
-1
No files found.
app/service/result_service_v2.py
View file @
d7ad5ea2
...
...
@@ -372,16 +372,16 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
fund_basic_info
=
{
"fund_name"
:
row
[
"fund_name"
],
"confirm_nav"
:
round
(
row
[
"nav"
],
4
)}
fund_basic_info
[
"cur_nav"
]
=
round
(
float
(
self
.
fund_nav_total
[
cur_fund_id
]
.
dropna
()
.
values
[
-
1
]),
4
)
fund_basic_info
[
"cur_cnav"
]
=
round
(
float
(
self
.
fund_cnav_total
[
cur_fund_id
]
.
dropna
()
.
values
[
-
1
]),
4
)
fund_basic_info
[
"ret_1w"
]
=
round
(
cur_fund_info_series
[
"ret_1w"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_1w"
]
is
not
None
else
"-"
# 上周
fund_basic_info
[
"ret_cum_1m"
]
=
round
(
cur_fund_info_series
[
"ret_cum_1m"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_cum_1m"
]
is
not
None
else
"-"
# 最近一个月
fund_basic_info
[
"ret_cum_6m"
]
=
round
(
cur_fund_info_series
[
"ret_cum_6m"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_cum_6m"
]
is
not
None
else
"-"
# 最近半年
fund_basic_info
[
"ret_cum_1y"
]
=
round
(
cur_fund_info_series
[
"ret_cum_1y"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_cum_1y"
]
is
not
None
else
"-"
# 最近一年
fund_basic_info
[
"ret_cum_ytd"
]
=
round
(
cur_fund_info_series
[
"ret_cum_ytd"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_cum_ytd"
]
is
not
None
else
"-"
# 今年以来
fund_basic_info
[
"ret_cum_incep"
]
=
round
(
cur_fund_info_series
[
"ret_cum_incep"
]
*
100
,
2
)
if
cur_fund_info_series
[
"ret_cum_incep"
]
is
not
None
else
"-"
# 成立以来
fund_basic_info
[
"ret_1w"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_1w"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_1w"
]
is
not
None
else
"-"
# 上周
fund_basic_info
[
"ret_cum_1m"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_cum_1m"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_cum_1m"
]
is
not
None
else
"-"
# 最近一个月
fund_basic_info
[
"ret_cum_6m"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_cum_6m"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_cum_6m"
]
is
not
None
else
"-"
# 最近半年
fund_basic_info
[
"ret_cum_1y"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_cum_1y"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_cum_1y"
]
is
not
None
else
"-"
# 最近一年
fund_basic_info
[
"ret_cum_ytd"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_cum_ytd"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_cum_ytd"
]
is
not
None
else
"-"
# 今年以来
fund_basic_info
[
"ret_cum_incep"
]
=
str
(
round
(
cur_fund_info_series
[
"ret_cum_incep"
]
*
100
,
2
))
+
"
%
"
if
cur_fund_info_series
[
"ret_cum_incep"
]
is
not
None
else
"-"
# 成立以来
# 申购以来
confirm_date
=
pd
.
to_datetime
(
row
[
"confirm_share_date"
])
confirm_cnav
=
float
(
p_result_cnav_data
.
loc
[
confirm_date
,
cur_fund_id
])
fund_basic_info
[
"ret_after_confirm"
]
=
round
((
fund_basic_info
[
"cur_cnav"
]
-
confirm_cnav
)
/
confirm_cnav
*
100
,
2
)
fund_basic_info
[
"ret_after_confirm"
]
=
str
(
round
((
fund_basic_info
[
"cur_cnav"
]
-
confirm_cnav
)
/
confirm_cnav
*
100
,
2
))
+
"
%
"
# 分红
distribution_df
=
self
.
all_fund_distribution
[
cur_fund_id
]
if
distribution_df
.
empty
:
...
...
app/templates/v2/monthReportV2.1.html
View file @
d7ad5ea2
This diff is collapsed.
Click to expand it.
app/utils/jinjia2html_v2.py
View file @
d7ad5ea2
...
...
@@ -246,6 +246,8 @@ class DataIntegrate:
'logo'
:
template_folder
+
'/v2/img/logo.png'
,
'scene'
:
template_folder
+
'/v2/img/scene.png'
,
'team'
:
template_folder
+
'/v2/img/default-user.png'
,
'red-rect'
:
template_folder
+
'/v2/img/red-rect.png'
,
'sh'
:
template_folder
+
'/v2/img/sh.png'
,
# 全局数据
'customer_name'
:
self
.
customer_name
,
'year_month'
:
self
.
user_customer
.
month_start_date
.
strftime
(
"
%
Y-
%
m"
),
...
...
@@ -326,6 +328,6 @@ class DataIntegrate:
if
__name__
==
'__main__'
:
start
=
time
.
time
()
dt
=
DataIntegrate
(
ifa_id
=
'USER_INFO15916072577875'
,
customer_id
=
'
6716613804966817792
'
)
dt
=
DataIntegrate
(
ifa_id
=
'USER_INFO15916072577875'
,
customer_id
=
'
USER_INFO15917853924996
'
)
dt
.
render_data
()
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
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