1.简历模糊查询
This commit is contained in:
parent
d649bce2bd
commit
a510529e15
@ -101,7 +101,8 @@ def chkData(data):
|
|||||||
for index, i in enumerate(work_list):
|
for index, i in enumerate(work_list):
|
||||||
if index == 0:
|
if index == 0:
|
||||||
continue
|
continue
|
||||||
if int(i['time'].split('-')[0].replace('.', '').replace('/', '')) > int(work_list[true_index]['time'].split('-')[0].replace('.', '').replace('/', '')):
|
if int(i['time'].split('-')[0].replace('.', '').replace('/', '')) > int(
|
||||||
|
work_list[true_index]['time'].split('-')[0].replace('.', '').replace('/', '')):
|
||||||
true_index = index
|
true_index = index
|
||||||
work_dict = work_list[true_index]
|
work_dict = work_list[true_index]
|
||||||
work_list = [work_dict]
|
work_list = [work_dict]
|
||||||
@ -136,7 +137,7 @@ def chkData(data):
|
|||||||
remembrance = []
|
remembrance = []
|
||||||
res1['remembrance'] = remembrance
|
res1['remembrance'] = remembrance
|
||||||
if 'education' in res1:
|
if 'education' in res1:
|
||||||
education=res1['education']
|
education = res1['education']
|
||||||
res1['education'] = education_dict[education]
|
res1['education'] = education_dict[education]
|
||||||
res_data.append(res1)
|
res_data.append(res1)
|
||||||
return res_data
|
return res_data
|
||||||
@ -543,8 +544,8 @@ async def condition(
|
|||||||
str_s = f"{k} = {v}"
|
str_s = f"{k} = {v}"
|
||||||
strs.append(str_s)
|
strs.append(str_s)
|
||||||
else:
|
else:
|
||||||
if k in ['hr_id','interview_id'] and v != '':
|
if k in ['hr_id', 'interview_id'] and v != '':
|
||||||
str_s=f"{k} like '%{v}%'"
|
str_s = f"{k} like '%{v}%'"
|
||||||
else:
|
else:
|
||||||
str_s = f"{k} = '{v}'"
|
str_s = f"{k} = '{v}'"
|
||||||
strs.append(str_s)
|
strs.append(str_s)
|
||||||
@ -1784,7 +1785,7 @@ async def head_to_hw(
|
|||||||
# 地址
|
# 地址
|
||||||
url = res.body.objectUrl
|
url = res.body.objectUrl
|
||||||
resData = {'file_url': url, 'filename': 'hrms/user_icon/' + filename}
|
resData = {'file_url': url, 'filename': 'hrms/user_icon/' + filename}
|
||||||
return schemas.Msg(code=0, msg='ok', data=resData)
|
return schemas.Msg(code=200, msg='ok', data=resData)
|
||||||
else:
|
else:
|
||||||
# print('errorCode:', res.errorCode)
|
# print('errorCode:', res.errorCode)
|
||||||
# print('errorMessage:', res.errorMessage)
|
# print('errorMessage:', res.errorMessage)
|
||||||
@ -1792,4 +1793,39 @@ async def head_to_hw(
|
|||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
return schemas.Msg(code=400, msg='上传华为云失败', data=None)
|
return schemas.Msg(code=400, msg='上传华为云失败', data=None)
|
||||||
|
|
||||||
|
|
||||||
|
# 候选人管理,模糊查询
|
||||||
|
@router.post("/find_like")
|
||||||
|
async def find_like(
|
||||||
|
request: Request,
|
||||||
|
data_in: schemas.find_like,
|
||||||
|
ckdb: CKDrive = Depends(get_ck_db),
|
||||||
|
current_user: schemas.UserDB = Depends(deps.get_current_user)
|
||||||
|
) -> schemas.Msg:
|
||||||
|
find_column = ["uid", "age", "gender", "at_school", "name", "event_time", "owner_name", "education",
|
||||||
|
"school", "specialty", "interview_name", "mmended_state", "work_list", "work_exp",
|
||||||
|
"graduate_time",
|
||||||
|
"job_name", "feedback", "interview_round", "interview_state", "interview_stage", "pass_why",
|
||||||
|
"pass_text"]
|
||||||
|
find_columns=','.join(find_column)
|
||||||
|
if data_in.date != {}:
|
||||||
|
strs = []
|
||||||
|
for k, v in data_in.date.items():
|
||||||
|
if v != '':
|
||||||
|
str_s = f"{k} like '%{v}%'"
|
||||||
|
strs.append(str_s)
|
||||||
|
where = ' and '.join(strs)
|
||||||
|
sql = f"""
|
||||||
|
select {find_columns} from HR.resumes where interview_stage = '{data_in.interview_stage}' and {where}
|
||||||
|
"""
|
||||||
|
else:
|
||||||
|
sql = f"""
|
||||||
|
select {find_columns} from HR.resumes where interview_stage = '{data_in.interview_stage}'
|
||||||
|
"""
|
||||||
|
data = await ckdb.execute(sql)
|
||||||
|
if not data:
|
||||||
|
return schemas.Msg(code=-9, msg='无数据', data='')
|
||||||
|
res=chkData(data)
|
||||||
|
return schemas.Msg(code=200, msg='ok', data=res)
|
||||||
|
@ -341,3 +341,10 @@ api:/api/v1/itr/send_interviewee
|
|||||||
#头像上传到华为云
|
#头像上传到华为云
|
||||||
api:/api/v1/itr/head_to_hw
|
api:/api/v1/itr/head_to_hw
|
||||||
请求方式:post
|
请求方式:post
|
||||||
|
|
||||||
|
# 候选人管理,模糊查询
|
||||||
|
api:/api/v1/itr/find_like
|
||||||
|
请求方式:post
|
||||||
|
参数:
|
||||||
|
interview_stage: str # 简历阶段
|
||||||
|
date: dict # 查询条件
|
@ -150,7 +150,10 @@ class add_inter(BaseModel):
|
|||||||
uid: str # 求职者uid
|
uid: str # 求职者uid
|
||||||
user_id: List[str] # 面试官的钉钉id
|
user_id: List[str] # 面试官的钉钉id
|
||||||
star_time: str # 面试开始时间
|
star_time: str # 面试开始时间
|
||||||
end_time:str # 面试结束时间
|
end_time: str # 面试结束时间
|
||||||
hr_user: List[str] # HR的钉钉id
|
hr_user: List[str] # HR的钉钉id
|
||||||
|
|
||||||
|
|
||||||
|
class find_like(BaseModel):
|
||||||
|
interview_stage: str # 简历阶段
|
||||||
|
date: dict # 查询条件
|
||||||
|
Loading…
Reference in New Issue
Block a user