Files
ALL-teach_sys/frontend_化工/extract_project_positions_from_json.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

83 lines
2.8 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
def extract_positions_from_json():
"""从化工项目案例.json提取每个项目的适用岗位"""
# 读取化工项目案例数据
with open('网页未导入数据/化工产业/化工项目案例.json', 'r', encoding='utf-8') as f:
data = json.load(f)
# 读取化工岗位简历数据获取等级映射
with open('网页未导入数据/化工产业/化工岗位简历.json', 'r', encoding='utf-8') as f:
resume_data = json.load(f)
position_levels = {}
for item in resume_data:
position = item.get('岗位名称', '').strip()
level = item.get('岗位等级标签', '').strip()
if position and level:
position_levels[position] = level
print('化工项目案例中的适用岗位(带等级):')
print('=' * 80)
project_positions = {}
for i, project in enumerate(data, 1):
name = project.get('案例名称', '')
positions_str = project.get('适用岗位', '')
# 将岗位字符串分割成列表
if positions_str:
positions = [p.strip() for p in positions_str.replace('', ',').split(',') if p.strip()]
else:
positions = []
# 为每个岗位添加等级
positions_with_level = []
for pos in positions:
# 查找岗位等级
if pos in position_levels:
level = position_levels[pos]
else:
# 根据岗位名称推测等级
if '工程师' in pos:
level = '技术骨干岗'
elif '技术员' in pos or '操作员' in pos or '实验员' in pos:
level = '普通岗'
elif '助理' in pos:
level = '储备干部岗'
else:
level = '技术骨干岗' # 默认
positions_with_level.append({
'position': pos,
'level': level
})
project_positions[i] = {
'name': name,
'positions': positions_with_level
}
print(f'\n项目 {i}: {name}')
print(f' 适用岗位 ({len(positions)}个):')
for p in positions_with_level:
print(f' - {p["position"]} [{p["level"]}]')
return project_positions
def save_positions_data():
"""保存项目岗位数据供后续使用"""
positions_data = extract_positions_from_json()
with open('project_positions_from_json.json', 'w', encoding='utf-8') as f:
json.dump(positions_data, f, ensure_ascii=False, indent=2)
print(f'\n✅ 已保存项目岗位数据到 project_positions_from_json.json')
return positions_data
if __name__ == "__main__":
save_positions_data()