This commit is contained in:
张成
2026-04-08 14:09:26 +08:00
parent e3d14dd637
commit 21fe005c19
7 changed files with 62 additions and 151 deletions

View File

@@ -89,17 +89,9 @@ class DeliverHandler extends BaseHandler {
mqttClient: this.mqttClient
});
// 6. 下发 get_job_list 拉取职位列表tabLabel 切换期望 tabjob_type_id 随指令下发供设备使用
// 6. 下发 get_job_list与前端一致command 只带 pageCount + tabLabel设备端不接收 keyword/job_type_id
const tabLabel = resume.deliver_tab_label || '';
await this.getJobList(
sn_code,
platform,
pageCount,
task.id,
tabLabel,
accountConfig.job_type_id,
accountConfig.keyword
);
await this.getJobList(sn_code, platform, pageCount, task.id, tabLabel);
// 7. 从数据库获取待投递职位
const pendingJobs = await this.getPendingJobs(sn_code, platform, actualMaxCount * 3);
@@ -114,8 +106,9 @@ class DeliverHandler extends BaseHandler {
// 8. 合并过滤配置
const filterConfig = this.mergeFilterConfig(deliverConfig, filterRules, jobTypeConfig);
// 9. 过滤已投递的公司
const recentCompanies = await this.getRecentDeliveredCompanies(sn_code, 30);
// 9. 过滤已投递的公司repeat_deliver_days 由投递配置给出,缺省 30上限 365
const repeatDeliverDays = Math.min(365, Math.max(1, Number(deliverConfig.repeat_deliver_days) || 30));
const recentCompanies = await this.getRecentDeliveredCompanies(sn_code, repeatDeliverDays);
// 10. 过滤 + 评分 + 按 60 分阈值筛(入口在 jobFilterEngine便于阅读
const filteredJobs = await jobFilterEngine.filterAndScoreJobsForDeliver(
@@ -281,28 +274,16 @@ class DeliverHandler extends BaseHandler {
}
/**
* 下发 get_job_list 命令拉取职位列表
* @param {string} tabLabel - 投递用期望标签文案,对应 resume_info.deliver_tab_labelget_job_list 会按此选择 tab
* @param {number} jobTypeId - 职位类型 ID随指令下发供设备使用
* 下发 get_job_list 命令拉取职位列表command_params 与前端约定pageCount、tabLabel + sn_code、platform
*/
async getJobList(sn_code, platform, pageCount, taskId, tabLabel = '', jobTypeId = null, accountKeyword = '') {
async getJobList(sn_code, platform, pageCount, taskId, tabLabel = '') {
const label = tabLabel != null && String(tabLabel).trim() !== '' ? String(tabLabel).trim() : '';
const accKw = accountKeyword != null && String(accountKeyword).trim() !== '' ? String(accountKeyword).trim() : '';
// 与 jobManager 一致:优先期望职位文案,其次账户搜索词,用于 job_postings.keyword
const keyword = label || accKw;
const params = {
sn_code,
platform,
pageCount,
keyword
...(label ? { tabLabel: label } : {})
};
if (label) {
params.tabLabel = label;
}
if (jobTypeId != null && jobTypeId !== '') {
params.job_type_id = jobTypeId;
}
const getJobListCommand = {
command_type: 'get_job_list',
command_name: '获取职位列表',