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
2361ae46
Commit
2361ae46
authored
Dec 25, 2020
by
wang zhengwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'app' of
http://47.100.44.39:10001/pengxiong/fund_report
into app
parents
3fa83015
81e99219
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
123 deletions
+123
-123
data_service_v2.py
app/service/data_service_v2.py
+1
-1
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/data_service_v2.py
View file @
2361ae46
...
...
@@ -37,7 +37,7 @@ class UserCustomerDataAdaptor:
self
.
customer_id
=
customer_id
self
.
compare_index_id
=
index_id
p_end_date
=
pd
.
to_datetime
(
end_date
)
.
date
()
p_end_date
=
datetime
.
date
(
year
=
p_end_date
.
year
,
month
=
p_end_date
.
month
,
day
=
1
)
-
datetime
.
timedelta
(
days
=
1
)
#
p_end_date = datetime.date(year=p_end_date.year, month=p_end_date.month, day=1) - datetime.timedelta(days=1)
self
.
end_date
=
pd
.
to_datetime
(
str
(
p_end_date
))
# self.end_date = pd.to_datetime("2020-12-11")
p_start_date
=
datetime
.
date
(
year
=
p_end_date
.
year
,
month
=
p_end_date
.
month
,
day
=
1
)
...
...
app/service/result_service_v2.py
View file @
2361ae46
...
...
@@ -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 @
2361ae46
This diff is collapsed.
Click to expand it.
app/utils/jinjia2html_v2.py
View file @
2361ae46
...
...
@@ -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