From d44e3ed02df58b29089e50652236651f4089dc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80=C3=AE=C3=97=C3=9A=C3=95=C3=B1?= Date: Tue, 16 Aug 2022 17:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E6=9E=902?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/interview.py | 26 ++++++++------------------ models/interview_zsgc.py | 6 +++++- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index 57daca3..e7b4895 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -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, diff --git a/models/interview_zsgc.py b/models/interview_zsgc.py index 7e480af..422b756 100644 --- a/models/interview_zsgc.py +++ b/models/interview_zsgc.py @@ -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: