india-work-update-collector
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "india-work-update-collector" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d65eff1f7eac87556920c0f8b60f265c85c5ae75315a603b58f2b89e8591c84d. Verify the upstream source and version against https://skillhub.cn/skills/user_222cd835/india-work-update-collector before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Automatically collects daily India on-site work updates (Work Update) from the DingTalk “3S Overseas Service Team” group, parses them into structured form, and writes them into the AI spreadsheet table “India Group Message Collection”; ordinary chat is not collected, suspected uncertain items go to a “Pending Review” table; creates a task for Abhishek Thakur if there are issues with Safety/Quality Reflection; after collection fills missing fields from the “Original Message” column; at 07:00 daily the group bot posts the previous day’s summary in the Customer Complaint Communication group (India) (no longer private-messaging Abhishek). Trigger phrases: India group message collection, Work Update collection, India on-site report archiving.
Introduction source: third_party · user_222cd835 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: india-work-update-collector
description: 每天自动收集钉钉「3S Overseas Service Team」群里的印度现场工作汇报(Work Update),结构化解析后写入 AI 表格的「印度群消息收集」表;普通聊天不收集,疑似不确定的进「待判定」复核表;对 Safety/Quality Reflection 有问题的自动给 Abhishek Thakur 建代办;采集后自动从「原始消息」列补漏空栏位;每天 7:00 由群机器人在 Customer Complaint Communication group(India) 发昨日汇总(不再私信 Abhishek)。触发词:印度群消息收集、Work Update 采集、印度现场汇报归档。
agent_created: true印度群工作汇报收集(Work Update → AI 表格)
把钉钉「3S Overseas Service Team」群里格式化的现场工作汇报(Work Update), 每天自动解析成结构化记录写入 AI 表格;并按规则建代办、发总结。
目标资源(已固化到 state/config.json)
- 源群:
3S Overseas Service Team(需马明航在群内;group_id 由 finalize/run_daily 自动绑定) - 目标 Base:
3S India Services Demand & Allocation(1)(Qnp9zOoBVBarL63RfP4MZAp9W1DK0g6l,由马明航账号可读写,数据已落库)- 主表:
印度群消息收集(34 列,结构化工作汇报;含「原始消息」列用于补漏) - 复核表:
印度群消息-待判定(疑似但字段不足,人工判定)
- 主表:
- 代办接收人:
Abhishek Thakur(userId 2763683319-1855311714);每日总结已不再私信 Abhishek,改为群机器人发到Customer Complaint Communication group(India)(群号 175850012511)。 - 群报告发送:该群的【自定义群机器人 Webhook】(配置
group_webhook+group_secret加签)。
满足的需求
- header 可变 →
parser.py用「归一化 key + 同义词表」模糊匹配(兼容 Work Update / Work Update Date、Windfarm / Wind Farm、Safety Reflection / Safety Concerns 等),多行值自动归并。 - 每天采集、普通聊天不收集 →
classify()三分类:work_update / uncertain / skip;只有结构化汇报写主表,普通聊天丢弃。 - 自动检查是否成功 → 逐批校验写入结果;仅在全部成功时推进水印,失败则保留 水印下次重试。另加「消息ID 持久去重」,即使水印异常也不会重复入库。
- Safety/Quality Reflection 问题 → 给 Abhishek 建代办 →
detect_issue():值为 None/No/Nil/正常… 视为无问题;有实质内容则建代办(含关键词时升为紧急优先级)。 - 不确定的进复核表 → 识别到 2~4 个字段或有 header 但字段太少 → 写「印度群消息-待判定」。
- 写入印度 Base、同 Base 新建 database → 在目标 Base 内新建主表与复核表两张数据表。
- 采集没填全 → 从原信息列补漏所有空栏位 →
fill_empty.py:扫描主表,对每条记录的 「原始消息」重新解析(parser.py),把当前为空、但重新解析能得到的规范字段补填回去。 幂等、绝不覆盖已填值。已接入run_daily.py,每次采集后自动对本次新记录补漏。 解析器为此专门增强:兼容印度群无分隔符 / 标签独占 / 数值紧贴标签 / 正文段落描述状态等真实格式。 - 每天 7:00 群机器人发昨日汇总(替代原 Abhishek 私信总结) →
group_report.py: 取「采集日期 = 昨天」的主表 + 复核表记录(已去重),生成 Markdown 日报(总览 + 逐条 明细 + 安全/质量隐患高亮 + 待判定清单 + 表格链接),通过群机器人 Webhook 发到 Customer Complaint Communication group(India)。原给 Abhishek 的每日总结自动化已 PAUSED。
脚本
scripts/parser.py— 解析 / 分类 / 问题检测(可python parser.py自测)。已增强兼容印度群真实格式。scripts/common.py— dws 调用、配置读写、JSON 容错解析。DAILY_STATS_PATH= 当日累计。scripts/setup.py— 一次性新建 Base + 建表 + 写配置(默认新建一个属于当前 dws 登录账号可读写的 Base;也可--base-id复用已有 Base。幂等:同名表复用、只补缺失字段)。scripts/backfill.py— 历史补收集(默认不建代办避免刷屏;--days N近 N 天,--with-todo连代办一起建,--dry-run只统计)。scripts/finalize.py— 马明航入群后绑定 group_id(--group-id可精确指定)。scripts/run_daily.py— 采集入口:自愈绑定 group +collect --no-summary,随后自动调用fill_empty对本次新记录补漏;未入群则跳过(exit 0)。scripts/collect.py— 采集主流程。--dry-run只解析统计;--no-summary只采集+累加当日统计不发总结。含「消息ID 持久去重」。scripts/fill_empty.py— 空栏位补漏:从「原始消息」重新解析,补填空规范字段。--record-ids只处理指定记录,--dry-run只打印。scripts/daily_summary.py— (已停用) 给 Abhishek 发每日总结。现由group_report.py+ 群机器人取代。scripts/group_report.py— 群机器人每日报告:编译昨日数据 → Markdown → 经群 Webhook 发送。--dry-run只打印,--date YYYY-MM-DD指定某天。scripts/coc_gen.py— COC 文档生成:基于桌面模板C:/Users/admin/Desktop/COC-v2/COC模板(共用) .docx,填充{{占位符}}、按设备类型保留「升降机 Lift / 免爬器 Climb Auto System」分支、推算 CertificateNo 与 ValidDate。对外generate_coc_docx(fields, out_path)。scripts/coc_collect.py— COC 每小时采集:扫描群聊 COC 汇报(RequireCOC/Dispatch No/EquipmentType…),去重后生成文档,按「客户 / 风场」在「施工培训群」知识库COC Records文件夹下建子目录并导入,得到可直接点开的链接,再按 客户/风场/Dispatch/WO/序列号 匹配写回对应工作汇报记录的COC File列。--dry-run只统计,--backfill-days N回填历史。
COC 证书文档自动生成(新增)
工作汇报新增 COC needed? 字段;群聊里另有独立的 COC 聊天汇报(含 RequireCOC / Dispatch No /
EquipmentType / W.O.No / Customer / Site of Name / Car Sr.No / LiftSrNo …)。
每小时采集一次 COC 汇报并:
- 解析 COC 字段(
parser.parse_coc_report/is_coc_report)。 - 用
coc_gen.generate_coc_docx基于模板生成 word 文档;自动选择「升降机 / 免爬器」分支。 - 在「施工培训群」知识库
COC Records文件夹下按 客户 → 风场 建子目录, 文档命名为{客户}_{风场}_{序列号}.docx,经dws doc import --folder <nodeId>导入, 得到可直接点开的钉钉文档链接(https://alidocs.dingtalk.com/i/nodes/...)。 - 按 客户 + 风场 / Dispatch / WO / 序列号 匹配到对应「工作汇报」记录,把链接写回其
COC File列(该列已是文本类型,可点击);若COC needed为空则补yes。
- 去重:消息 ID 持久去重(
config.coc_seen_ids)+ 水印(config.coc_watermark_time), 不会因重跑重复生成文档。首次运行只处理最近 5 分钟,避免历史洪水; 需回填历史用coc_collect.py --backfill-days N。 - 工作汇报采集(
collect.py)已加is_coc_report守卫,COC 汇报不会被当成工作汇报重复入库。 - 知识库写入依赖 dws 已登录且对该知识库有写权限(当前以马明航身份,corp 施工培训交流群Work Order)。
架构(采集 / 补漏 / 群报告 分离)
- 采集(高频,每小时兜底):
run_daily.py→collect --no-summary,增量拉取 + 写表 + 建代办 + 累加当日统计,不发消息。水印 + 消息ID 双去重,天然幂等。 - 补漏(每次采集后):
fill_empty对本次新记录从「原始消息」补填空栏位。 - 群报告(每天 7:00):
group_report.py编译昨日数据,经群机器人 Webhook 发到 Customer Complaint Communication group(India)。不再私信 Abhishek。
自动化
- 群机器人每日报告:内置自动化
印度群工作汇报·群机器人每日7点报告(FREQ=DAILY;BYHOUR=7;BYMINUTE=0,GMT+8)→group_report.py。 - 采集频率:内置调度器最小粒度为 HOURLY,不支持 MINUTELY。真正的「每 5 分钟」需用 Windows 任务计划程序(
schtasks /SC MINUTE /MO 5调run_daily.py)。若 schtasks 被安全策略禁用,先用内置FREQ=HOURLY自动化印度群工作汇报·每小时采集(兜底,待换5分钟)兜底。放开「系统级工具」策略后可换成 5 分钟计划任务。 - (已停用)Abhishek 每日总结:
印度群工作汇报·每日总结(给Abhishek)已 PAUSED。
建 5 分钟计划任务的命令(放开系统工具策略后,在有权限终端执行)
schtasks /Create /TN "IndiaWorkUpdate_Collect_5min" /TR "\"C:\Users\admin\.workbuddy\binaries\python\versions\3.13.12\python.exe\" \"C:\Users\admin\.workbuddy\skills\india-work-update-collector\scripts\run_daily.py\"" /SC MINUTE /MO 5 /F
建好 5 分钟任务后,暂停内置每小时兜底自动化避免双跑(有水印去重不会重复入库,但没必要)。
群机器人 Webhook 配置(必做,否则报告发不出去)
group_report.py 优先用群机器人 Webhook 发送。需在钉钉里给目标群加一个自定义机器人并
把 Webhook 与加签密钥写入 state/config.json:
"group_webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxxx",
"group_secret": "SECxxxxxxxx"
创建路径:群设置 → 智能群助手/机器人 → 添加机器人 → 自定义机器人 → 复制 Webhook,
安全设置选「加签」并复制密钥。若未配置 webhook,脚本会回退用 chat message send --group
以马明航身份发到 report_group_conversation_id(需填入该群的 openConversationId)。
关键约束
- 采集以马明航(dws 授权账号)身份读群,必须先把马明航拉进目标群。
- 旧表
3S India Services Demand & Allocaton(Gl6Pm2Db…)因 dws 令牌组织不匹配 (ORG_DOC_TOKEN_MISMATCH)无法写入,故实际使用马明航名下的…(1)(Qnp9zOo…)。 aitable table create单次最多 15 字段;多余字段用aitable field create分批补 (允许部分成功,重名自动忽略)。写/更新记录用--records-file(避免 Windows 命令行长度限制)。- 消息拉取用
chat message list --direction newer,翻页用最后一条createTime。 - 去重主键
openMessageId+ 水印时间;发送人/时间/原文一并入库便于溯源。
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决企业现场工作汇报自动化采集与结构化解析的高频刚需
- 具备完整的去重、补漏、异常处理及报告机制,实用性强
Highlights
- 触发词精准完整,覆盖核心功能,边界清晰
Highlights
- 架构清晰,步骤完整,包含详细配置说明和端到端示例
Highlights
- 具备消息ID持久去重、水印机制、逐批校验及失败重试,可靠性高
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 99, 101, 105
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- alidocs.dingtalk.com
- oapi.dingtalk.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.