Commit e458c34e authored by 刘丙寅's avatar 刘丙寅

自动分配用户

parent 84f3c3b0
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="a188f8e8-7383-4735-a16a-e71d8f97fff3" name="Default Changelist" comment=""> <list default="true" id="a188f8e8-7383-4735-a16a-e71d8f97fff3" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/peizhi.py" beforeDir="false" afterPath="$PROJECT_DIR$/peizhi.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/rota_gm_new.py" beforeDir="false" afterPath="$PROJECT_DIR$/rota_gm_new.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/rota_gm.py" beforeDir="false" afterPath="$PROJECT_DIR$/rota_gm.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
...@@ -14,7 +13,7 @@ ...@@ -14,7 +13,7 @@
</component> </component>
<component name="CoverageDataManager"> <component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/rota$demo.coverage" NAME="demo Coverage Results" MODIFIED="1620285725994" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/rota$demo.coverage" NAME="demo Coverage Results" MODIFIED="1620285725994" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/rota$rota_gm_new.coverage" NAME="rota_gm_new Coverage Results" MODIFIED="1620282120045" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/rota$rota_gm_new.coverage" NAME="rota_gm_new Coverage Results" MODIFIED="1620461959785" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/rota$rota_gm.coverage" NAME="rota_gm Coverage Results" MODIFIED="1619690148319" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/rota$rota_gm.coverage" NAME="rota_gm Coverage Results" MODIFIED="1619690148319" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
...@@ -22,8 +21,8 @@ ...@@ -22,8 +21,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/rota_gm.py"> <entry file="file://$PROJECT_DIR$/rota_gm.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="575"> <state relative-caret-position="529">
<caret line="25" column="40" lean-forward="true" selection-start-line="25" selection-start-column="40" selection-end-line="25" selection-end-column="40" /> <caret line="25" column="40" selection-start-line="25" selection-start-column="40" selection-end-line="25" selection-end-column="40" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
</folding> </folding>
...@@ -34,8 +33,8 @@ ...@@ -34,8 +33,8 @@
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/rota_gm_new.py"> <entry file="file://$PROJECT_DIR$/rota_gm_new.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253"> <state relative-caret-position="547">
<caret line="11" column="39" selection-start-line="11" selection-start-column="39" selection-end-line="11" selection-end-column="39" /> <caret line="82" column="40" lean-forward="true" selection-start-line="82" selection-start-column="40" selection-end-line="82" selection-end-column="40" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
</folding> </folding>
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
<entry file="file://$PROJECT_DIR$/peizhi.py"> <entry file="file://$PROJECT_DIR$/peizhi.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="368"> <state relative-caret-position="368">
<caret line="16" column="19" lean-forward="true" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" /> <caret line="16" column="19" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -70,6 +69,7 @@ ...@@ -70,6 +69,7 @@
<find>element.xpath('//div[@class=&quot;wnrl_riqi&quot;]')</find> <find>element.xpath('//div[@class=&quot;wnrl_riqi&quot;]')</find>
<find>ran</find> <find>ran</find>
<find>range</find> <find>range</find>
<find>18646292152</find>
</findStrings> </findStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
...@@ -109,6 +108,7 @@ ...@@ -109,6 +108,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</list> </list>
</option> </option>
</component> </component>
<component name="RunManager" selected="Python.demo"> <component name="RunManager" selected="Python.rota_gm_new">
<configuration name="demo" type="PythonConfigurationType" factoryName="Python" temporary="true"> <configuration name="demo" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="rota" /> <module name="rota" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
...@@ -198,8 +198,8 @@ ...@@ -198,8 +198,8 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Python.demo" />
<item itemvalue="Python.rota_gm_new" /> <item itemvalue="Python.rota_gm_new" />
<item itemvalue="Python.demo" />
<item itemvalue="Python.rota_gm" /> <item itemvalue="Python.rota_gm" />
</list> </list>
</recent_temporary> </recent_temporary>
...@@ -216,7 +216,8 @@ ...@@ -216,7 +216,8 @@
<updated>1619664045043</updated> <updated>1619664045043</updated>
<workItem from="1619664053864" duration="11284000" /> <workItem from="1619664053864" duration="11284000" />
<workItem from="1619763908943" duration="12423000" /> <workItem from="1619763908943" duration="12423000" />
<workItem from="1620269647785" duration="9774000" /> <workItem from="1620269647785" duration="10899000" />
<workItem from="1620460883656" duration="1048000" />
</task> </task>
<task id="LOCAL-00001" summary="修改文案和时间"> <task id="LOCAL-00001" summary="修改文案和时间">
<created>1619687262591</created> <created>1619687262591</created>
...@@ -239,11 +240,18 @@ ...@@ -239,11 +240,18 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1619690050131</updated> <updated>1619690050131</updated>
</task> </task>
<option name="localTasksCounter" value="4" /> <task id="LOCAL-00004" summary="自动分配用户">
<created>1620287097928</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1620287097928</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="33481000" /> <option name="totallyTimeSpent" value="35654000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
...@@ -258,7 +266,7 @@ ...@@ -258,7 +266,7 @@
<frame x="1440" y="-180" width="1920" height="1080" extended-state="0" /> <frame x="1440" y="-180" width="1920" height="1080" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.1341853" /> <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13525027" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" /> <window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
...@@ -288,7 +296,8 @@ ...@@ -288,7 +296,8 @@
<MESSAGE value="修改文案和时间" /> <MESSAGE value="修改文案和时间" />
<MESSAGE value="修改代码逻辑" /> <MESSAGE value="修改代码逻辑" />
<MESSAGE value="完善代码逻辑" /> <MESSAGE value="完善代码逻辑" />
<option name="LAST_COMMIT_MESSAGE" value="完善代码逻辑" /> <MESSAGE value="自动分配用户" />
<option name="LAST_COMMIT_MESSAGE" value="自动分配用户" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/venv/lib/python3.7/site-packages/requests/adapters.py"> <entry file="file://$PROJECT_DIR$/venv/lib/python3.7/site-packages/requests/adapters.py">
...@@ -495,27 +504,27 @@ ...@@ -495,27 +504,27 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/peizhi.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="368">
<caret line="16" column="19" lean-forward="true" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/rota_gm.py"> <entry file="file://$PROJECT_DIR$/rota_gm.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="575"> <state relative-caret-position="529">
<caret line="25" column="40" lean-forward="true" selection-start-line="25" selection-start-column="40" selection-end-line="25" selection-end-column="40" /> <caret line="25" column="40" selection-start-line="25" selection-start-column="40" selection-end-line="25" selection-end-column="40" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/peizhi.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="368">
<caret line="16" column="19" selection-start-line="16" selection-start-column="19" selection-end-line="16" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/rota_gm_new.py"> <entry file="file://$PROJECT_DIR$/rota_gm_new.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253"> <state relative-caret-position="547">
<caret line="11" column="39" selection-start-line="11" selection-start-column="39" selection-end-line="11" selection-end-column="39" /> <caret line="82" column="40" lean-forward="true" selection-start-line="82" selection-start-column="40" selection-end-line="82" selection-end-column="40" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
</folding> </folding>
......
...@@ -35,12 +35,17 @@ def test(): ...@@ -35,12 +35,17 @@ def test():
if int(format_tomorrow) in days and int(format_today) not in days: if int(format_tomorrow) in days and int(format_today) not in days:
# 循环判断接下来的时间,看这个假期有多长 # 循环判断接下来的时间,看这个假期有多长
for i in range(1,10): for i in range(1,10):
print("*"*100)
print(i) print(i)
print("*" * 100)
dayday = today + timedelta(days=i) dayday = today + timedelta(days=i)
dayday = int(dayday.strftime("%Y%m%d")) dayday = int(dayday.strftime("%Y%m%d"))
# 下一个是工作日 则跳出循环,以获得一共多长假期 # 下一个是工作日 则跳出循环,以获得一共多长假期
if dayday not in days: if dayday not in days:
break break
print("休息天数:")
number = i-1
print(number)
# redis 存储数据 # redis 存储数据
redis_list = r.lrange("zhiban", 0, -1) redis_list = r.lrange("zhiban", 0, -1)
...@@ -55,21 +60,23 @@ def test(): ...@@ -55,21 +60,23 @@ def test():
else: else:
new_list = redis_list + peizhi.Personnel_list_new new_list = redis_list + peizhi.Personnel_list_new
# 取出来名字 # 取出来名字
for o in range(0, i): for o in range(0, number):
print(i) print(number)
www.append(new_list[o]) www.append(new_list[o])
new_list.remove(new_list[o]) new_list.remove(new_list[o])
r.delete("zhiban") r.delete("zhiban")
r.rpush("zhiban", *new_list)
phone_list = [] phone_list = []
for i in new_list: for i in www:
phone = peizhi.Personnel_list_1.get(i) phone = peizhi.Personnel_list_1.get(i)
phone_list.append(phone) phone_list.append(phone)
new_www = ' '.join(www) new_www = ' '.join(www)
print(new_www) print(new_www)
r.rpush("zhiban", *new_list) print(phone_list)
dd_url = "https://oapi.dingtalk.com/robot/send?access_token=062ab7f98f47c85e6c200efd21ae5d532e4f1bbfd6782ae1268b9a1f4d3dc7b9" dd_url = "https://oapi.dingtalk.com/robot/send?access_token=062ab7f98f47c85e6c200efd21ae5d532e4f1bbfd6782ae1268b9a1f4d3dc7b9"
text = "明日开始休假:休息 %s 天 值班人员为:%s 值班人员记得带 电脑,手机,调通vpn环境" %(i, new_www) text = "明日开始休假:休息 %s 天 值班人员为:%s 值班人员记得带 电脑,手机,调通vpn环境" %(number, new_www)
json_text = { json_text = {
"msgtype": "text", "msgtype": "text",
"at": { "at": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment