-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.py
66 lines (62 loc) · 2.63 KB
/
output.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from GlobalVar import InterviewTimeList, InterviewerList, IntervieweeList
import pandas as pd
from datetime import datetime
import os
def outputInterviewerAndStaff():
df = pd.DataFrame(columns=['日期','时间段','姓名', '身份','地点'])
for x in InterviewTimeList:
interviewers = []
# 添加当前时间段的面试官
for y in InterviewerList:
pos = ''
for z in y.interview_time:
if z.interviewTime == x.datetime_str:
pos = z.position
break
if pos != '':
interviewers.append([y.name, pos])
interviewers = sorted(interviewers,key=lambda x: x[1]) #按教室排序
for y in interviewers:
date = x.datetime[0].month.__str__() + '月' + x.datetime[0].day.__str__() + '日'
time_slot = x.datetime[0].strftime("%H") + ':00-' + x.datetime[1].strftime("%H") + ':00'
new_record = {
'日期': date,
'时间段': time_slot,
'姓名': y[0],
'身份':'面试官',
'地点': y[1]
}
df = pd.concat([df, pd.DataFrame([new_record])], ignore_index=True)
# 添加时间段的场务
for y in InterviewerList:
for z in y.staff_time:
if z == x.datetime_str:
date = x.datetime[0].month.__str__() + '月' + x.datetime[0].day.__str__() + '日'
time_slot = x.datetime[0].strftime("%H") + ':00-' + x.datetime[1].strftime("%H") + ':00'
new_record = {
'日期': date,
'时间段': time_slot,
'姓名': y.name,
'身份': '场务',
'地点': x.staff_position
}
df = pd.concat([df, pd.DataFrame([new_record])], ignore_index=True)
df.to_excel(os.path.join('result','面试官安排.xlsx'), index=False)
def outputInterviewee():
'''
输出面试者安排
'''
df = pd.DataFrame(columns=['姓名','学号','电话','邮箱','jAccount','面试时间'])
for x in IntervieweeList:
new_record = {
'姓名': x.name,
'学号': x.id,
'电话': x.tel,
'邮箱': x.email,
'jAccount': x.jaccount,
'面试时间': x.interview_time
}
df = pd.concat([df, pd.DataFrame([new_record])], ignore_index=True)
df.to_excel(os.path.join('result','面试者安排.xlsx'), index=False)
if __name__ == "__main__":
outputInterviewerAndStaff()