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
8013be54
Commit
8013be54
authored
Jan 06, 2021
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成本精度
parent
b903fb95
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
result_service_v2.py
app/service/result_service_v2.py
+6
-3
No files found.
app/service/result_service_v2.py
View file @
8013be54
...
@@ -77,7 +77,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -77,7 +77,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
"cumulative"
:
cumulative_data
}
"cumulative"
:
cumulative_data
}
# 总成本
# 总成本
total_cost
=
round
(
float
((
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"confirm_share"
]
*
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"nav"
])
.
sum
()),
2
)
total_cost
=
round
(
float
((
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"confirm_share"
]
*
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"nav"
])
.
sum
()),
0
)
folio_report_data
[
"total_cost"
]
=
total_cost
folio_report_data
[
"total_cost"
]
=
total_cost
# 累积盈利
# 累积盈利
...
@@ -245,7 +245,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -245,7 +245,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
resample_df
=
resample_df
[
resample_df
.
index
<=
self
.
end_date
]
resample_df
=
resample_df
[
resample_df
.
index
<=
self
.
end_date
]
# 总成本
# 总成本
total_cost
=
round
(
float
((
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"confirm_share"
]
*
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"nav"
])
.
sum
()),
2
)
total_cost
=
round
(
float
((
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"confirm_share"
]
*
cur_folio_order_data
[
cur_folio_order_data
[
"order_type"
]
==
1
][
"nav"
])
.
sum
()),
0
)
report_data
[
"total_cost"
]
=
total_cost
report_data
[
"total_cost"
]
=
total_cost
# 累积盈利
# 累积盈利
...
@@ -307,6 +307,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
...
@@ -307,6 +307,9 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
else
:
else
:
if
len
(
cur_profit_ratio
)
<
1
:
if
len
(
cur_profit_ratio
)
<
1
:
cur_year_profit_ratio
=
0.0
cur_year_profit_ratio
=
0.0
else
:
if
len
(
cur_profit_ratio
)
<
1
:
cur_year_profit_ratio
=
0
else
:
else
:
cur_year_profit_ratio
=
(
cur_profit_ratio
[
-
1
]
-
last_profit_ratio
[
-
1
])
/
last_profit_ratio
[
-
1
]
cur_year_profit_ratio
=
(
cur_profit_ratio
[
-
1
]
-
last_profit_ratio
[
-
1
])
/
last_profit_ratio
[
-
1
]
report_data
[
"cur_year_profit_ratio"
]
=
float
(
cur_year_profit_ratio
)
report_data
[
"cur_year_profit_ratio"
]
=
float
(
cur_year_profit_ratio
)
...
...
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