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
cd54a856
Commit
cd54a856
authored
Dec 18, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最新月报生成
parent
104dabc4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
data_service.py
app/service/data_service.py
+1
-1
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+5
-9
timed_task.py
app/utils/timed_task.py
+2
-0
No files found.
app/service/data_service.py
View file @
cd54a856
...
...
@@ -36,7 +36,7 @@ class UserCustomerDataAdaptor:
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
)
self
.
end_date
=
pd
.
to_datetime
(
str
(
p_end_date
))
self
.
end_date
=
pd
.
to_datetime
(
"2020-12-
04
"
)
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
)
self
.
month_start_date
=
p_start_date
self
.
month_start_date
=
pd
.
to_datetime
(
"2020-11-01"
)
...
...
app/utils/jinjia2html_v2.py
View file @
cd54a856
...
...
@@ -32,9 +32,6 @@ class DataIntegrate:
# 分组合拼接结果数据
self
.
get_group_result
()
# # 组合数据
# self.group_result = self.d["default"]
# self.get_portfolio_diagnose(self.group_result["fund_id_list"])
# 投资总览
self
.
get_summarize
()
# 月度回报
...
...
@@ -72,11 +69,11 @@ class DataIntegrate:
# 旧相关性
self
.
get_old_correlation
(
portfolio_diagnose
,
cur_group_portfolio_result
)
# # 新增基金
self
.
propose_fund
(
portfolio_diagnose
,
cur_group_portfolio_result
)
#
self.propose_fund(portfolio_diagnose, cur_group_portfolio_result)
# # 新收益比较
self
.
get_transfer_suggestions
(
portfolio_diagnose
,
group_name
,
cur_group_portfolio_result
)
#
self.get_transfer_suggestions(portfolio_diagnose, group_name, cur_group_portfolio_result)
# # 新相关性
self
.
get_new_correlation
(
portfolio_diagnose
,
cur_group_portfolio_result
)
#
self.get_new_correlation(portfolio_diagnose, cur_group_portfolio_result)
self
.
all_folio_result
[
group_name
]
=
cur_group_portfolio_result
...
...
@@ -238,9 +235,9 @@ class DataIntegrate:
# 个基点评
'box5'
:
'block'
,
# 优化组合建议
'box6'
:
'block'
,
'box6'
:
None
,
# 新增基金
'box7'
:
'block'
,
'box7'
:
None
,
# 结尾
'box8'
:
'block'
,
'cover_back'
:
template_folder
+
'/v2/img/cover-back.png'
,
...
...
@@ -325,7 +322,6 @@ class DataIntegrate:
html_to_pdf
(
monthReport_html
,
pdf_folder
+
self
.
pdf_name
)
if
__name__
==
'__main__'
:
start
=
time
.
time
()
DataIntegrate
(
ifa_id
=
'USER_INFO15914346866762'
,
customer_id
=
'202009281545001'
)
...
...
app/utils/timed_task.py
View file @
cd54a856
...
...
@@ -67,6 +67,8 @@ def call_month_report(ifauser_id, ifauser_name, customer_id, customer_name):
except
Exception
as
e
:
logging
.
error
(
"IFAID{}: IFAName{}, 客户ID{}, 客户Name: {}的基金月报生成异常,错误追踪:{}"
.
format
(
ifauser_id
,
ifauser_name
,
customer_id
,
customer_name
,
traceback
.
format_exc
()))
print
(
"IFA: {}, 客户: {}的基金月报生成异常,错误追踪:{}"
.
format
(
ifauser_name
,
customer_name
,
traceback
.
format_exc
()))
finally
:
return
None
if
__name__
==
'__main__'
:
data
=
[]
...
...
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