From af2af42bd5f0d6472daf784b75a38e5d068cf318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80=C3=AE=C3=97=C3=9A=C3=95=C3=B1?= Date: Wed, 17 Aug 2022 14:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/interview.py | 6 ++---- utils/jianli.py | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index ebb904e..cb6303e 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -59,9 +59,6 @@ def chkData(data): if 'owner_name' in res1: key6 = res1['owner_name'] res1['owner_name'] = owner_name_dict.get(key6, '人才库') - if 'education' in res1: - key7 = res1['education'] - res1['education'] = education_dict.get(key7, '大专') if 'mmended_state' in res1: key8 = res1['mmended_state'] res1['mmended_state'] = mmended_state_dict.get(key8, '未推荐') @@ -325,6 +322,7 @@ async def file_to_hw( "notice_state": 1, "pass_why": 0, "pass_text": "", + "now_address": "", "file_url": url, } uid = get_uid() @@ -334,7 +332,7 @@ async def file_to_hw( f" education, work_undergo, project_undergo, work_list, school, at_school, specialty, specialty_do, " \ f"mmended_state, mail, account, id_card, gender, age, gam, interview_state, counts, nation, come_time," \ f" review, upgrade, now_money, men_state, teacher_state, teacher_back, offer_state, offer_exam_state," \ - f" notice_state, pass_why, pass_text, file_url) values" + f" notice_state, pass_why, pass_text, now_address, file_url) values" # 存数据 await db.execute_dict(sql, [data_mode]) resData = {'file_url': url, 'filename': 'hrms/' + filename, 'uid': uid} diff --git a/utils/jianli.py b/utils/jianli.py index d3a6722..1ed79d6 100644 --- a/utils/jianli.py +++ b/utils/jianli.py @@ -10,13 +10,13 @@ from pdf2docx import Converter # 文件路径 schema = ['姓名', '所在地', '户口所在地', '籍贯', '婚姻状况', '民族', '电话', 'tel', '应聘职位', '到岗时间', '学历', '毕业学校', '专业', '期望薪资', - '在校时间', '电子邮箱', '工作经验', 'Email', '性别', '年龄', '身份证号', '技能特长' + '在校时间', '电子邮箱', '工作经验', 'Email', '性别', '年龄', '身份证号', '技能特长', '生日', '现住址' ] -schema_dict = {'姓名': 'name', '所在地': 'account', '户口所在地': 'accounts', '婚姻状况': 'gam', '民族': 'nation', +schema_dict = {'姓名': 'name', '所在地': 'account', '户口所在地': 'accounts', '婚姻状况': 'gam', '民族': 'nation', '生日': 'birthday', '电话': 'phone', '应聘职位': 'job_name', '到岗时间': 'come_time', '学历': 'education', '毕业学校': 'school', '专业': 'specialty', '期望薪资': 'hope_money', '在校时间': 'at_school', '电子邮箱': 'mail', '工作经验': 'work_exp', 'Email': 'mails', '性别': 'gender', '年龄': 'age', '籍贯': 'account', 'tel': 'tels', '身份证号': 'id_card', - '技能特长': 'specialty_do'} + '技能特长': 'specialty_do', '现住址': 'now_address'} # 简历初始文档 data_mode = { @@ -65,6 +65,8 @@ data_mode = { "pass_why": 0, "pass_text": "", "file_url": '', + "now_address": '', + "birthday": '', } @@ -220,6 +222,14 @@ def get_date(schema, dates, schema_dict): clash(date, 'account', 'accounts') # 解决电话冲突的问题 clash(date, 'phone', 'tels') + + work_exp = date['work_exp'] + if 1 <= work_exp < 3: + date['work_exp'] = 1 + if 3 <= work_exp < 5: + date['work_exp'] = 2 + if work_exp >= 5: + date['work_exp'] = 3 return date