lcrm-business-record
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese场景2:商务记录填写
Scenario 2: Business Record Filling
目标
Goal
销售输入自然语言后,自动整理并创建商务记录。
如果信息缺失,先提醒补充。
提交前必须让用户确认。
注意:商务记录查询功能已移至 lcrm-search skill,本 skill 仅负责创建商务记录。
After the sales team inputs natural language, automatically organize and create business records.
If any information is missing, remind the user to supplement it first.
Must get user confirmation before submission.
Note: The business record query function has been moved to the lcrm-search skill; this skill is only responsible for creating business records.
脚本入口
Script Entry
- 主脚本:
node scripts/business-record.mjs <action> [options] - 环境变量:
- 必填:
LCRM_API_KEY - 可选:(默认
LCRM_BASE_URL)https://crm.langcore.net
- 必填:
- Main script:
node scripts/business-record.mjs <action> [options] - Environment variables:
- Required:
LCRM_API_KEY - Optional: (default
LCRM_BASE_URL)https://crm.langcore.net
- Required:
目标接口
Target API
POST /api/business-records
请求体关键字段:
- 必填:
- 或
customerId(二选一,销售场景优先leadId)customerId - (枚举)
followUpType contactedPerson- (去 HTML 后至少 10 个字)
description
- 可选:
recordTimeopportunityIdopportunityStatusestimatedCloseDateactualCloseDateattachments
followUpType微信电话线上会议邮件现场拜访商务活动其他
POST /api/business-records
Key fields in the request body:
- Required:
- or
customerId(either one is required;leadIdis preferred in sales scenarios)customerId - (enumeration)
followUpType contactedPerson- (at least 10 characters after removing HTML)
description
- Optional:
recordTimeopportunityIdopportunityStatusestimatedCloseDateactualCloseDateattachments
followUpTypeWeChatPhone CallOnline MeetingEmailOn-site VisitBusiness EventOther
必须执行的流程
Mandatory Process
- 解析用户输入,抽取:
- 客户名称
- 联系人名称
- 跟进类型(若无法判断先置空)
- 记录内容
- 客户名称转 ID:
- 脚本:
node scripts/business-record.mjs find-customer --company-name "<客户名>" --limit 5 - 无结果:告知客户不存在并让用户补充准确名称。
- 多结果:列候选让用户确认唯一客户。
- 脚本:
- 联系人校验(建议):
- 脚本:,检查联系人是否存在。
node scripts/business-record.mjs customer-detail --customer-id "<customerId>" - 若未命中,不阻断,但提示"联系人未在系统中匹配到,将按文本写入 contactedPerson"。
- 脚本:
- 组装 payload 并做本地校验:
- 长度 >= 10
description - 必须在枚举中
followUpType
- 提交前确认(强制):
- 输出确认卡片,至少包含:
- + 客户名
customerId contactedPersonfollowUpType- 摘要
description - (若为空说明"默认当前时间")
recordTime
- 仅当用户明确回复"确认/提交/是"再执行 POST。
- 输出确认卡片,至少包含:
- 提交并回传结果:
- 脚本:或
node scripts/business-record.mjs create --payload '<JSON>'--payload-file <file> - 成功:返回 与关键字段。
id/recordTime - 失败:透出后端错误并给下一步补充建议。
- 脚本:
- Parse user input and extract:
- Customer name
- Contact person name
- Follow-up type (leave blank if unable to determine)
- Record content
- Convert customer name to ID:
- Script:
node scripts/business-record.mjs find-customer --company-name "<customer name>" --limit 5 - No results: Inform the user that the customer does not exist and ask for the accurate name.
- Multiple results: List candidates and let the user confirm the unique customer.
- Script:
- Contact person verification (recommended):
- Script: to check if the contact person exists.
node scripts/business-record.mjs customer-detail --customer-id "<customerId>" - If no match is found, do not block the process, but prompt: "The contact person was not matched in the system, and will be written to contactedPerson as text."
- Script:
- Assemble payload and perform local validation:
- length >= 10
description - must be in the enumeration
followUpType
- Confirm before submission (mandatory):
- Output a confirmation card that includes at least:
- + customer name
customerId contactedPersonfollowUpType- Summary of
description - (if blank, note "Default to current time")
recordTime
- Only execute the POST request when the user explicitly replies with "Confirm/Submit/Yes".
- Output a confirmation card that includes at least:
- Submit and return results:
- Script: or
node scripts/business-record.mjs create --payload '<JSON>'--payload-file <file> - Success: Return and key fields.
id/recordTime - Failure: Reveal the backend error and provide suggestions for next steps.
- Script:
命令示例
Command Example
bash
node scripts/business-record.mjs create \
--customer-id "<customerId>" \
--follow-up-type "电话" \
--contacted-person "张三" \
--description "已与客户确认POC范围和预算,预计下周提交技术方案。"bash
node scripts/business-record.mjs create \
--customer-id "<customerId>" \
--follow-up-type "Phone Call" \
--contacted-person "Zhang San" \
--description "Confirmed the POC scope and budget with the customer; the technical proposal is expected to be submitted next week."缺失信息提示模板
Missing Information Prompt Template
当以下字段缺失时,直接向用户追问:
- 缺客户名:
请补充客户名称。 - 缺联系人:
请补充本次对接人姓名。 - 缺跟进类型:
请补充跟进类型(微信/电话/线上会议/邮件/现场拜访/商务活动/其他)。 - 缺记录内容或不足 10 字:
请补充更完整的跟进记录(至少 10 个字)。 - 请求返回报错:(此时需要用户前往LCRM系统web端完善联系人信息)。
请先完善联系人信息(姓名、电话、角色)后再新增商务记录
Prompt the user directly to supplement the following fields if they are missing:
- Missing customer name:
Please supplement the customer name. - Missing contact person:
Please supplement the name of the contact person for this interaction. - Missing follow-up type:
Please supplement the follow-up type (WeChat/Phone Call/Online Meeting/Email/On-site Visit/Business Event/Other). - Missing record content or content is less than 10 characters:
Please supplement a more complete follow-up record (at least 10 characters). - Error returned from request: (the user needs to go to the LCRM system web portal to complete the contact person information at this time).
Please complete the contact person information (name, phone number, role) in the LCRM system web portal first before adding a new business record