electrical-process
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 "electrical-process" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-75d2c1d2e978ae2f53c448370f93b8ac7466d75141b57cb9b18a6942ab3c0f81. Verify the upstream source and version against https://skillhub.cn/skills/user_d201725d/electrical-process 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
Electrical-Process — One-click processing for electrical-parts purchase orders: first precisely match material codes by the four fields (name + specification + brand + unit) and fill them back into the purchase order; then (upon confirmation) generate a Kingdee import template; finally, after Kingdee confirmation, write back the new codes. This combines the original “electrical matching” and “electrical import template” flows and keeps three confirmation gates: match preview confirmation, import-generation confirmation, and Kingdee confirmation with code backfill. Example triggers include phrases like “electrical matching import” and “one-click electrical processing.”
Introduction source: third_party · user_d201725d · 1.5.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: 电气件处理
displayName: 电气件匹配+导入一体
slug: electrical-process
version: 1.5.1
description: >
电气件申购单一键处理:先按 品名+规格+品牌+单位 四字段精确匹配物料编码填回申购单,
再(经确认)生成金蝶导入模板,最后(金蝶确认后)回填新编码。合并原「电气件匹配」与 「电气件导入模板」两个 skill
的流程,保留匹配预览确认、导入生成确认、金蝶确认后回填三道安全门禁。
触发词:电气件匹配导入、电气件一键处理、电气处理、电气件匹配并导入、电气申购单匹配导入、 电气BOM匹配并生成导入模板。
agent_created: true
disable: false电气件处理(匹配 + 导入 一体)
把"匹配编码"和"生成导入模板"两个环节串成一条流水线,保留导入生成确认、金蝶确认后回填两道用户确认门禁(匹配写回免确认,仅 dry-run 预览),
绝不自动串跑导入(零件BOM / 电气 / 紧固件共用同一个 导入模板.xlsx,自动导入会互相覆盖)。
底层逻辑(列自动检测、单位映射、71 列格式、B 系列编号接续、跨单去重等)由引擎脚本承担, 本 skill 不重复实现,仅做编排与安全确认。
文件准备
- 申购单:电气件申购单
.xlsx(含 品名/规格/品牌/单位 列) - 物料表:金蝶导出
物料_*.xlsx(用于匹配,可自动探测) - 两者路径由用户提供,或按
_shared/paths.py的get_material_path自动探测
Phase 1 — 匹配(引擎:电气件匹配 / match_electrical.py)
PYTHONIOENCODING=utf-8 python "scripts/match_electrical.py" "<申购单>" "<物料表>" "<申购单>(原地修改)" --dry-run
- 先
--dry-run预览,把匹配成功数 / 未匹配数汇报用户。 - 匹配写回不需要用户确认(2026-07-20 用户明确):dry-run 预览后直接去掉
--dry-run重跑,原地填回编码、电气件类别、机台编号、工程代号,无需停下问确认。- 写入前提醒用户关闭 Excel,否则
PermissionError。 .xls不支持原地改,需先另存为.xlsx。- 门禁只保留 Phase 2(是否生成导入模板)这一道,写回编码不再单独设门禁。
- 写入前提醒用户关闭 Excel,否则
若匹配率异常低,按
电气件匹配SKILL.md 排查(多为单位不一致或品牌列缺失)。
🔴🔴 表头纵向合并泄漏(比"丢值"更隐蔽的坑)
零件BOM/电气件/紧固件/零散物料 模板普遍存在 Row5:Row6 纵向合并(表头行与首数据行合并)。
merged_cell_getter 会在 Row6 读到表头值("品 名"/"名称"/"图名"…),使行循环误把 Row6 当数据行
去匹配物料库 → 首次未命中金蝶误建假物料(A.001.13551 事故),重匹配时命中假码写回 Row6。
防护已统一到 _shared.header_utils.is_header_name / HEADER_NAME_WORDS(单一来源,四类脚本的行循环/数据提取均已接入);
表头词集合新增/调整只改 _shared/header_utils.py,跑 sync_shared.py 一键同步,不要另写副本。
自检口诀:名称是表头词(品名/名称/图名)→ 纵向合并泄漏,该行应被跳过。
Phase 2 — 停下确认导入(关键门禁)
汇总未匹配行数 N:
- N = 0(全部匹配):主动告知用户「✅ 电气件 全部匹配,0 行未匹配,无需生成导入模板」,流程结束(仅完成匹配,不进入 Phase 3)。
- N > 0:停下来问用户:
"电气件 有 N 行未匹配,是否生成金蝶导入模板?"
- 用户确认 → 进入 Phase 3
- 用户取消 → 流程结束(仅完成匹配,不生成导入模板)
Phase 3 — 导入(引擎:电气件导入模板 / generate.py)
# 多份电气件申购单可一次传多个参数;物料表可选(不传则自动探测最新 物料_*.xlsx)
PYTHONIOENCODING=utf-8 python "scripts/generate.py" "<申购单1>" ["<申购单2>" ...] ["<物料表>"] ["--append"] ["--dry-run"]
- 输出固定写入
导入模板.xlsx(脚本内部SRC_TEMPLATE,无需也不能通过位置参数传路径;如需覆盖用--output <路径>)。 - 多份电气件申购单一次传多个参数,脚本内部自动合并 + 跨单去重(相同物料只建 1 个编码),无需
--append分两次调用。 - 物料表可选:不传则按
get_material_path自动探测桌面/工作目录的物料_*.xlsx;显式传物料_*.xlsx优先。 - 脚本自动备份旧模板、接续 B 系列编号、写 71 列格式。
- 生成后用
present_files投递导入模板.xlsx。
⚠️ 生成后必查(单位与编码)
生成 导入模板.xlsx 后,重点核对脚本输出的提示:
- 未知单位必须提醒:若某物料单位经归一后仍不在单位映射表(如
kg、自定义缩写),脚本会打印⚠️ [单位提醒]。必须显式告知用户补充映射(X→Y),绝不能静默写进模板,否则金蝶可能无法识别。 - ROL = roll:单位
ROL视为roll的缩写,已统一归一为roll(大小写兼容),属预期行为。 - 钣金/加工/焊接件 单位强制 PCS:这三类物料单位五花八门(件/套/kg/㎡…),导入模板生成时统一强制为
Pcs,匹配阶段不改申购单原单位列,这是预期行为,不是 bug。 - 金蝶单位编码勿自行修改:
UNIT_CODE_MAP里的值(如branch、second)是金蝶系统的真实单位编码,即便看着像英文/拼音也不要当"翻译错误"去改。
Phase 4 — 金蝶确认后回填
- 用户把
导入模板.xlsx上传金蝶。 - 用户自行判断金蝶导入是否全部成功。
- 用户确认全部成功 → 重跑导入脚本并加
--backfill(取导入模板里写入的真实编码,按 品名+规格 映射写回申购单空编码列;不重新分配):PYTHONIOENCODING=utf-8 python "scripts/generate.py" "<申购单1>" ["<申购单2>" ...] ["<物料表>"] --backfill- 澄清:
--backfill是读取已生成的导入模板里写入的真实编码映射回填申购单空编码列,不重新分配、不重新匹配物料表,与规则「回填不要重跑 generate 重新分配编码」完全一致,是幂等操作。
- 澄清:
- 用户指出部分失败 → 不回填(或仅回填确认成功的部分)。
与「申购单分拣」的关系
- 单一电气件申购单 → 直接用本 skill 一键处理。
- 多种类型混在一个文件夹 → 用「申购单分拣」统一调度(它会对每类跑匹配、再统一把控导入门禁,避免共用模板互相覆盖)。本 skill 不要用于文件夹批量场景。
Current listing version
1.5.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决企业 ERP 集成中的实际痛点,提供物料编码匹配到金蝶导入的完整闭环
- 合并原有两个独立流程,提升操作效率同时保留关键安全门禁
Highlights
- 触发词覆盖全面,包含多种常见表述变体
- 边界清晰,不易与其他 Skill 混淆
Highlights
- Phase 划分清晰,流程完整
- 包含详细的技术防护说明和异常处理指引
Highlights
- 关键操作设置用户确认门禁
- 覆盖主要异常场景并提供解决方案
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.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
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.