1
This commit is contained in:
@@ -59,27 +59,29 @@ class ChatHandler extends BaseHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 创建沟通指令
|
||||
// 4. 创建自动沟通 AI 指令(内部会先获取列表,再获取详情并自动回复)
|
||||
const chatCommand = {
|
||||
command_type: 'autoChat',
|
||||
command_name: '自动沟通',
|
||||
command_params: JSON.stringify({
|
||||
sn_code,
|
||||
command_type: 'auto_chat_ai',
|
||||
command_name: '自动沟通AI回复',
|
||||
command_params: {
|
||||
platform: platform || accountConfig.platform_type || 'boss',
|
||||
autoReply: chatStrategy.auto_reply || false,
|
||||
replyTemplate: chatStrategy.reply_template || ''
|
||||
}),
|
||||
pageCount: chatStrategy.page_count || 3
|
||||
},
|
||||
priority: config.getTaskPriority('auto_chat') || 6
|
||||
};
|
||||
|
||||
// 5. 执行沟通指令
|
||||
const result = await command.executeCommands(task.id, [chatCommand], this.mqttClient);
|
||||
// 5. 执行指令(任务队列会保证该设备内串行执行,不并发下发指令)
|
||||
const exec_result = await command.executeCommands(task.id, [chatCommand], this.mqttClient);
|
||||
const first = exec_result && Array.isArray(exec_result.results) && exec_result.results[0]
|
||||
? exec_result.results[0].result || {}
|
||||
: {};
|
||||
|
||||
console.log(`[自动沟通] 完成 - 设备: ${sn_code}`);
|
||||
|
||||
return {
|
||||
chatCount: result.chatCount || 0,
|
||||
message: '沟通完成'
|
||||
chatCount: first.replied_count || 0,
|
||||
message: first.message || '自动沟通完成',
|
||||
detail: first
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ class DeviceWorkStatusNotifier {
|
||||
return '投递简历';
|
||||
} else if (commandType === 'searchJobs' || commandName.includes('搜索')) {
|
||||
return `搜索职位: ${parsedParams.keyword || ''}`;
|
||||
} else if (commandType === 'sendChatMessage' || commandName.includes('沟通')) {
|
||||
} else if (commandType === 'send_chat_message' || commandType === 'sendChatMessage' || commandName.includes('沟通')) {
|
||||
return '发送消息';
|
||||
} else if (commandName) {
|
||||
return commandName;
|
||||
|
||||
Reference in New Issue
Block a user