67 lines
2.4 KiB
Python
67 lines
2.4 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
# -*- coding: utf-8 -*-
|
||
|
|
|
||
|
|
import json
|
||
|
|
import os
|
||
|
|
|
||
|
|
def check_interview_job_match():
|
||
|
|
"""
|
||
|
|
检查面试状态数据中的岗位名称是否与joblevel.json和companyJobsNew.json中的岗位一致
|
||
|
|
"""
|
||
|
|
|
||
|
|
# 读取面试状态数据
|
||
|
|
with open("src/data/interviewStatus.json", 'r', encoding='utf-8') as f:
|
||
|
|
interview_data = json.load(f)
|
||
|
|
|
||
|
|
# 读取岗位等级数据
|
||
|
|
with open("src/data/joblevel.json", 'r', encoding='utf-8') as f:
|
||
|
|
joblevel_data = json.load(f)
|
||
|
|
|
||
|
|
# 读取岗位详情数据
|
||
|
|
with open("src/data/companyJobsNew.json", 'r', encoding='utf-8') as f:
|
||
|
|
jobs_data = json.load(f)
|
||
|
|
|
||
|
|
# 提取各文件中的岗位名称
|
||
|
|
interview_positions = set(item["查询岗位名称"] for item in interview_data)
|
||
|
|
|
||
|
|
# 从joblevel.json提取岗位名称
|
||
|
|
joblevel_positions = set()
|
||
|
|
for level in joblevel_data["data"].values():
|
||
|
|
for position in level["list"]:
|
||
|
|
joblevel_positions.add(position["position_name"])
|
||
|
|
|
||
|
|
# 从companyJobsNew.json提取岗位名称
|
||
|
|
jobs_positions = set(job["内推岗位名称"] for job in jobs_data)
|
||
|
|
|
||
|
|
print("=== 数据匹配检查 ===")
|
||
|
|
print(f"面试状态数据: {len(interview_positions)} 个岗位")
|
||
|
|
print(f"岗位等级数据: {len(joblevel_positions)} 个岗位")
|
||
|
|
print(f"岗位详情数据: {len(jobs_positions)} 个岗位")
|
||
|
|
|
||
|
|
print("\n=== 面试状态中的岗位 ===")
|
||
|
|
for pos in sorted(interview_positions):
|
||
|
|
in_joblevel = "✓" if pos in joblevel_positions else "✗"
|
||
|
|
in_jobs = "✓" if pos in jobs_positions else "✗"
|
||
|
|
print(f"{pos} | joblevel: {in_joblevel} | jobs: {in_jobs}")
|
||
|
|
|
||
|
|
# 找到不匹配的岗位
|
||
|
|
not_in_joblevel = interview_positions - joblevel_positions
|
||
|
|
not_in_jobs = interview_positions - jobs_positions
|
||
|
|
|
||
|
|
if not_in_joblevel:
|
||
|
|
print(f"\n❌ 在joblevel.json中找不到的岗位 ({len(not_in_joblevel)} 个):")
|
||
|
|
for pos in sorted(not_in_joblevel):
|
||
|
|
print(f" - {pos}")
|
||
|
|
|
||
|
|
if not_in_jobs:
|
||
|
|
print(f"\n❌ 在companyJobsNew.json中找不到的岗位 ({len(not_in_jobs)} 个):")
|
||
|
|
for pos in sorted(not_in_jobs):
|
||
|
|
print(f" - {pos}")
|
||
|
|
|
||
|
|
if not not_in_joblevel and not not_in_jobs:
|
||
|
|
print("\n✅ 所有岗位名称都匹配!")
|
||
|
|
|
||
|
|
return not_in_joblevel, not_in_jobs
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
check_interview_job_match()
|