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
e49a7c87
Commit
e49a7c87
authored
Apr 11, 2023
by
wang.wenrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
识电U
parent
a048a3c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
electric_pds.py
unify_api/modules/electric/procedures/electric_pds.py
+2
-2
No files found.
unify_api/modules/electric/procedures/electric_pds.py
View file @
e49a7c87
...
@@ -9,6 +9,7 @@ from pot_libs.logger import log
...
@@ -9,6 +9,7 @@ from pot_libs.logger import log
from
unify_api
import
constants
from
unify_api
import
constants
from
unify_api.modules.common.service.td_engine_service
import
\
from
unify_api.modules.common.service.td_engine_service
import
\
get_td_engine_data
get_td_engine_data
from
unify_api.utils.taos_new
import
parse_td_columns
METERDATA_CURRENT_KEY
=
"meterdata_current"
METERDATA_CURRENT_KEY
=
"meterdata_current"
METERDATA_CURRENT_HR_KEY
=
"meterdata_hr_current"
METERDATA_CURRENT_HR_KEY
=
"meterdata_hr_current"
...
@@ -237,8 +238,7 @@ async def elec_current_data_new15(mtids, cid):
...
@@ -237,8 +238,7 @@ async def elec_current_data_new15(mtids, cid):
"""
"""
is_succ
,
results
=
await
get_td_engine_data
(
url
,
sql
)
is_succ
,
results
=
await
get_td_engine_data
(
url
,
sql
)
if
is_succ
:
if
is_succ
:
head
=
[
re
.
findall
(
r'last_row\((.*)\)'
,
i
)[
0
]
if
"("
in
i
else
i
head
=
parse_td_columns
(
results
)
for
i
in
results
[
"head"
]]
for
res
in
results
[
"data"
]:
for
res
in
results
[
"data"
]:
data
=
dict
(
zip
(
head
,
res
))
data
=
dict
(
zip
(
head
,
res
))
if
data
[
"mtid"
]
in
mtids
:
if
data
[
"mtid"
]
in
mtids
:
...
...
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