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
4c7a3d80
Commit
4c7a3d80
authored
Jun 30, 2023
by
lcn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
c3c7703f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
60 deletions
+63
-60
electric_service.py
unify_api/modules/electric/service/electric_service.py
+43
-40
electric.py
unify_api/modules/electric/views/electric.py
+20
-20
No files found.
unify_api/modules/electric/service/electric_service.py
View file @
4c7a3d80
...
@@ -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"
,
...
...
unify_api/modules/electric/views/electric.py
View file @
4c7a3d80
...
@@ -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
,
...
...
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