From dfb79160df1278c757d55a9874465759f20c96bc Mon Sep 17 00:00:00 2001 From: zk Date: Tue, 14 Jul 2026 14:34:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E7=B1=BB=E5=9E=8B(=E4=B8=89?= =?UTF-8?q?=E7=BA=A7):=20=E5=90=8C=E4=B8=89=E7=BA=A7=3D100=20/=20=E5=90=8C?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=3D90=20/=20=E5=90=8C=E4=B8=80=E7=BA=A7=3D85?= =?UTF-8?q?=20/=20=E4=B8=8D=E7=9B=B8=E5=85=B3=3D10=20=E8=A1=8C=E4=B8=9A(?= =?UTF-8?q?=E4=B8=A4=E7=BA=A7):=20=20=20=20=20=E5=90=8C=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=3D100=20/=20=E5=90=8C=E4=B8=80=E7=BA=A7=3D90=20/=20=E4=B8=8D?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=3D10=20fit=20=3D=20min(100,=20=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E7=B1=BB=E5=9E=8B=E5=88=86=20=C3=97=200.9=20+=20?= =?UTF-8?q?=E8=A1=8C=E4=B8=9A=E5=88=86=20=C3=97=200.6)=20=E6=97=A0=20AI=20?= =?UTF-8?q?=E5=88=86=E6=9E=90=EF=BC=88=E4=B8=A4=E4=B8=AA=E6=96=B9=E5=90=91?= =?UTF-8?q?=E9=83=BD=E7=A9=BA=EF=BC=89=E2=86=92=20=E4=B8=AD=E6=80=A7?= =?UTF-8?q?=E5=88=86=2040?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jiayunet/service/JobMatchService.java | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/manager/src/main/java/org/jiayunet/service/JobMatchService.java b/manager/src/main/java/org/jiayunet/service/JobMatchService.java index 68179d2..2b9d666 100644 --- a/manager/src/main/java/org/jiayunet/service/JobMatchService.java +++ b/manager/src/main/java/org/jiayunet/service/JobMatchService.java @@ -148,37 +148,34 @@ public class JobMatchService { /** * 计算方向适配得分 fitScore(百分制) *

基于 AI 推荐的岗位方向/行业方向与岗位实际类型/公司行业做层级匹配

- *

fitScore = 岗位类型分×70% + 行业分×30%

- *

用户未做过 AI 分析(无 AI 推荐方向)时返回 0

+ *

fitScore = min(100, 岗位类型分×0.9 + 行业分×0.6):两项加法叠加,均强相关时溢出封顶 100

+ *

用户未做过 AI 分析(无任何 AI 推荐方向)时返回中性分 40(方向未知,疑罪从无)

*/ private int calculateFitScore(JobListItemVo job, List aiCategoryIds, List aiIndustryIds, Map categoryMap, Map industryMap) { boolean noCategory = aiCategoryIds == null || aiCategoryIds.isEmpty(); boolean noIndustry = aiIndustryIds == null || aiIndustryIds.isEmpty(); - // 无任何 AI 推荐方向 → 不参与加分 + // 无任何 AI 推荐方向 → 方向未知,给中性分 if (noCategory && noIndustry) { - return 0; + return 40; } - int categoryScore = calculateCategoryFit(aiCategoryIds, job.getCategoryId(), categoryMap); - int industryScore = calculateIndustryFit(aiIndustryIds, job.getCompanyIndustryId(), industryMap); + double categoryContribution = noCategory ? 0 : calculateCategoryFit(aiCategoryIds, job.getCategoryId(), categoryMap) * 0.9; + double industryContribution = noIndustry ? 0 : calculateIndustryFit(aiIndustryIds, job.getCompanyIndustryId(), industryMap) * 0.6; - return (int) Math.round(categoryScore * 0.7 + industryScore * 0.3); + return Math.min(100, (int) Math.round(categoryContribution + industryContribution)); } /** * 计算岗位类型方向匹配分(三级树,取 AI 推荐中的最高分) - *

同三级→100,同二级→70,同一级→30,否则→0

+ *

同三级→100,同二级→90,同一级→85,不相关→10(保底)

*/ private int calculateCategoryFit(List aiCategoryIds, Long jobCategoryId, Map categoryMap) { - if (aiCategoryIds == null || aiCategoryIds.isEmpty() || jobCategoryId == null) { - return 0; - } - JobCategory jobCategory = categoryMap.get(jobCategoryId); + JobCategory jobCategory = jobCategoryId == null ? null : categoryMap.get(jobCategoryId); if (jobCategory == null) { - return 0; + return 10; } - int maxScore = 0; + int maxScore = 10; for (Long aiId : aiCategoryIds) { JobCategory aiCategory = categoryMap.get(aiId); if (aiCategory == null) continue; @@ -186,11 +183,11 @@ public class JobMatchService { if (aiCategory.getId().equals(jobCategory.getId())) { score = 100; } else if (aiCategory.getParentId() != null && aiCategory.getParentId().equals(jobCategory.getParentId())) { - score = 70; + score = 90; } else if (aiCategory.getRootId() != null && aiCategory.getRootId().equals(jobCategory.getRootId())) { - score = 30; + score = 85; } else { - score = 0; + score = 10; } maxScore = Math.max(maxScore, score); if (maxScore == 100) return 100; @@ -200,17 +197,14 @@ public class JobMatchService { /** * 计算行业方向匹配分(两级树,取 AI 推荐中的最高分) - *

同二级→100,同一级→60,否则→0

+ *

同二级→100,同一级→90,不相关→10(保底)

*/ private int calculateIndustryFit(List aiIndustryIds, Long companyIndustryId, Map industryMap) { - if (aiIndustryIds == null || aiIndustryIds.isEmpty() || companyIndustryId == null) { - return 0; - } - Industry companyIndustry = industryMap.get(companyIndustryId); + Industry companyIndustry = companyIndustryId == null ? null : industryMap.get(companyIndustryId); if (companyIndustry == null) { - return 0; + return 10; } - int maxScore = 0; + int maxScore = 10; for (Long aiId : aiIndustryIds) { Industry aiIndustry = industryMap.get(aiId); if (aiIndustry == null) continue; @@ -218,9 +212,9 @@ public class JobMatchService { if (aiIndustry.getId().equals(companyIndustry.getId())) { score = 100; } else if (aiIndustry.getParentId() != null && aiIndustry.getParentId().equals(companyIndustry.getParentId())) { - score = 60; + score = 90; } else { - score = 0; + score = 10; } maxScore = Math.max(maxScore, score); if (maxScore == 100) return 100;