Commit 1602e4f3 authored by lcn's avatar lcn

bug修复

parent c93338fe
......@@ -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('')
......
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