This commit is contained in:
张成
2026-04-16 17:39:25 +08:00
parent df0aacc782
commit a45418883c
6 changed files with 212 additions and 63 deletions

View File

@@ -142,6 +142,12 @@ class DeliverHandler extends BaseHandler {
return {
deliveredCount: deliverCommands.length,
filterSummary: {
rawCount: pendingJobs.length,
passedCount: filteredJobs.length,
deliverCount: jobsToDeliver.length,
filteredCount: Math.max(0, pendingJobs.length - filteredJobs.length)
},
...result
};
}

View File

@@ -94,14 +94,16 @@ class JobFilterEngine {
*/
async get_single_job_filter_fail_reason(job, config) {
const j = job;
const title_text = String(j.jobTitle || '').trim() || '未知职位';
const after_salary = this.filterBySalary([j], config);
if (after_salary.length === 0) {
return `薪资不在设定范围(${config.min_salary ?? 0}-${config.max_salary ?? 0}K)`;
const salary_text = String(j.salary || j.salaryDesc || '-');
return `职位「${title_text}」薪资不在设定范围(${config.min_salary ?? 0}-${config.max_salary ?? 0}K),当前薪资: ${salary_text}`;
}
const after_title = this.filterByTitleIncludeKeywords(after_salary, config);
if (after_title.length === 0) {
const kws = (config.title_include_keywords || []).join('、') || '无';
return `职位标题须包含以下关键词之一${kws}`;
return `职位${title_text}」标题未命中必含关键词:${kws}`;
}
const after_kw = this.filterByKeywords(after_title, config);
if (after_kw.length === 0) {
@@ -114,30 +116,30 @@ class JobFilterEngine {
if (match_result && match_result.details && match_result.details.exclude && match_result.details.exclude.matched) {
const hit_keywords = match_result.details.exclude.keywords || [];
if (hit_keywords.length) {
return `命中排除关键词: ${hit_keywords.join('、')}`;
return `职位「${title_text}命中排除关键词: ${hit_keywords.join('、')}`;
}
}
if (match_result && match_result.details && match_result.details.filter && !match_result.details.filter.matched) {
const needed = Array.isArray(config.filter_keywords) ? config.filter_keywords : [];
if (needed.length) {
return `未命中包含关键词: ${needed.join('、')}`;
return `职位「${title_text}未命中包含关键词: ${needed.join('、')}`;
}
}
return '命中排除关键词或未满足包含词规则';
return `职位「${title_text}命中排除关键词或未满足包含词规则`;
}
if (config.filter_inactive_companies) {
const after_act = await this.filterByCompanyActivity(after_kw, config.company_active_days || 7);
if (after_act.length === 0) {
return '公司活跃度不满足配置';
return `职位「${title_text}公司活跃度不满足配置`;
}
}
if (config.deduplicate) {
const after_dedup = this.deduplicateJobs(after_kw);
if (after_dedup.length === 0) {
return '与列表内职位重复(公司+岗位名)';
return `职位「${title_text}与列表内职位重复(公司+岗位名)`;
}
}
return '未通过职位过滤';
return `职位「${title_text}未通过职位过滤`;
}
/**