Files
online_sys/frontend_大健康/update_joblevel.py
KQL a7242f0c69 Initial commit: 教务系统在线平台
- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸
- 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB
- 配置完善的.gitignore文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 18:16:55 +08:00

61 lines
2.0 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
print("更新joblevel.json文件...")
# 读取大健康岗位简历数据
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/网页未导入数据/大健康产业/大健康岗位简历.json', 'r', encoding='utf-8') as f:
health_data = json.load(f)
# 读取现有的joblevel.json
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/joblevel.json', 'r', encoding='utf-8') as f:
joblevel = json.load(f)
# 创建新的岗位级别数据
new_data = {
"high": {
"name": "技术主管岗",
"list": []
},
"middle": {
"name": "技术骨干岗",
"list": []
},
"ordinary": {
"name": "基础岗",
"list": []
}
}
# 按级别分组岗位
for item in health_data:
position_info = {
"position_name": item['岗位名称'],
"img": item['简历头像url']
}
level = item['岗位等级标签']
if level == '技术主管岗':
new_data['high']['list'].append(position_info)
elif level == '技术骨干岗':
new_data['middle']['list'].append(position_info)
else: # 基础岗
new_data['ordinary']['list'].append(position_info)
# 备份原文件
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/joblevel.json.backup_health', 'w', encoding='utf-8') as f:
json.dump(joblevel, f, ensure_ascii=False, indent=2)
# 更新joblevel.json
joblevel['data'] = new_data
# 保存更新后的文件
with open('/Users/apple/Documents/cursor/教务系统/frontend_大健康/src/data/joblevel.json', 'w', encoding='utf-8') as f:
json.dump(joblevel, f, ensure_ascii=False, indent=2)
print(f"\n✓ joblevel.json 更新完成!")
print(f" - 技术主管岗: {len(new_data['high']['list'])} 个岗位")
print(f" - 技术骨干岗: {len(new_data['middle']['list'])} 个岗位")
print(f" - 基础岗: {len(new_data['ordinary']['list'])} 个岗位")