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
48fc6aa5
Commit
48fc6aa5
authored
Dec 25, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
周报版本
parent
f3b499f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
1 deletion
+88
-1
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+1
-1
timed_task_v2.py
app/utils/timed_task_v2.py
+87
-0
No files found.
app/utils/jinjia2html_v2.py
View file @
48fc6aa5
...
@@ -235,7 +235,7 @@ class DataIntegrate:
...
@@ -235,7 +235,7 @@ class DataIntegrate:
# 业绩的明细
# 业绩的明细
'box4'
:
'block'
,
'box4'
:
'block'
,
# 个基点评
# 个基点评
'box5'
:
'block'
,
'box5'
:
None
,
# 优化组合建议
# 优化组合建议
'box6'
:
None
,
'box6'
:
None
,
# 新增基金
# 新增基金
...
...
app/utils/timed_task_v2.py
0 → 100644
View file @
48fc6aa5
# coding: utf-8
"""
找出所有 ifa
找出 ifa 所有的客户
进行月报生成
"""
import
datetime
import
time
import
traceback
import
uuid
from
app.api.engine
import
logging
,
pdf_folder
,
tamp_diagnose_app_engine
,
config
,
env
import
os
from
app.api.engine
import
tamp_user_engine
,
tamp_order_engine
,
TAMP_SQL
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy
import
Column
,
String
,
Integer
,
and_
from
app.service.portfolio_diagnose
import
fund_rank
,
tamp_fund
from
app.utils.jinjia2html_v2
import
DataIntegrate
from
concurrent
import
futures
Base
=
declarative_base
()
class
IfaUser
(
Base
):
__tablename__
=
"user_info"
id
=
Column
(
String
(
64
),
primary_key
=
True
)
ui_username
=
Column
(
String
(
64
))
ui_sex
=
Column
(
String
(
64
))
class
Ifa_Customer
(
Base
):
__tablename__
=
"ifa_customer"
id
=
Column
(
String
(
64
),
primary_key
=
True
)
customer_id
=
Column
(
String
(
32
))
ifa_id
=
Column
(
String
(
64
))
class
Customer
(
Base
):
__tablename__
=
"customer"
id
=
Column
(
String
(
64
),
primary_key
=
True
)
customer_name
=
Column
(
String
(
128
))
# class CustomerOrder(Base):
# __tablename__ = 'customer_order'
#
# user_id = Column(String(128))
# customer_id = Column(String(128))
# class UserInfo(Base):
# __tablename__ = 'user_info'
#
# id = Column(String(64), primary_key=True)
# ui_username = Column(String(128))
def
call_month_report
(
ifauser_id
,
ifauser_name
,
customer_id
,
customer_name
):
filename
=
'{}_{}_.pdf'
.
format
(
ifauser_name
,
customer_name
)
if
os
.
path
.
exists
(
pdf_folder
+
filename
):
return
None
print
(
'开始制作IFA: {}, 客户: {}的基金月报'
.
format
(
ifauser_name
,
customer_name
))
start
=
time
.
time
()
try
:
dt
=
DataIntegrate
(
ifauser_id
,
customer_id
,
'{}_{}_.pdf'
.
format
(
ifauser_name
,
customer_name
))
dt
.
render_data
()
print
(
'IFA: {}, 客户: {}的基金月报已经生成, 耗时{}秒'
.
format
(
ifauser_name
,
customer_name
,
time
.
time
()
-
start
))
except
OSError
:
print
(
'IFA: {}, 客户: {}的基金月报已经生成,耗时{}秒'
.
format
(
ifauser_name
,
customer_name
,
time
.
time
()
-
start
))
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
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 tamp_order.customer_order_view f1, tamp_user.user_info f2,tamp_user.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
])
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