Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
tas_monitor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7db55a2d
authored
Apr 14, 2021
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增空库存空价格率大于90的提示
parent
10418f09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
utils/mongo.py
utils/mongo.py
View file @
7db55a2d
...
...
@@ -117,7 +117,7 @@ class MongoOperator:
def
get_platform_none_data_rate
(
self
):
msg
=
'空数据预警 过去3小时内:
\n
'
demo1
=
'平台:{} 第一次运行,库存空数据率为{:.2f}
%
,价格空数据率为{:.2f}
%
'
demo2
=
'平台:{} 相比上一次监控库存空数据率变化为{:.2f}
%
,价格空数据率变化为{:.2f}
%
'
demo2
=
'平台:{} 相比上一次监控库存空数据率变化为{:.2f}
%
,价格空数据率变化为{:.2f}
%
,当前空库存率为{:.2f}
%
,当前空价格率为{:.2f}
%
,
'
msgs
=
[]
for
plat
in
self
.
colls
:
coll
=
self
.
db
[
plat
]
...
...
@@ -137,13 +137,15 @@ class MongoOperator:
,
"空库存率"
,
stock_rate
,
"空价格率"
,
tiered_rate
,
)
msg_line
=
demo1
.
format
(
plat
,
stock_rate
,
tiered_rate
)
else
:
stock__ontrast_ratio
=
stock_rate
-
old_stock_rate
tiered__ontrast_ratio
=
tiered_rate
-
old_tiered_rate
if
not
-
3
<
stock__ontrast_ratio
<
3
or
not
-
3
<
tiered__ontrast_ratio
<
3
:
msg_line
=
demo2
.
format
(
plat
,
stock__ontrast_ratio
,
tiered__ontrast_ratio
)
stock_ontrast_ratio
=
stock_rate
-
old_stock_rate
tiered_ontrast_ratio
=
tiered_rate
-
old_tiered_rate
if
not
-
3
<
stock_ontrast_ratio
<
3
or
not
-
3
<
tiered_ontrast_ratio
<
3
or
stock_rate
>
90
or
tiered_rate
>
90
:
msg_line
=
demo2
.
format
(
plat
,
stock_ontrast_ratio
,
tiered_ontrast_ratio
,
stock_rate
,
tiered_rate
)
print
(
plat
,
"空库存数量"
,
stock_num
,
"空价格数量"
,
stock_num
,
"总量"
,
total
,
"空库存率"
,
stock_rate
,
"空价格率"
,
tiered_rate
,
"空库存变化率"
,
stock__ontrast_ratio
,
"空价格变化率"
,
tiered__ontrast_ratio
,
)
stock_rate
,
"空价格率"
,
tiered_rate
,
"空库存变化率"
,
stock_ontrast_ratio
,
"空价格变化率"
,
tiered_ontrast_ratio
,
)
glo
.
set_value
(
plat
,
{
"stock"
:
stock_rate
,
"tiered"
:
tiered_rate
})
if
msg_line
:
msgs
.
append
(
msg_line
)
...
...
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