解析2
This commit is contained in:
parent
5b05652954
commit
96fe98db32
@ -166,20 +166,37 @@ async def interview_exam_find(
|
||||
|
||||
|
||||
# offer阶段查询
|
||||
@router.post("/interview_offer_find")
|
||||
async def interview_offer_find(
|
||||
@router.post("/interview_stage_num")
|
||||
async def interview_stage_num(
|
||||
request: Request,
|
||||
interview: InterviewDo = Depends(InterviewDo),
|
||||
db: CKDrive = Depends(get_ck_db),
|
||||
) -> schemas.Msg:
|
||||
""" interview面试数据offer阶段查询 """
|
||||
await interview.init()
|
||||
res = interview.find_interview_offer_sql()
|
||||
res = interview.find_stage_num_sql()
|
||||
sql = res['sql']
|
||||
data = await db.execute(sql)
|
||||
res_data = {
|
||||
'1': 0,
|
||||
'2': 0,
|
||||
'3': 0,
|
||||
'4': 0,
|
||||
'5': 0,
|
||||
'6': 0,
|
||||
'7': 0,
|
||||
'8': 0,
|
||||
'9': 0,
|
||||
'10': 0,
|
||||
}
|
||||
if not data:
|
||||
return schemas.Msg(code=-9, msg='无数据', data=None)
|
||||
return schemas.Msg(code=200, msg='ok', data=data)
|
||||
return schemas.Msg(code=-9, msg='无数据', data=res_data)
|
||||
for i in data.values():
|
||||
key = str(i['interview_stage'])
|
||||
if key not in res_data:
|
||||
continue
|
||||
res_data[key] = i['value']
|
||||
return schemas.Msg(code=200, msg='ok', data=res_data)
|
||||
|
||||
|
||||
# 待入职阶段查询
|
||||
@ -599,6 +616,16 @@ async def add_remark(
|
||||
return schemas.Msg(code=200, msg='ok', data='')
|
||||
|
||||
|
||||
@router.post("/find_remark")
|
||||
async def find_remark(
|
||||
request: Request,
|
||||
data_in: schemas.FindRemark,
|
||||
db: AsyncIOMotorDatabase = Depends(get_database),
|
||||
) -> schemas.Msg:
|
||||
"""查找备注"""
|
||||
data = await crud.api_interview_remark.get_interview_remarks(db, data_in)
|
||||
return schemas.Msg(code=200, msg='ok', data=data)
|
||||
|
||||
@router.post("/find_remark")
|
||||
async def find_remark(
|
||||
request: Request,
|
||||
|
@ -319,6 +319,20 @@ class InterviewDo:
|
||||
'sql': sql,
|
||||
}
|
||||
|
||||
# 各阶段数量查询
|
||||
def find_stage_num_sql(self):
|
||||
findStr = ''
|
||||
# 面试阶段查询字段
|
||||
self.find_column = ["interview_stage"]
|
||||
for fstr in self.find_column:
|
||||
findStr += fstr + ', '
|
||||
findStr = findStr.strip().strip(',')
|
||||
sql = f"select {findStr},count(*) as value from HR.resumes group by interview_stage"
|
||||
print(sql)
|
||||
return {
|
||||
'sql': sql,
|
||||
}
|
||||
|
||||
# 待入职阶段查询
|
||||
def find_interview_waite_in_sql(self):
|
||||
whereStr = ''
|
||||
|
@ -1,4 +1,4 @@
|
||||
½Ó¿Ú: api/v1/itr/add_remark
|
||||
½Ó¿Ú: api/v1/itr/find_remark
|
||||
|
||||
|
||||
参数:
|
||||
|
Loading…
Reference in New Issue
Block a user