https://doc.weixin.qq.com/smartsheet/s3_AJMANXjIAA4CNbrmEe0xSRSOmoEc4_a在 config.json 中配置企业微信用户ID到真实姓名的映射:
{
"smartsheet_url": "https://doc.weixin.qq.com/smartsheet/xxx",
"sheet_id": "xxx",
"user_mapping": {
"yuanzhen": "袁震",
"zhangsan": "张三",
"lisi": "李四"
}
}
映射规则:
本技能用于将日报内容自动解析并录入到企业微信智能表格中。
目标智能表格应包含以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
| ------ | ------ | ------ |
| 项目名称 | 单选 | 预定义选项(如:调研、测试、开发) |
| 员工名称 | 文本 | 员工姓名 |
| 日期 | 文本 | 日期 |
| 今日工作内容 | 文本 | 工作内容描述 |
| 遇到的问题 | 文本 | 问题描述 |
| 投入时长 | 文本 | 工作投入时长(如:4h、2.5h) |
首先获取子表列表:
wecom_mcp call doc smartsheet_get_sheet '{"url": "https://doc.weixin.qq.com/smartsheet/xxx"}'
然后获取字段列表(重点获取"项目名称"字段的单选选项):
wecom_mcp call doc smartsheet_get_fields '{"url": "https://doc.weixin.qq.com/smartsheet/xxx", "sheet_id": "SHEET_ID"}'
从返回结果中提取项目名称选项:
{
"field_id": "f04Gwj",
"field_title": "项目名称",
"field_type": "FIELD_TYPE_SINGLE_SELECT",
"property_single_select": {
"options": [
{"id": "o4Sbho", "text": "调研"},
{"id": "oomC67", "text": "测试"},
{"id": "otTPOy", "text": "开发"}
]
}
}
提取选项文本:["调研", "测试", "开发"]
使用解析脚本处理日报文本(传入动态获取的项目名称选项和企业微信用户ID):
python3 scripts/parse_daily_report.py '<日报内容>' '["调研", "测试", "开发"]' 'yuanzhen'
参数说明:
脚本返回 JSON 格式:
{
"employee_name": "yuanzhen",
"date": "2026-05-14",
"records": [
{
"project_name": "开发",
"work_content": "做了智能体开发"
},
{
"project_name": "测试",
"work_content": "智能体测试"
}
],
"problems": ["需求不完善"]
}
由于 smartsheet_get_records 接口被禁用,无法直接查询已有记录。采用本地记录ID文件方案:
record_ids.json使用辅助脚本自动处理:
python3 scripts/submit_daily_report.py '<日报内容>'
脚本会自动完成:
如果不使用脚本,需要手动执行以下步骤:
cat record_ids.json
文件格式:
{
"袁震_2026-05-19": ["record_id_1", "record_id_2"],
"张三_2026-05-19": ["record_id_3"]
}
wecom_mcp call doc smartsheet_delete_records '{
"url": "https://doc.weixin.qq.com/smartsheet/xxx",
"sheet_id": "SHEET_ID",
"record_ids": ["record_id_1", "record_id_2"]
}'
使用字段标题(不是 field_id)添加记录:
wecom_mcp call doc smartsheet_add_records '{
"url": "https://doc.weixin.qq.com/smartsheet/xxx",
"sheet_id": "SHEET_ID",
"records": [
{
"values": {
"项目名称": [{"text": "开发"}],
"员工名称": [{"type": "text", "text": "yuanzhen"}],
"日期": [{"type": "text", "text": "2026-05-14"}],
"今日工作内容": [{"type": "text", "text": "做了智能体开发"}],
"遇到的问题": [{"type": "text", "text": "需求不完善"}]
}
}
]
}'
从返回结果中提取 record_id,更新 record_ids.json 文件。
[{"text": "选项文本"}][{"type": "text", "text": "内容"}]smartsheet_get_fields 获取最新的项目名称选项record_ids.json 文件用于跟踪已录入的记录ID,请勿手动删除姓名:张三
日期:2026-05-14
今日工作内容:
开发投入4h,完成了登录功能
测试投入2h,编写了测试用例
遇到的问题:接口文档不完整
{
"employee_name": "张三",
"date": "2026-05-14",
"records": [
{"project_name": "开发", "work_content": "完成了登录功能"},
{"project_name": "测试", "work_content": "编写了测试用例"}
],
"problems": ["接口文档不完整"]
}
智能表格中会添加2条记录:
共 1 个版本