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
782dc13f
Commit
782dc13f
authored
Dec 11, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复最新数据bug
parent
b296a9b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
data_service.py
app/service/data_service.py
+1
-0
result_service_v2.py
app/service/result_service_v2.py
+2
-2
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+3
-2
No files found.
app/service/data_service.py
View file @
782dc13f
...
@@ -84,6 +84,7 @@ class UserCustomerDataAdaptor:
...
@@ -84,6 +84,7 @@ class UserCustomerDataAdaptor:
user_customer_order_df
=
order_df
.
set_index
(
'fund_id'
)
.
join
(
product_df
.
set_index
(
'fund_id'
))
.
reset_index
()
user_customer_order_df
=
order_df
.
set_index
(
'fund_id'
)
.
join
(
product_df
.
set_index
(
'fund_id'
))
.
reset_index
()
self
.
start_date
=
user_customer_order_df
[
"confirm_share_date"
]
.
min
()
self
.
start_date
=
user_customer_order_df
[
"confirm_share_date"
]
.
min
()
self
.
customer_real_name
=
user_customer_order_df
[
"customer_name"
]
.
values
[
0
]
self
.
customer_real_name
=
user_customer_order_df
[
"customer_name"
]
.
values
[
0
]
self
.
ifa_real_name
=
user_customer_order_df
[
"username"
]
.
values
[
0
]
user_customer_order_df
=
user_customer_order_df
[
user_customer_order_df
[
"confirm_share_date"
]
<=
self
.
end_date
]
user_customer_order_df
=
user_customer_order_df
[
user_customer_order_df
[
"confirm_share_date"
]
<=
self
.
end_date
]
user_customer_order_df
.
index
=
pd
.
Series
(
range
(
len
(
user_customer_order_df
)))
user_customer_order_df
.
index
=
pd
.
Series
(
range
(
len
(
user_customer_order_df
)))
return
user_customer_order_df
return
user_customer_order_df
...
...
app/service/result_service_v2.py
View file @
782dc13f
...
@@ -178,7 +178,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -178,7 +178,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
def
calculate_total_data
(
self
):
def
calculate_total_data
(
self
):
report_data
=
{}
report_data
=
{}
cur_folio_result_cnav_data
=
self
.
total_customer_order_cnav_df
cur_folio_result_cnav_data
=
self
.
total_customer_order_cnav_df
.
copy
()
cur_folio_order_data
=
self
.
user_customer_order_df
cur_folio_order_data
=
self
.
user_customer_order_df
freq_max
=
cur_folio_order_data
[
"freq"
]
.
max
()
freq_max
=
cur_folio_order_data
[
"freq"
]
.
max
()
#
#
...
@@ -414,7 +414,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -414,7 +414,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
fund_profit_ratio
=
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
.
dropna
()
+
1
fund_profit_ratio
=
nav_net_amount_df
[
amount_name
+
"_profit_ratio"
]
.
dropna
()
+
1
amount_ratio_shift
=
nav_net_amount_df
[
amount_name
+
"_amount_ratio"
]
.
shift
(
1
)
amount_ratio_shift
=
nav_net_amount_df
[
amount_name
+
"_amount_ratio"
]
.
shift
(
1
)
num_va
=
len
(
amount_ratio_shift
[
amount_ratio_shift
.
values
==
0
])
num_va
=
len
(
amount_ratio_shift
[
amount_ratio_shift
.
values
==
0
])
if
num_va
+
1
>
len
(
amount_ratio_shift
):
if
num_va
+
1
>
=
len
(
amount_ratio_shift
):
amount_ratio_shift
.
iloc
[
num_va
]
=
0
amount_ratio_shift
.
iloc
[
num_va
]
=
0
else
:
else
:
amount_ratio_shift
.
iloc
[
num_va
]
=
amount_ratio_shift
.
values
[
num_va
+
1
]
amount_ratio_shift
.
iloc
[
num_va
]
=
amount_ratio_shift
.
values
[
num_va
+
1
]
...
...
app/utils/jinjia2html_v2.py
View file @
782dc13f
...
@@ -21,7 +21,8 @@ class DataIntegrate:
...
@@ -21,7 +21,8 @@ class DataIntegrate:
def
__init__
(
self
,
ifa_id
=
'USER_INFO15914346866762'
,
customer_id
=
'202009281545001'
,
pdf_name
=
str
(
uuid
.
uuid4
())
+
'.pdf'
):
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
.
ifa_name
=
self
.
user_customer
.
ifa_real_name
self
.
pdf_name
=
self
.
ifa_name
+
"_"
+
self
.
customer_name
+
"_"
+
'.pdf'
# 全部数据
# 全部数据
self
.
df
=
self
.
user_customer
.
calculate_total_data
()
self
.
df
=
self
.
user_customer
.
calculate_total_data
()
# 组合结果数据
# 组合结果数据
...
@@ -327,5 +328,5 @@ class DataIntegrate:
...
@@ -327,5 +328,5 @@ class DataIntegrate:
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
start
=
time
.
time
()
start
=
time
.
time
()
DataIntegrate
(
ifa_id
=
'USER_INFO1591607
6265983'
,
customer_id
=
'6716613794590109696
'
)
DataIntegrate
(
ifa_id
=
'USER_INFO1591607
4031596'
,
customer_id
=
'6716613800730570752
'
)
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
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