#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json def convert_interview_status(): # 读取土木水利岗位面试状态数据 with open('网页未导入数据/土木水利产业/土木水利岗位面试状态.json', 'r', encoding='utf-8') as f: civil_interview_data = json.load(f) print(f"土木水利面试状态数量: {len(civil_interview_data)}") # 字段映射和状态转换 converted_interviews = [] # 状态映射表 status_mapping = { "Offer已接收": "已收到Offer,请于2天内答复", "面试完成": "等待面试结果,预计3天内有结果", "简历接收": "简历初筛中,预计2天内有结果", "面试日期已过": "面试日期已确定,等待面试", "面试未通过": "面试未通过,岗位内推结束", "HR评估完成": "HR初筛未通过", "复试完成": "复试已完成,等待终面结果", "终面完成": "终面已完成,等待最终结果" } for item in civil_interview_data: # 提取和转换字段 position_name = item.get("查询岗位名称", "") flow_time = item.get("流程时间", "") flow_label = item.get("流程标签", "") # 构建阶段日期字段 stage_date = "" if "Offer" in flow_label: stage_date = f"收到Offer:{flow_time}" elif "面试" in flow_label: if "完成" in flow_label or "已过" in flow_label: stage_date = f"面试结果:{flow_time}" else: stage_date = f"面试日期:{flow_time}" elif "简历" in flow_label or "HR" in flow_label: stage_date = f"简历筛选:{flow_time}" else: stage_date = f"状态更新:{flow_time}" # 获取面试状态描述 interview_status = status_mapping.get(flow_label, item.get("内容", "处理中")) converted_interview = { "查询岗位名称": position_name, "阶段日期": stage_date, "面试状态": interview_status } converted_interviews.append(converted_interview) print(f"转换后的面试状态数量: {len(converted_interviews)}") # 保存转换后的数据 with open('src/data/interviewStatus.json', 'w', encoding='utf-8') as f: json.dump(converted_interviews, f, ensure_ascii=False, indent=2) print("✅ 岗位面试状态数据替换完成") # 显示前几个状态信息 print("\n前5个面试状态:") for i, status in enumerate(converted_interviews[:5]): print(f"{i+1}. {status['查询岗位名称']} - {status['面试状态']}") if __name__ == "__main__": convert_interview_status()