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
b296a9b9
Commit
b296a9b9
authored
4 years ago
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务10
parent
9f5986a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
config.yaml
app/config/config.yaml
+3
-3
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+1
-1
timed_task.py
app/utils/timed_task.py
+7
-13
No files found.
app/config/config.yaml
View file @
b296a9b9
...
...
@@ -12,7 +12,7 @@ dev:
port
:
6379
db
:
0
log
:
filename
:
/logs/
tamp_course_order
.log
filename
:
/logs/
fund_report
.log
filemode
:
a
format
:
"
%(asctime)s
%(name)s
%(levelname)s
%(message)s"
datefmt
:
"
%Y-%m-%d
%H:%M:%S
%a"
...
...
@@ -32,7 +32,7 @@ test:
port
:
6379
db
:
0
log
:
filename
:
/logs/
tamp_course_order
.log
filename
:
/logs/
fund_report
.log
filemode
:
a
format
:
"
%(asctime)s
%(name)s
%(levelname)s
%(message)s"
datefmt
:
"
%Y-%m-%d
%H:%M:%S
%a"
...
...
@@ -53,7 +53,7 @@ prod:
port
:
6379
db
:
0
log
:
filename
:
/logs/
tamp_course_order
.log
filename
:
/logs/
fund_report
.log
filemode
:
a
format
:
"
%(asctime)s
%(name)s
%(levelname)s
%(message)s"
datefmt
:
"
%Y-%m-%d
%H:%M:%S
%a"
This diff is collapsed.
Click to expand it.
app/utils/jinjia2html_v2.py
View file @
b296a9b9
...
...
@@ -327,5 +327,5 @@ class DataIntegrate:
if
__name__
==
'__main__'
:
start
=
time
.
time
()
DataIntegrate
(
ifa_id
=
'
188843568193236992'
,
customer_id
=
'6734729261802467328
'
)
DataIntegrate
(
ifa_id
=
'
USER_INFO15916076265983'
,
customer_id
=
'6716613794590109696
'
)
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
This diff is collapsed.
Click to expand it.
app/utils/timed_task.py
View file @
b296a9b9
...
...
@@ -51,10 +51,6 @@ class Customer(Base):
# ui_username = Column(String(128))
def
call_month_report
(
ifauser_id
,
ifauser_name
,
customer_id
,
customer_name
):
# ifauser_id = args[0]
# ifauser_name = args[1]
# customer_id = args[2]
# customer_name = args[3]
filename
=
'{}_{}_.pdf'
.
format
(
ifauser_name
,
customer_name
)
if
os
.
path
.
exists
(
pdf_folder
+
filename
):
return
None
...
...
@@ -66,17 +62,15 @@ def call_month_report(ifauser_id, ifauser_name, customer_id, customer_name):
except
OSError
:
print
(
'IFA: {}, 客户: {}的基金月报已经生成,耗时{}秒'
.
format
(
ifauser_name
,
customer_name
,
time
.
time
()
-
start
))
except
Exception
as
e
:
logging
.
error
(
"IFA
: {}, 客户: {}的基金月报生成异常,错误追踪:{}"
.
format
(
ifauser_name
,
customer_name
,
traceback
.
format_exc
()))
logging
.
error
(
"IFA
ID{}: 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
()))
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
,
TAMP_SQL
(
tamp_order_engine
)
as
tamp_order
:
tamp_user_session
=
tamp_user
.
session
res
=
tamp_user_session
.
execute
(
'SELECT DISTINCT user_id, customer_id , realname, customer_name FROM (select f1.user_id, f1.customer_id, f2.realname,f3.customer_name from customer_order f1, user_info f2,customer_info f3 where f2.id=f1.user_id and f3.id=f1.customer_id) res;'
)
data
=
res
.
fetchall
()
if
__name__
==
'__main__'
:
data
=
[]
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
,
TAMP_SQL
(
tamp_order_engine
)
as
tamp_order
:
tamp_user_session
=
tamp_user
.
session
res
=
tamp_user_session
.
execute
(
'SELECT DISTINCT user_id, customer_id , realname, customer_name FROM (select f1.user_id, f1.customer_id, f2.realname,f3.customer_name from customer_order f1, user_info f2,customer_info f3 where f2.id=f1.user_id and f3.id=f1.customer_id) res;'
)
data
=
res
.
fetchall
()
for
d
in
data
:
call_month_report
(
d
[
0
],
d
[
2
],
d
[
1
],
d
[
3
])
# args.append((ifauser.id, ifauser.ui_username, customer_full.id, customer_full.customer_name))
# with futures.ProcessPoolExecutor(8) as executor:
# executor.map(call_month_report, args)
This diff is collapsed.
Click to expand it.
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