修改技能计算分规则

This commit is contained in:
zk
2026-03-27 10:58:12 +08:00
parent 7c59eecaba
commit 26b88c6412
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -267,7 +267,8 @@ offerpie/back-end
#### 技能维度(Sskill #### 技能维度(Sskill
- 岗位无要求 → 100分 - 岗位无要求 → 100分
- 用户无技能 → 0分 - 用户无技能 → 0分
- 匹配公式:`(匹配数量 / 岗位要求数量) × 100` - 匹配0个 → 0分
- 匹配≥1个 → 30分保底 + 70分按比例:`30 + (匹配数量 / 岗位要求数量) × 70`
### 核心服务 ### 核心服务
- **JobService**client-api):岗位列表查询主流程编排 - **JobService**client-api):岗位列表查询主流程编排
@@ -287,7 +287,7 @@ public class JobMatchService {
/** /**
* 计算技能匹配得分(百分制) * 计算技能匹配得分(百分制)
* <p>岗位无要求→100分,用户无技能→0分,匹配公式:(匹配数量 / 岗位要求数量) * 100</p> * <p>岗位无要求→100分,用户无技能→0分,匹配≥1个→30分保底+70分按比例</p>
*/ */
private int calculateSkillScore(List<Long> jobSkillTagIds, Set<Long> userSkillTagSet) { private int calculateSkillScore(List<Long> jobSkillTagIds, Set<Long> userSkillTagSet) {
if (jobSkillTagIds == null || jobSkillTagIds.isEmpty()) { if (jobSkillTagIds == null || jobSkillTagIds.isEmpty()) {
@@ -297,6 +297,11 @@ public class JobMatchService {
return 0; return 0;
} }
long matchedCount = jobSkillTagIds.stream().filter(userSkillTagSet::contains).count(); long matchedCount = jobSkillTagIds.stream().filter(userSkillTagSet::contains).count();
return (int) Math.round((double) matchedCount / jobSkillTagIds.size() * 100); if (matchedCount == 0) {
return 0;
}
// 匹配≥1个:30分保底 + 70分按比例
double ratio = (double) matchedCount / jobSkillTagIds.size();
return 30 + (int) Math.round(ratio * 70);
} }
} }