Files
ALL-teach_sys/frontend_能源/extract_energy_job_groups.py
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含12个产业的完整教务系统前端代码
- 智能启动脚本 (start-industry.sh)
- 可视化产业导航页面 (index.html)
- 项目文档 (README.md)

优化内容:
- 删除所有node_modules和.yoyo文件夹,从7.5GB减少到2.7GB
- 添加.gitignore文件避免上传不必要的文件
- 自动依赖管理和智能启动系统

产业列表:
1. 文旅产业 (5150)
2. 智能制造 (5151)
3. 智能开发 (5152)
4. 财经商贸 (5153)
5. 视觉设计 (5154)
6. 交通物流 (5155)
7. 大健康 (5156)
8. 土木水利 (5157)
9. 食品产业 (5158)
10. 化工产业 (5159)
11. 能源产业 (5160)
12. 环保产业 (5161)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:14:14 +08:00

82 lines
2.6 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from collections import defaultdict
def extract_job_groups():
"""
从能源岗位简历.json提取所有岗位群并生成面试题数据结构
"""
# 读取能源岗位简历数据
with open("网页未导入数据/能源产业/能源岗位简历.json", 'r', encoding='utf-8') as f:
energy_jobs = json.load(f)
# 按岗位群分组
job_groups = defaultdict(list)
for job in energy_jobs:
group_name = job.get("简历岗位群", "")
if group_name:
job_groups[group_name].append(job)
# 生成industries数据结构
industries = []
group_id = 1
for group_name, jobs in job_groups.items():
industry = {
"id": f"energy_{group_id}",
"name": group_name,
"positions": [],
"questions": [
{
"id": f"group_q{group_id}",
"question": f"# {group_name}面试题",
"subQuestions": []
}
]
}
# 添加该岗位群下的所有岗位
pos_id = 1
for job in jobs:
position = {
"id": f"energy_{group_id}_{pos_id}",
"title": job["岗位名称"],
"level": job.get("岗位等级标签", "基础岗"),
"avatar": job.get("岗位头像", ""),
"department": group_name,
"type": "全职",
"experience": "1-3年",
"education": "大专",
"salary": "8-15K",
"location": "北京",
"updateTime": "2024-01-20",
"description": f"负责{job['岗位名称']}相关工作",
"requirements": []
}
industry["positions"].append(position)
pos_id += 1
industries.append(industry)
group_id += 1
# 输出统计信息
print(f"✅ 找到 {len(job_groups)} 个岗位群")
print("📋 岗位群列表:")
for i, (group_name, jobs) in enumerate(job_groups.items(), 1):
print(f" {i}. {group_name} ({len(jobs)}个岗位)")
# 保存到文件
with open("energy_industries_data.js", 'w', encoding='utf-8') as f:
f.write("// 能源产业岗位群数据\n")
f.write("const industries = ")
f.write(json.dumps(industries, ensure_ascii=False, indent=2))
f.write(";\n\nexport default industries;")
print(f"\n✅ 数据已保存到 energy_industries_data.js")
return industries
if __name__ == "__main__":
extract_job_groups()