Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rota
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
刘丙寅
rota
Commits
32da5a5f
Commit
32da5a5f
authored
May 17, 2021
by
刘丙寅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
e458c34e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
rota_gm_new.py
rota_gm_new.py
+20
-18
No files found.
rota_gm_new.py
View file @
32da5a5f
...
...
@@ -8,6 +8,7 @@ def test():
from
datetime
import
date
,
timedelta
r
=
redis
.
Redis
()
today
=
date
.
today
()
today
=
today
+
timedelta
(
days
=-
9
)
format_today
=
today
.
strftime
(
"
%
Y
%
m
%
d"
)
tomorrow
=
today
+
timedelta
(
days
=
1
)
format_tomorrow
=
tomorrow
.
strftime
(
"
%
Y
%
m
%
d"
)
...
...
@@ -29,6 +30,7 @@ def test():
message
=
""
print
(
format_tomorrow
)
print
(
"@@@@"
)
print
(
format_today
)
print
(
days
)
# 如果明天是节假日 今天不是节假日,则进入判断
...
...
@@ -50,7 +52,7 @@ def test():
# redis 存储数据
redis_list
=
r
.
lrange
(
"zhiban"
,
0
,
-
1
)
redis_list
=
[
item
.
decode
()
for
item
in
redis_list
]
print
(
"
*
"
*
100
)
print
(
"
-
"
*
100
)
print
(
redis_list
)
print
(
"*"
*
100
)
www
=
[]
...
...
@@ -62,8 +64,8 @@ def test():
# 取出来名字
for
o
in
range
(
0
,
number
):
print
(
number
)
www
.
append
(
new_list
[
o
])
new_list
.
remove
(
new_list
[
o
])
www
.
append
(
new_list
[
0
])
new_list
.
remove
(
new_list
[
0
])
r
.
delete
(
"zhiban"
)
r
.
rpush
(
"zhiban"
,
*
new_list
)
phone_list
=
[]
...
...
@@ -75,21 +77,21 @@ def test():
print
(
phone_list
)
dd_url
=
"https://oapi.dingtalk.com/robot/send?access_token=062ab7f98f47c85e6c200efd21ae5d532e4f1bbfd6782ae1268b9a1f4d3dc7b9"
text
=
"明日开始休假:休息
%
s 天 值班人员为:
%
s 值班人员记得带 电脑,手机,调通vpn环境"
%
(
number
,
new_www
)
json_text
=
{
"msgtype"
:
"text"
,
"at"
:
{
"atMobiles"
:
phone_list
,
# 变为true 就会@所有人
"isAtAll"
:
False
},
"text"
:
{
"content"
:
text
}
}
requests
.
post
(
url
=
dd_url
,
json
=
json_text
,
verify
=
False
)
#
dd_url = "https://oapi.dingtalk.com/robot/send?access_token=062ab7f98f47c85e6c200efd21ae5d532e4f1bbfd6782ae1268b9a1f4d3dc7b9"
#
text = "明日开始休假:休息 %s 天 值班人员为:%s 值班人员记得带 电脑,手机,调通vpn环境" %(number, new_www)
#
json_text = {
#
"msgtype": "text",
#
"at": {
#
"atMobiles": phone_list,
#
# 变为true 就会@所有人
#
"isAtAll": False
#
},
#
"text": {
#
"content": text
#
}
#
}
#
#
requests.post(url=dd_url, json=json_text, verify=False)
if
__name__
==
'__main__'
:
...
...
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