This commit is contained in:
Àî×ÚÕñ 2022-08-16 17:51:49 +08:00
parent 96fe98db32
commit d44e3ed02d
2 changed files with 13 additions and 19 deletions

View File

@ -110,7 +110,7 @@ async def interview_find(
sql = res['sql']
data = await db.execute(sql)
if not data:
return schemas.Msg(code=-9, msg='无数据', data=None)
return schemas.Msg(code=200, msg='无数据', data=None)
return schemas.Msg(code=200, msg='ok', data=data)
@ -127,7 +127,7 @@ async def interview_home_find(
sql = res['sql']
data = await db.execute(sql)
if not data:
return schemas.Msg(code=-9, msg='无数据', data=None)
return schemas.Msg(code=200, msg='无数据', data=None)
return schemas.Msg(code=200, msg='ok', data=data)
@ -144,7 +144,7 @@ async def interview_screen_find(
sql = res['sql']
data = await db.execute(sql)
if not data:
return schemas.Msg(code=-9, msg='无数据', data=None)
return schemas.Msg(code=200, msg='无数据', data=None)
return schemas.Msg(code=200, msg='ok', data=data)
@ -161,7 +161,7 @@ async def interview_exam_find(
sql = res['sql']
data = await db.execute(sql)
if not data:
return schemas.Msg(code=-9, msg='无数据', data=None)
return schemas.Msg(code=200, msg='无数据', data=None)
return schemas.Msg(code=200, msg='ok', data=data)
@ -190,7 +190,7 @@ async def interview_stage_num(
'10': 0,
}
if not data:
return schemas.Msg(code=-9, msg='无数据', data=res_data)
return schemas.Msg(code=200, msg='无数据', data=res_data)
for i in data.values():
key = str(i['interview_stage'])
if key not in res_data:
@ -212,7 +212,7 @@ async def interview_waite_in_find(
sql = res['sql']
data = await db.execute(sql)
if not data:
return schemas.Msg(code=-9, msg='无数据', data=[])
return schemas.Msg(code=200, msg='无数据', data=[])
# 格式化数据
resdata = chkData(data)
return schemas.Msg(code=200, msg='ok', data=resdata)
@ -503,7 +503,7 @@ async def condition(
data = {'lens': 0,
'data': []
}
return schemas.Msg(code=-9, msg='无数据', data=data)
return schemas.Msg(code=200, msg='无数据', data=data)
datas = []
for i in range(len(df)):
dates = {}
@ -582,7 +582,7 @@ async def download_interview(
interview_sign FROM HR.resumes WHERE toDate(star_time) >= '{data_in.start_time}' and toDate(star_time) <= '{data_in.end_time}'"""
df = await ckdb.query_dataframe(sql)
if df.empty:
return schemas.Msg(code=-9, msg='无数据', data='')
return schemas.Msg(code=200, msg='无数据', data='')
# xlsx表名
xlsx_name = data_in.start_time + '~' + data_in.end_time + '(包含起止日)'
datas = []
@ -616,16 +616,6 @@ 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,

View File

@ -186,10 +186,13 @@ class InterviewDo:
updateStr = ''
whereStr = ''
for key, value in self.data_in.items():
if updateStr:
updateStr += ','
if isinstance(value, str):
updateStr += str(key) + ' = ' + "'" + value + "'" + ' '
continue
updateStr += str(key) + ' = ' + str(value) + ' '
for key, value in self.where.items():
if isinstance(value, str):
whereStr += str(key) + ' = ' + "'" + value + "'" + ' '
@ -339,7 +342,8 @@ class InterviewDo:
findStr = ''
# 面试阶段查询字段
self.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",
"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"]
for fstr in self.find_column: