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
d85b4ef3
Commit
d85b4ef3
authored
Apr 18, 2023
by
lcn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复Bug
parent
b26c194c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
188 deletions
+94
-188
syncretize_energy_dao.py
unify_api/modules/elec_charge/dao/syncretize_energy_dao.py
+2
-2
electric_service.py
unify_api/modules/electric/service/electric_service.py
+1
-1
pv_distributed_photovoltaic.py
...es/energy_optimize/service/pv_distributed_photovoltaic.py
+91
-185
No files found.
unify_api/modules/elec_charge/dao/syncretize_energy_dao.py
View file @
d85b4ef3
...
...
@@ -28,10 +28,10 @@ async def get_elec_price_dao(cid):
async
def
get_max_demand_by_inlid
(
inlids
):
sql
=
"""SELECT
a.has_space,b.related_inlids FROM
sql
=
"""SELECT
'[]' as has_space,b.inlid as related_inlids FROM
`algo_md_space_analysis_result` a
LEFT JOIN algo_md_space_analysis_unit b on a.space_analysis_id=b.id
WHERE b.
related_inlids in
%
s ORDER BY a.create_time
DESC LIMIT
%
s"""
WHERE b.
inlid in
%
s ORDER BY a.month
DESC LIMIT
%
s"""
async
with
MysqlUtil
()
as
conn
:
spaces
=
await
conn
.
fetchall
(
sql
,
args
=
(
inlids
,
len
(
inlids
)))
return
spaces
...
...
unify_api/modules/electric/service/electric_service.py
View file @
d85b4ef3
...
...
@@ -888,7 +888,7 @@ async def elec_current_service_new15(point_id):
url
=
f
"{SETTING.stb_url}db_electric?tz=Asia/Shanghai"
sql
=
f
"select last_row(*) from mt{mtid}_ele where pid={point_id}"
is_succ
,
results
=
await
get_td_engine_data
(
url
,
sql
)
if
not
is_succ
or
not
results
:
if
not
is_succ
or
not
results
or
results
.
get
(
"code"
)
>
0
:
return
''
,
{}
head
=
parse_td_columns
(
results
)
if
not
results
[
"data"
]:
...
...
unify_api/modules/energy_optimize/service/pv_distributed_photovoltaic.py
View file @
d85b4ef3
This diff is collapsed.
Click to expand it.
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