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
965d0c74
authored
Nov 21, 2019
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Plain Diff
update pep8
parents
8911f4dc
34df6cbc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
utils/mongo.py
utils/mongo.py
View file @
965d0c74
...
...
@@ -52,6 +52,8 @@ class MongoOperator:
ts
=
int
(
time
.
time
())
-
3600
*
72
# 72h
elif
plat
in
(
'microchip'
,
'heilind'
,
'element14'
,
'chip1stop'
,
'future'
):
ts
=
int
(
time
.
time
())
-
3600
*
24
# 24h
elif
plat
in
(
"richardsonrfpd"
,):
ts
=
int
(
time
.
time
())
-
3600
*
96
# 96h
else
:
ts
=
int
(
time
.
time
())
-
3600
*
48
# 48
return
ts
...
...
@@ -122,16 +124,15 @@ class MongoOperator:
old_tiered_rate
=
glo
.
get_value
(
plat
)[
"tiered"
]
if
glo
.
get_value
(
plat
)
else
0
if
stock_rate
>=
10
or
tiered_rate
>=
10
:
msg_line
=
""
if
old_stock_rate
==
0
:
if
old_stock_rate
==
0
or
old_tiered_rate
==
0
:
print
(
plat
,
"空库存数量"
,
stock_num
,
"空价格数量"
,
stock_num
,
"总量"
,
total
,
"空库存率"
,
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
-
10
<
stock__ontrast_ratio
<
10
or
not
-
10
<
tiered__ontrast_ratio
<
10
:
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
)
print
(
plat
,
"空库存数量"
,
stock_num
,
"空价格数量"
,
stock_num
,
"总量"
,
total
,
"空库存率"
,
stock_rate
,
"空价格率"
,
tiered_rate
,
"空库存变化率"
,
stock__ontrast_ratio
,
"空价格变化率"
,
tiered__ontrast_ratio
,
)
...
...
@@ -143,3 +144,5 @@ class MongoOperator:
print
(
plat
,
"空库存数量"
,
stock_num
,
"空价格数量"
,
stock_num
,
"总量"
,
total
)
if
msgs
:
return
msg
else
:
return
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