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
cd18b167
Commit
cd18b167
authored
Dec 08, 2020
by
pengxiong@wealthgrow.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf文件名
parent
4beab589
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
__init__.py
app/pdf/__init__.py
+0
-9
jinjia2html.py
app/utils/jinjia2html.py
+3
-2
timed_task.py
app/utils/timed_task.py
+2
-2
No files found.
app/pdf/__init__.py
deleted
100644 → 0
View file @
4beab589
# -*- encoding: utf-8 -*-
# -----------------------------------------------------------------------------
# @File Name : __init__.py.py
# @Time : 2020/11/23 下午4:11
# @Author : X. Peng
# @Email : acepengxiong@163.com
# @Software : PyCharm
# -----------------------------------------------------------------------------
app/utils/jinjia2html.py
View file @
cd18b167
...
@@ -18,9 +18,10 @@ from app.utils.radar_chart import gen_radar_chart
...
@@ -18,9 +18,10 @@ from app.utils.radar_chart import gen_radar_chart
class
DataIntegrate
:
class
DataIntegrate
:
def
__init__
(
self
,
ifa_id
=
'USER_INFO15914346866762'
,
customer_id
=
'202009281545001'
):
def
__init__
(
self
,
ifa_id
=
'USER_INFO15914346866762'
,
customer_id
=
'202009281545001'
,
pdf_name
=
str
(
uuid
.
uuid4
())
+
'.pdf'
):
self
.
user_customer
=
UserCustomerResultAdaptor
(
ifa_id
,
customer_id
)
self
.
user_customer
=
UserCustomerResultAdaptor
(
ifa_id
,
customer_id
)
self
.
customer_name
=
self
.
user_customer
.
customer_real_name
self
.
customer_name
=
self
.
user_customer
.
customer_real_name
self
.
pdf_name
=
pdf_name
self
.
df
=
self
.
user_customer
.
calculate_total_data
()
self
.
df
=
self
.
user_customer
.
calculate_total_data
()
self
.
d
=
self
.
user_customer
.
calculate_group_result_data
()
self
.
d
=
self
.
user_customer
.
calculate_group_result_data
()
# 组合数据
# 组合数据
...
@@ -266,7 +267,7 @@ class DataIntegrate:
...
@@ -266,7 +267,7 @@ class DataIntegrate:
# save_file = "app/html/v2/monthReportV2.html"
# save_file = "app/html/v2/monthReportV2.html"
# with open(save_file, 'w', encoding="utf-8") as f:
# with open(save_file, 'w', encoding="utf-8") as f:
# f.write(monthReport_html)
# f.write(monthReport_html)
html_to_pdf
(
monthReport_html
,
pdf_folder
+
s
tr
(
uuid
.
uuid4
())
+
'.pdf'
)
html_to_pdf
(
monthReport_html
,
pdf_folder
+
s
elf
.
pdf_name
)
...
...
app/utils/timed_task.py
View file @
cd18b167
...
@@ -38,7 +38,7 @@ class Customer(Base):
...
@@ -38,7 +38,7 @@ class Customer(Base):
def
call_month_report
(
ifauser_id
,
ifauser_name
,
customer_id
,
customer_name
):
def
call_month_report
(
ifauser_id
,
ifauser_name
,
customer_id
,
customer_name
):
print
(
'开始制作IFA: {}, 客户: {}的基金月报'
.
format
(
ifauser_name
,
customer_name
))
print
(
'开始制作IFA: {}, 客户: {}的基金月报'
.
format
(
ifauser_name
,
customer_name
))
try
:
try
:
DataIntegrate
(
ifauser_id
,
customer_id
)
DataIntegrate
(
ifauser_id
,
customer_id
,
'{}_{}_.pdf'
.
format
(
ifauser_name
,
customer_name
)
)
except
:
except
:
print
(
"发生异常,下一个走起!"
)
print
(
"发生异常,下一个走起!"
)
...
@@ -51,7 +51,7 @@ with TAMP_SQL(tamp_user_engine) as tamp_user, TAMP_SQL(tamp_order_engine) as tam
...
@@ -51,7 +51,7 @@ with TAMP_SQL(tamp_user_engine) as tamp_user, TAMP_SQL(tamp_order_engine) as tam
tamp_order_session
=
tamp_order
.
session
tamp_order_session
=
tamp_order
.
session
# for ifauser in ifausers:
# for ifauser in ifausers:
for
ifauser
in
ifausers
[
600
:
1000
]
:
for
ifauser
in
ifausers
:
# 获取某个 ifa 的所有 customer
# 获取某个 ifa 的所有 customer
customers
=
tamp_order_session
.
query
(
Ifa_Customer
)
.
\
customers
=
tamp_order_session
.
query
(
Ifa_Customer
)
.
\
filter_by
(
ifa_id
=
ifauser
.
id
)
.
all
()
filter_by
(
ifa_id
=
ifauser
.
id
)
.
all
()
...
...
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