Commit 4c7a3d80 authored by lcn's avatar lcn

bug修复

parent c3c7703f
...@@ -20,7 +20,8 @@ from unify_api.modules.electric.procedures.electric_util import \ ...@@ -20,7 +20,8 @@ from unify_api.modules.electric.procedures.electric_util import \
load_point_ctnum load_point_ctnum
from datetime import datetime from datetime import datetime
from unify_api.constants import REAL_EXP_TIME from unify_api.constants import REAL_EXP_TIME
from unify_api.utils.time_format import CST, YMD_Hms, timestamp2dts from unify_api.utils.time_format import CST, YMD_Hms, timestamp2dts, \
time_pick_transf
from unify_api.modules.common.procedures.location_temp_rcurrent import \ from unify_api.modules.common.procedures.location_temp_rcurrent import \
location_stats_statics location_stats_statics
from unify_api.modules.electric.components.electric import ( from unify_api.modules.electric.components.electric import (
...@@ -346,12 +347,14 @@ async def elec_index_service(cid, point_id, start, end): ...@@ -346,12 +347,14 @@ async def elec_index_service(cid, point_id, start, end):
ctnum = await load_point_ctnum(point_id) ctnum = await load_point_ctnum(point_id)
ctnum = ctnum if ctnum == 2 else 3 ctnum = ctnum if ctnum == 2 else 3
now = str(datetime.now()) now = str(datetime.now())
if start[:10] == now[:10] and end[:10] == now[:10]: intervel, _ = time_pick_transf(start, end)
table_name = "point_15min_electric" if intervel == 86400:
redi_table_name = "location_15min_aiao"
else:
table_name = "point_1day_electric" table_name = "point_1day_electric"
redi_table_name = "location_1day_aiao" redi_table_name = "location_1day_aiao"
else:
table_name = "point_15min_electric"
redi_table_name = "location_15min_aiao"
if ctnum == 2: if ctnum == 2:
common_items = ["lf_mean", "lf_min", "lf_max", "pttl_mean", "pttl_min", common_items = ["lf_mean", "lf_min", "lf_max", "pttl_mean", "pttl_min",
"pttl_max", "qttl_mean", "qttl_min", "qttl_max", "pttl_max", "qttl_mean", "qttl_min", "qttl_max",
......
...@@ -400,7 +400,7 @@ async def post_qual_current(req, body: PageRequest) -> QualCurrentResponse: ...@@ -400,7 +400,7 @@ async def post_qual_current(req, body: PageRequest) -> QualCurrentResponse:
ret_items = ["ua_dev", "ub_dev", "uc_dev", "uab_dev", "ucb_dev", ret_items = ["ua_dev", "ub_dev", "uc_dev", "uab_dev", "ucb_dev",
"freq_dev", "ubl", "ibl", "sdu_i", "sdu_u"] "freq_dev", "ubl", "ibl", "sdu_i", "sdu_u"]
return QualCurrentResponse( return QualCurrentResponse(
ctnum=d_rt_ele["ctnum"], ctnum=d_rt_ele.get("ctnum") or 3,
real_time=time_str, real_time=time_str,
health_index=health_index, health_index=health_index,
voltage_harmonic=voltage_harmonic, voltage_harmonic=voltage_harmonic,
......
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