1
This commit is contained in:
@@ -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} 个`);
|
||||
|
||||
Reference in New Issue
Block a user