This commit is contained in:
张成
2026-04-08 17:27:40 +08:00
parent f2a8e61016
commit 51bbdacdda
5 changed files with 201 additions and 80 deletions

View File

@@ -341,6 +341,31 @@ class JobManager {
resumeInfo: resumeData
});
// 未通过规则/评分的待投递记录标记为 filtered避免长期 pending
const passedIds = new Set(matchedJobs.map((j) => j.id).filter((id) => id != null));
const notPassedIds = searchedJobs
.map((row) => (row.toJSON ? row.toJSON() : row))
.map((j) => j.id)
.filter((id) => id != null && !passedIds.has(id));
if (notPassedIds.length > 0) {
try {
await job_postings.update(
{ applyStatus: 'filtered' },
{
where: {
id: { [Op.in]: notPassedIds },
sn_code,
platform,
applyStatus: 'pending'
}
}
);
console.log(`[工作管理] 搜索并投递:不符合条件已标记 filtered ${notPassedIds.length}`);
} catch (e) {
console.warn('[工作管理] 标记 filtered 失败:', e.message);
}
}
// 7. 限制投递数量
const jobsToDeliver = matchedJobs.slice(0, maxCount);
console.log(`[工作管理] 匹配到 ${matchedJobs.length} 个职位,将投递 ${jobsToDeliver.length}`);