Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaonan
unify_api2
Commits
1602e4f3
Commit
1602e4f3
authored
Jul 27, 2023
by
lcn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
c93338fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
data_operation_service.py
unify_api/modules/zhiwei_u/service/data_operation_service.py
+8
-2
No files found.
unify_api/modules/zhiwei_u/service/data_operation_service.py
View file @
1602e4f3
...
...
@@ -82,6 +82,11 @@ async def data_operation_search_service(mtid, point, params, start, end,
if
not
point
and
mtid
:
data
=
await
get_pid_by_mtid
(
mtid
)
point
=
data
[
"pid"
]
if
point
and
not
mtid
:
mt_data
=
await
get_mtid_by_pid
(
point
)
mtid
=
mt_data
[
"mtid"
]
else
:
mt_data
=
None
# 是否有温度和漏电流
all_datas
,
temp
=
{},
{}
if
"temperature"
in
params
:
...
...
@@ -90,7 +95,8 @@ async def data_operation_search_service(mtid, point, params, start, end,
Ctemp
=
temperature
[
"Ctemp"
],
Ntemp
=
temperature
[
"Ntemp"
])
resi
=
{}
if
"residual_current"
in
params
:
mt_data
=
await
get_mtid_by_pid
(
point
)
if
not
mt_data
:
mt_data
=
await
get_mtid_by_pid
(
point
)
resi_data
=
await
get_locationid_by_mtid
(
mt_data
[
"mtid"
],
"residual_current"
)
# 动态漏电流阈值
...
...
@@ -124,7 +130,7 @@ async def data_operation_search_service(mtid, point, params, start, end,
for
slot
in
slots
:
if
slot
in
new_data
.
keys
():
for
i
in
all_datas
.
keys
():
all_datas
[
i
]
.
append
(
new_data
[
slot
]
.
get
(
i
,
""
)
)
all_datas
[
i
]
.
append
(
new_data
[
slot
]
.
get
(
i
)
or
""
)
else
:
for
i
in
all_datas
.
keys
():
all_datas
[
i
]
.
append
(
''
)
...
...
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