Commit e49a7c87 authored by wang.wenrong's avatar wang.wenrong

识电U

parent a048a3c8
...@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment