1
This commit is contained in:
169
_doc/简历存储和分析功能说明.md
Normal file
169
_doc/简历存储和分析功能说明.md
Normal file
@@ -0,0 +1,169 @@
|
||||
# 简历存储和分析功能说明
|
||||
|
||||
## 📋 功能概述
|
||||
|
||||
本功能实现了从在线平台(Boss直聘)获取用户简历数据,并自动存储到数据库,同时使用AI进行智能分析的完整流程。
|
||||
|
||||
## 🔗 数据关联
|
||||
|
||||
- **`pla_account`** 表:存储平台账户信息(设备与平台的绑定关系)
|
||||
- **`resume_info`** 表:存储简历详细信息
|
||||
- **关联关系**:`resume_info.account_id` = `pla_account.id`(自增ID)
|
||||
- **查询逻辑**:通过 `sn_code` + `platform` 查询 `pla_account` 获取 `account_id`
|
||||
|
||||
## 🔧 核心功能
|
||||
|
||||
### 1. 简历数据获取与存储
|
||||
|
||||
**位置**: `api/middleware/job/jobManager.js`
|
||||
|
||||
**主要方法**:
|
||||
- `get_online_resume(sn_code, mqttClient, params)` - 获取在线简历
|
||||
- `saveResumeToDatabase(sn_code, platform, resumeData)` - 保存简历到数据库
|
||||
|
||||
**数据流程**:
|
||||
```
|
||||
MQTT请求 → 获取简历数据 → 解析数据 → 存储到resume_info表 → AI分析 → 更新AI分析字段
|
||||
```
|
||||
|
||||
### 2. 数据映射关系
|
||||
|
||||
#### 从Boss直聘响应到数据库字段的映射
|
||||
|
||||
| Boss直聘字段 | 数据库字段 | 说明 |
|
||||
|-------------|-----------|------|
|
||||
| `baseInfo.name` | `fullName` | 姓名 |
|
||||
| `baseInfo.gender` | `gender` | 性别(1=男,0=女) |
|
||||
| `baseInfo.age` | `age` | 年龄 |
|
||||
| `baseInfo.account` | `phone` | 电话 |
|
||||
| `baseInfo.emailBlur` | `email` | 邮箱 |
|
||||
| `expectList[0].locationName` | `location` | 所在地 |
|
||||
| `educationExpList[0].degreeName` | `education` | 学历 |
|
||||
| `educationExpList[0].major` | `major` | 专业 |
|
||||
| `educationExpList[0].school` | `school` | 毕业院校 |
|
||||
| `educationExpList[0].endYear` | `graduationYear` | 毕业年份 |
|
||||
| `baseInfo.workYearDesc` | `workYears` | 工作年限 |
|
||||
| `workExpList[0].positionName` | `currentPosition` | 当前职位 |
|
||||
| `workExpList[0].companyName` | `currentCompany` | 当前公司 |
|
||||
| `expectList[0].positionName` | `expectedPosition` | 期望职位 |
|
||||
| `expectList[0].salaryDesc` | `expectedSalary` | 期望薪资 |
|
||||
| `expectList[0].locationName` | `expectedLocation` | 期望地点 |
|
||||
| `expectList[0].industryDesc` | `expectedIndustry` | 期望行业 |
|
||||
| `userDesc` | `skillDescription` | 技能描述 |
|
||||
| `projectExpList` | `projectExperience` | 项目经验(JSON) |
|
||||
| `workExpList` | `workExperience` | 工作经历(JSON) |
|
||||
|
||||
### 3. AI智能分析
|
||||
|
||||
**分析维度**:
|
||||
1. **技能标签提取** - 从简历描述中自动提取技术栈
|
||||
2. **优势分析** - 分析候选人的核心优势
|
||||
3. **劣势分析** - 指出需要改进的方面
|
||||
4. **职业建议** - 提供职业发展建议
|
||||
5. **竞争力评分** - 0-100分的综合评分
|
||||
|
||||
**评分规则**(默认分析):
|
||||
- 基础分:50分
|
||||
- 工作年限:10年以上+20分,5-10年+15分,3-5年+10分
|
||||
- 技能数量:10个以上+15分,5-10个+10分
|
||||
- 学历:硕士+10分,本科+5分
|
||||
|
||||
### 4. 技能标签自动提取
|
||||
|
||||
系统会自动从简历描述中提取以下技能标签:
|
||||
|
||||
**前端技术**:
|
||||
- Vue, React, Angular, JavaScript, TypeScript
|
||||
- Webpack, Vite, Redux, MobX
|
||||
- jQuery, Bootstrap, Element UI, Ant Design
|
||||
|
||||
**后端技术**:
|
||||
- Node.js, Python, Java, C#, .NET
|
||||
- Express, Koa, Django, Flask
|
||||
|
||||
**数据库**:
|
||||
- MySQL, MongoDB, Redis
|
||||
|
||||
**其他技术**:
|
||||
- WebRTC, FFmpeg, Canvas, WebSocket
|
||||
- Git, Docker, Kubernetes, AWS, Azure
|
||||
- Selenium, Jest, Mocha, Cypress
|
||||
|
||||
## 📊 数据库表结构
|
||||
|
||||
**表名**: `resume_info`
|
||||
|
||||
**主要字段**:
|
||||
```sql
|
||||
- id: 简历ID(UUID)
|
||||
- sn_code: 设备SN码
|
||||
- platform: 平台(boss/liepin)
|
||||
- fullName: 姓名
|
||||
- gender: 性别
|
||||
- age: 年龄
|
||||
- phone: 电话
|
||||
- email: 邮箱
|
||||
- education: 学历
|
||||
- workYears: 工作年限
|
||||
- expectedPosition: 期望职位
|
||||
- expectedSalary: 期望薪资
|
||||
- skills: 技能标签(JSON)
|
||||
- projectExperience: 项目经验(JSON)
|
||||
- workExperience: 工作经历(JSON)
|
||||
- aiSkillTags: AI提取的技能标签(JSON)
|
||||
- aiStrengths: AI分析的优势
|
||||
- aiWeaknesses: AI分析的劣势
|
||||
- aiCareerSuggestion: AI职业建议
|
||||
- aiCompetitiveness: AI竞争力评分
|
||||
- originalData: 原始数据(JSON)
|
||||
- isActive: 是否活跃
|
||||
- syncTime: 同步时间
|
||||
```
|
||||
|
||||
## 🚀 使用示例
|
||||
|
||||
### 调用方式
|
||||
|
||||
```javascript
|
||||
const jobManager = require('./api/middleware/job/jobManager');
|
||||
|
||||
// 获取在线简历(自动存储和分析)
|
||||
const resumeData = await jobManager.get_online_resume(
|
||||
'GHJU', // 设备SN码
|
||||
mqttClient, // MQTT客户端实例
|
||||
{ platform: 'boss' } // 参数(可选)
|
||||
);
|
||||
```
|
||||
|
||||
### 响应数据示例
|
||||
|
||||
参考文件: `_doc/在线简历响应文本.json`
|
||||
|
||||
## 🔍 日志输出
|
||||
|
||||
系统会输出以下日志信息:
|
||||
|
||||
```
|
||||
[工作管理] 开始获取设备 GHJU 的在线简历
|
||||
[工作管理] 成功获取简历数据: {...}
|
||||
[工作管理] 简历已创建 - ID: xxx-xxx-xxx
|
||||
[工作管理] 开始AI分析简历 - ID: xxx-xxx-xxx
|
||||
[工作管理] AI分析完成 - 竞争力评分: 85
|
||||
[工作管理] 简历数据已保存到数据库
|
||||
```
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
1. **数据安全**: 原始简历数据会完整保存在 `originalData` 字段中
|
||||
2. **去重机制**: 同一设备同一平台只保留一份活跃简历
|
||||
3. **容错处理**: 如果AI分析失败,会使用基于规则的默认分析
|
||||
4. **异步处理**: 简历保存失败不会影响数据返回
|
||||
|
||||
## 📝 后续优化建议
|
||||
|
||||
1. 增加更多平台支持(猎聘、拉勾等)
|
||||
2. 优化AI提示词,提高分析准确度
|
||||
3. 添加简历版本管理功能
|
||||
4. 实现简历对比功能
|
||||
5. 增加简历导出功能(PDF、Word等)
|
||||
|
||||
Reference in New Issue
Block a user