1.
This commit is contained in:
parent
ccd1d7a649
commit
e79f61a6a6
@ -245,19 +245,19 @@ async def interview_insert(
|
|||||||
if data_in.time_type == 'now':
|
if data_in.time_type == 'now':
|
||||||
# 查询返回的数据一共多少条
|
# 查询返回的数据一共多少条
|
||||||
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) == '{times}' ORDER BY event_time"""
|
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) == '{times}' ORDER BY event_time"""
|
||||||
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_name,hr_name,
|
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_names,hr_name,uid,
|
||||||
feedback,interview_name from HR.resumes where {where} and toDate(star_time) == '{times}' ORDER BY event_time
|
feedback,interview_name from HR.resumes where {where} and toDate(star_time) == '{times}' ORDER BY event_time
|
||||||
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
||||||
# 明天及之后的面试
|
# 明天及之后的面试
|
||||||
elif data_in.time_type == 'tomorrow':
|
elif data_in.time_type == 'tomorrow':
|
||||||
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) > '{times}' ORDER BY event_time"""
|
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) > '{times}' ORDER BY event_time"""
|
||||||
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_name,hr_name,
|
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_names,hr_name,uid,
|
||||||
feedback,interview_name from HR.resumes where {where} and toDate(star_time) > '{times}' ORDER BY event_time
|
feedback,interview_name from HR.resumes where {where} and toDate(star_time) > '{times}' ORDER BY event_time
|
||||||
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
||||||
# 昨天及以前的面试
|
# 昨天及以前的面试
|
||||||
else:
|
else:
|
||||||
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) < '{times}' ORDER BY event_time"""
|
len_sql = f"""select uid from HR.resumes where {where} and toDate(star_time) < '{times}' ORDER BY event_time"""
|
||||||
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_name,hr_name,
|
sql = f"""select interview_round,interview_type,star_time,end_time,name,phone,job_names,hr_name,uid,
|
||||||
feedback,interview_name from HR.resumes where {where} and toDate(star_time) < '{times}' ORDER BY event_time
|
feedback,interview_name from HR.resumes where {where} and toDate(star_time) < '{times}' ORDER BY event_time
|
||||||
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
LIMIT 10 OFFSET {(data_in.pages - 1) * 10}"""
|
||||||
if where == '':
|
if where == '':
|
||||||
@ -268,10 +268,32 @@ async def interview_insert(
|
|||||||
len_date = len(df_len)
|
len_date = len(df_len)
|
||||||
df = await ckdb.query_dataframe(sql)
|
df = await ckdb.query_dataframe(sql)
|
||||||
if df.empty:
|
if df.empty:
|
||||||
return schemas.Msg(code=-9, msg='无数据', data='')
|
data = {'lens': 0,
|
||||||
|
'data': []
|
||||||
|
}
|
||||||
|
return schemas.Msg(code=-9, msg='无数据', data=data)
|
||||||
|
datas = []
|
||||||
|
for i in range(len(df)):
|
||||||
|
dates = {}
|
||||||
|
dates['key'] = df['uid'][i]
|
||||||
|
date = {} # 面试信息
|
||||||
|
date['interview_round'] = int(df['interview_round'][i])
|
||||||
|
date['interview_type'] = int(df['interview_type'][i])
|
||||||
|
noe = str(df['end_time'][i]).split(' ')[-1]
|
||||||
|
timess = str(df['star_time'][i]) + '~' + noe
|
||||||
|
date['time'] = timess
|
||||||
|
dates['msg']=date
|
||||||
|
dates['name']=df['name'][i]
|
||||||
|
dates['phone']=df['phone'][i]
|
||||||
|
dates['job_names']=df['job_names'][i]
|
||||||
|
dates['hr_name']=df['hr_name'][i]
|
||||||
|
date1={}
|
||||||
|
date1['type']=int(df['feedback'][i])
|
||||||
|
date1['name']=df['interview_name'][i]
|
||||||
|
dates['type']=date1
|
||||||
|
datas.append(dates)
|
||||||
data = {'lens': len_date,
|
data = {'lens': len_date,
|
||||||
'columns': df.columns.tolist(),
|
'data': datas
|
||||||
'values': df.values.tolist()
|
|
||||||
}
|
}
|
||||||
return schemas.Msg(code=200, msg='ok', data=data)
|
return schemas.Msg(code=200, msg='ok', data=data)
|
||||||
|
|
||||||
@ -449,12 +471,12 @@ async def event_edit(
|
|||||||
# 保存发送邮件的记录
|
# 保存发送邮件的记录
|
||||||
now_time = str(datetime.now()).split('.')[0]
|
now_time = str(datetime.now()).split('.')[0]
|
||||||
await crud.email_record.create(db, schemas.email_record(user_id=data_in.user_id, text=data_in.email_str,
|
await crud.email_record.create(db, schemas.email_record(user_id=data_in.user_id, text=data_in.email_str,
|
||||||
times=now_time,name=data_in.name,state=1))
|
times=now_time, name=data_in.name, state=1,read_status=0,type='email'))
|
||||||
return schemas.Msg(code=200, msg='邮件发送成功', data='')
|
return schemas.Msg(code=200, msg='邮件发送成功', data='')
|
||||||
except Exception:
|
except Exception:
|
||||||
now_time = str(datetime.now()).split('.')[0]
|
now_time = str(datetime.now()).split('.')[0]
|
||||||
await crud.email_record.create(db, schemas.email_record(user_id=data_in.user_id, text=data_in.email_str,
|
await crud.email_record.create(db, schemas.email_record(user_id=data_in.user_id, text=data_in.email_str,
|
||||||
times=now_time,name=data_in.name,state=0))
|
times=now_time, name=data_in.name, state=0,read_status=0,type='email'))
|
||||||
return schemas.Msg(code=200, msg='邮件发送失败', data='')
|
return schemas.Msg(code=200, msg='邮件发送失败', data='')
|
||||||
|
|
||||||
|
|
||||||
@ -664,8 +686,8 @@ async def event_edit(
|
|||||||
))
|
))
|
||||||
if df['mail'][0] != '':
|
if df['mail'][0] != '':
|
||||||
# 发送邮件给面试者通知面试
|
# 发送邮件给面试者通知面试
|
||||||
msg=f"""{df['name'][0]},您好\n\n感谢关注乐谷在线科技有限公司!请于{df['star_time'][0]}到公司参见面试。\n联系人:{data_in.hr_name}\n联系电话:{data_in.hr_phone}\n联系邮箱:{
|
msg = f"""{df['name'][0]},您好\n\n感谢关注乐谷在线科技有限公司!请于{df['star_time'][0]}到公司参见面试。\n联系人:{data_in.hr_name}\n联系电话:{data_in.hr_phone}\n联系邮箱:{
|
||||||
data_in.hr_email}\n\n如有问题请用以上联系方式及时与我们沟通,谢谢!\n(系统邮件,请勿回复)
|
data_in.hr_email}\n\n如有问题请用以上联系方式及时与我们沟通,谢谢!\n(系统邮件,请勿回复)
|
||||||
"""
|
"""
|
||||||
send_str_mail(msg, df['mail'][0])
|
send_str_mail(msg, df['mail'][0])
|
||||||
return schemas.Msg(code=200, msg='ok', data='')
|
return schemas.Msg(code=200, msg='ok', data='')
|
||||||
|
@ -7,6 +7,8 @@ class email_record(BaseModel):
|
|||||||
text: str # 邮件的文本内容
|
text: str # 邮件的文本内容
|
||||||
times: str # 发送邮件的时间
|
times: str # 发送邮件的时间
|
||||||
state: int # 邮件是否发送成功
|
state: int # 邮件是否发送成功
|
||||||
|
read_status:int #是否已读
|
||||||
|
type: str
|
||||||
|
|
||||||
|
|
||||||
class get_email_record(BaseModel):
|
class get_email_record(BaseModel):
|
||||||
|
@ -210,4 +210,5 @@ def send_dates(content,userid_list):
|
|||||||
requests.post(url=url, params=query, data=json_data)
|
requests.post(url=url, params=query, data=json_data)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
pass
|
a=get_redis_alluid()
|
||||||
|
print(a)
|
Loading…
Reference in New Issue
Block a user