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