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
e601b279
Commit
e601b279
authored
Jun 20, 2023
by
lcn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
d9f4a706
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
count_info_pds.py
unify_api/modules/home_page/procedures/count_info_pds.py
+2
-5
No files found.
unify_api/modules/home_page/procedures/count_info_pds.py
View file @
e601b279
...
...
@@ -354,14 +354,14 @@ async def optimization_count_info(company_id: int):
last_month_dt
=
datetime
(
year
=
now
.
year
-
1
,
month
=
12
,
day
=
1
)
else
:
last_month_dt
=
datetime
(
year
=
now
.
year
,
month
=
now
.
month
-
1
,
day
=
1
)
last_month_str
=
datetime
.
strftime
(
last_month_dt
,
"
%
Y-
%
m-
%
d"
)
# 功率因数
async
with
MysqlUtil
()
as
conn
:
sql
=
"SELECT inlid, `cos`, save_charge pf_cost, kpi_x, save_charge "
\
"FROM algo_power_factor_result WHERE inlid in
%
s "
\
"and month=
%
s"
power_factor_results
=
await
conn
.
fetchall
(
sql
,
args
=
(
inline_ids
,
last_month_
dt
))
inline_ids
,
last_month_
str
))
total_pf_save
=
round
(
sum
([
i
[
"pf_cost"
]
for
i
in
power_factor_results
if
i
[
"pf_cost"
]
and
i
[
"pf_cost"
]
>=
0
]),
...
...
@@ -395,7 +395,6 @@ async def optimization_count_info(company_id: int):
async
with
MysqlUtil
()
as
conn
:
sql
=
"select `score`, `cost_save` from `algo_plsi_result` "
\
"where `inlid` in
%
s and `month` =
%
s"
last_month_str
=
datetime
.
strftime
(
last_month_dt
,
"
%
Y-
%
m"
)
pcvfs
=
await
conn
.
fetchall
(
sql
,
args
=
(
inline_ids
,
last_month_str
))
pcvf_kpi_x_list
=
[
i
[
"score"
]
for
i
in
pcvfs
if
...
...
@@ -429,7 +428,6 @@ async def optimization_count_info(company_id: int):
sql
=
"select `kpi_x`, `save_charge`, `mean_load_factor` "
\
"from `algo_economic_operation_result` where "
\
"`inlid` in
%
s and `month` =
%
s"
last_month_str
=
datetime
.
strftime
(
last_month_dt
,
"
%
Y-
%
m"
)
economic_operations
=
await
conn
.
fetchall
(
sql
,
args
=
(
inline_ids
,
last_month_str
))
economic_kpi_x_list
=
[
...
...
@@ -476,7 +474,6 @@ async def optimization_count_info(company_id: int):
" on a.space_analysis_id=b.id "
"where b.inlid in
%
s and a.month =
%
s and b.valid=1;"
)
last_month_str
=
datetime
.
strftime
(
last_month_dt
,
"
%
Y-
%
m"
)
md_spaces
=
await
conn
.
fetchall
(
sql
,
args
=
(
inline_ids
,
last_month_str
))
md_space_kpi_x_list
=
[
i
[
"kpi_x"
]
for
i
in
md_spaces
if
...
...
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