Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
3e3e20dc
Commit
3e3e20dc
authored
Jun 21, 2023
by
陈涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改重新计算净值
parent
b2c7fdf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
nav.py
api/nav.py
+7
-7
nav.py
service/nav.py
+1
-1
No files found.
api/nav.py
View file @
3e3e20dc
...
@@ -100,14 +100,14 @@ async def recalculate_nav(
...
@@ -100,14 +100,14 @@ async def recalculate_nav(
start
:
datetime
.
datetime
=
Query
(
...
,
title
=
"开始时间"
),
start
:
datetime
.
datetime
=
Query
(
...
,
title
=
"开始时间"
),
end
:
datetime
.
datetime
=
Query
(
None
,
title
=
"结束时间"
),
end
:
datetime
.
datetime
=
Query
(
None
,
title
=
"结束时间"
),
fund_collect
:
AgnosticCollection
=
Depends
(
get_fund_collect
),
fund_collect
:
AgnosticCollection
=
Depends
(
get_fund_collect
),
#
user: User = Depends(get_current_user),
user
:
User
=
Depends
(
get_current_user
),
#
permission_user_collect: AgnosticCollection = Depends(get_permission_user_collect),
permission_user_collect
:
AgnosticCollection
=
Depends
(
get_permission_user_collect
),
#
permission_role_collect: AgnosticCollection = Depends(get_permission_role_collect)
permission_role_collect
:
AgnosticCollection
=
Depends
(
get_permission_role_collect
)
):
):
#
await check_permission(['data_permission.nav.recalculate'],
await
check_permission
([
'data_permission.nav.recalculate'
],
#
fund_id,
fund_id
,
#
user.email, permission_user_collect,
user
.
email
,
permission_user_collect
,
#
permission_role_collect)
permission_role_collect
)
fund_data
=
await
fund_collect
.
find_one
({
"id"
:
fund_id
})
fund_data
=
await
fund_collect
.
find_one
({
"id"
:
fund_id
})
assert
fund_data
,
"没有数据"
assert
fund_data
,
"没有数据"
end
=
end
or
datetime
.
datetime
.
utcnow
()
end
=
end
or
datetime
.
datetime
.
utcnow
()
...
...
service/nav.py
View file @
3e3e20dc
...
@@ -69,7 +69,7 @@ async def calculate_nav(fund_id, calc_time: datetime.datetime = None, beach_serv
...
@@ -69,7 +69,7 @@ async def calculate_nav(fund_id, calc_time: datetime.datetime = None, beach_serv
income
=
beach_service
.
get_rewards
(
key
)
income
=
beach_service
.
get_rewards
(
key
)
node_income_assets
.
setdefault
(
"ETH"
,
0
)
node_income_assets
.
setdefault
(
"ETH"
,
0
)
node_income_assets
[
"ETH"
]
+=
income
.
total_rewards
.
total
if
income
else
0
node_income_assets
[
"ETH"
]
+=
income
.
total_rewards
.
total
if
income
else
0
for
key
,
value
in
fund_data
[
"node_income_assets"
]
.
items
():
for
key
,
value
in
node_income_assets
.
items
():
amount
.
setdefault
(
key
,
0
)
amount
.
setdefault
(
key
,
0
)
amount
[
key
]
+=
value
amount
[
key
]
+=
value
...
...
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