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
6412c059
Commit
6412c059
authored
May 15, 2023
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shidianu ele behavior curve 2023-5-15
parent
1b340470
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
analysis_result_service.py
...pi/modules/shidianu/procedures/analysis_result_service.py
+2
-2
output_result.py
unify_api/modules/shidianu/procedures/output_result.py
+2
-2
No files found.
unify_api/modules/shidianu/procedures/analysis_result_service.py
View file @
6412c059
...
...
@@ -14,7 +14,7 @@ from unify_api.modules.shidianu.components.algorithm_cps import WcResp, AbcResp
from
unify_api.modules.shidianu.dao.analysis_result_dao
import
\
query_sdu_power_wave
,
query_sdu_recog_record
from
unify_api.modules.shidianu.procedures.output_result
import
get_p_list
,
\
get_
p_list_new15
get_
curve_p
from
unify_api.utils.time_format
import
last30_day_range
,
\
get_start_end_by_tz_time
,
day_slots
,
get_start_end_by_tz_time_new
...
...
@@ -85,7 +85,7 @@ async def wave_curve_service_new15(point_id, req_date, product):
mtid
,
meter_no
=
meter_info
[
"mtid"
],
meter_info
[
"meter_no"
]
start
,
end
=
get_start_end_by_tz_time_new
(
req_date
)
# 获取设备数据
p_list
=
await
get_
p_list_new15
(
mtid
,
meter_no
,
start
,
end
,
time_slot
)
p_list
=
await
get_
curve_p
(
mtid
,
meter_no
,
start
,
end
,
time_slot
)
# 3. 获取用电设备识别结果
device_data
=
await
query_sdu_recog_record
(
point_id
,
start
,
end
)
electric_actions
=
{}
...
...
unify_api/modules/shidianu/procedures/output_result.py
View file @
6412c059
...
...
@@ -196,14 +196,14 @@ async def get_p_list(sid, meter_sn, req_date, time_slots):
return
p_list
async
def
get_
p_list_new15
(
mtid
,
meter_sn
,
start
,
end
,
time_slots
):
async
def
get_
curve_p
(
mtid
,
meter_sn
,
start
,
end
,
time_slots
):
'''
从tdenine中获取相关数据
'''
sn
=
meter_sn
.
lower
()
p_field
=
f
"p{sn}"
url
=
f
"{SETTING.stb_url}db_electric?tz=Asia/Shanghai"
sql
=
f
"select max({p_field}) {p_field} from mt{mtid}_ele "
\
sql
=
f
"select
ts,
max({p_field}) {p_field} from mt{mtid}_ele "
\
f
"where meter_sn='{str.upper(sn)}' "
\
f
"and ts >= '{start}' and ts <= '{end}' INTERVAL(1m)"
status
,
results
=
await
get_td_engine_data
(
url
,
sql
)
...
...
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