From f2de3ae284eccbf857b2cfd467be03512160acb9 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, 18 Oct 2022 11:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E7=AE=80?= =?UTF-8?q?=E5=8E=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/interview.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index 8e28c34..9f6d8fe 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -725,6 +725,7 @@ async def files_to_hw( insert_list = [] # 插入数据 error_files = [] # 解析错误简历文件 error_to_fw_files = [] # 上传失败简历文件 + over_files = [] # 已经检测过的pdf文件 # 简历初始文档 data_mode = { "interview_name": "", @@ -786,6 +787,9 @@ async def files_to_hw( # 附件 if '作品' in file: continue + # 已经检测过 + if file in over_files: + continue try: fn = file_path + '/' + file end_str = file.split('.')[-1].lower() # 文件类型 @@ -968,7 +972,7 @@ async def files_to_hw( break if not user_chk_name: user_chk_name = file.split('.')[0] - files_other = [i for i in file_list if user_chk_name in i and i != file] + files_other = [i for i in file_list if user_chk_name in i.split('.')[0] and i != file.split('.')[0]] # 存在相关附件 if files_other: resume_affix_id = [] @@ -985,7 +989,7 @@ async def files_to_hw( if resume_affix_id: data_mode1['resume_affix_id'] = resume_affix_id insert_list.append(data_mode1) - + over_files.append(file) else: error_to_fw_files.append(file) continue