erp-sales-analysis

ERP Sales Analysis Full Process: Covers requirement understanding → SQL generation → query execution → output of analysis reports. Applicable to scenarios including the photovoltaic diamond wire industry (Yancheng Jiwa New Materials).

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 "erp-sales-analysis" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4007fd04df4f42393dc597a2c8068127128d340b0968da81fa0d69790bc991a4. Verify the upstream source and version against https://skillhub.cn/skills/user_1e46fab8/erp-sales-analysis 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

ERP Sales Analysis Full Process: Covers requirement understanding → SQL generation → query execution → output of analysis reports. Applicable to scenarios including the photovoltaic diamond wire industry (Yancheng Jiwa New Materials).

0 Downloads

Introduction source: third_party · user_1e46fab8 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: erp-sales-analysis
description: "ERP销售数据分析全流程:理解需求→生成SQL→执行查询→输出分析报告。覆盖光伏金刚线行业(盐城吉瓦新材料)"
version: 1.0.0
visibility: "public"

ERP 销售数据分析

一、企业背景(仅用于分析参考,不编造数据依据)

盐城吉瓦新材料科技有限公司

  • 光伏金刚线制造企业,产品:光伏/半导体级电镀金刚石线锯(线径 20-70μm)
  • 产品线:光伏单晶线、多晶线、半导体线(半导体金刚线市占率≥20%)
  • 产能:月产能 170 万 km,年产能 1,200 万 km
  • 客户:阿特斯、晶澳、正泰、协鑫等光伏头部企业
  • 订单以 km(千米)为数量单位,金额单位为元

二、数据库表结构(精简版)

表关联全景

sx_bas_customer ← sx_sale_salescontract → sys_user
       ↓                                    ↓
sx_sale_salesorder ─→ sx_sale_salesorderdetails ─→ sx_bas_inventory → sx_bas_warehouse
       ↓                                           sys_user
    sys_user / sys_office

sx_sale_salescontract - 销售合同

  • JOIN: customer_id→sx_bas_customer.id, create_by→sys_user.id
  • 关键字段:id(varchar PK), contract_code(varchar), customer_id(varchar), contract_time(varchar 日期), create_by(varchar), create_date(datetime), del_flag

sx_sale_salesorder - 销售订单

  • JOIN: customer_id→sx_bas_customer.id, salescontract_id→sx_sale_salescontract.id, create_by→sys_user.id, id→sx_sale_salesorderdetails.salesorder_id
  • 关键字段:id(varchar PK), salesorder_code(varchar), customer_id(varchar), salescontract_id(varchar), totalprice_includingtax(varchar 含税总金额), total_number(varchar 总数量), salesorder_state(varchar 状态), create_by(varchar), create_date(datetime), del_flag
  • 字典:salesorder_state: 0=开立,1=已确认,2=生产中,3=部分入库,4=全部入库,5=部分出库,6=全部出库,7=已发货

sx_sale_salesorderdetails - 订单明细

  • JOIN: salesorder_id→sx_sale_salesorder.id, inventory_id→sx_bas_inventory.id, default_warehouse_id→sx_bas_warehouse.id
  • 关键字段:id(varchar PK), salesorder_id(varchar), inventory_id(varchar), salesorder_num(varchar 数量), unit_price(varchar 含税单价), total_price(varchar 含税总价), delivery_date(varchar 交期), default_warehouse_id(varchar), create_date(datetime), del_flag

sx_bas_customer - 客户

  • 关键字段:id(varchar PK), customer_name(varchar), contacts(varchar), contacts_phone(varchar), del_flag

sx_bas_inventory - 产品/存货

  • JOIN: pre_storage_warehouse→sx_bas_warehouse.id
  • 关键字段:id(varchar PK), inventory_type_id(varchar 类别), inventory_code(varchar), inventory_name(varchar 名称), model(varchar 规格型号), singal_unit(varchar 单位), taxincluded_price(varchar 含税单价), inventory_in_stock(varchar 库存), del_flag
  • 字典:inventory_type_id: 1=辅材,2=原辅材料,3=半成品,4=成品
  • 字典:singal_unit: 137=km,128=L,126=kg,106=ct(件/个)

sx_bas_warehouse - 仓库

  • 关键字段:id(varchar PK), name(varchar 仓库名), del_flag

sys_user - 员工

  • JOIN: office_id→sys_office.id
  • 关键字段:id(varchar PK), office_id(varchar), no(varchar 工号), name(varchar 姓名), del_flag

sys_office - 部门

  • 关键字段:id(varchar PK), name(varchar 部门名), del_flag

三、SQL 生成规则(强制遵守)

  1. del_flag 过滤:所有业务表 WHERE 条件追加 del_flag = '0'
  2. CAST 转换:金额/数量字段为 VARCHAR,SUM/AVG 前必须 CAST(字段 AS DECIMAL(18,2))(金额)或 CAST(字段 AS DECIMAL)(数量)
  3. 仅 SELECT:只支持 SELECT 查询,禁止其他 DML
  4. **禁止 SELECT **:只查需要的字段;禁止 `SELECT COUNT(),统一用SELECT COUNT(1)`
  5. CASE WHEN 转字典:字典值编码必须用 CASE WHEN 转为中文输出(如 CASE salesorder_state WHEN '0' THEN '开立' WHEN '1' THEN '已确认' ... END AS 订单状态)
  6. 先过滤再聚合:WHERE 条件先行,减少聚合数据量
  7. JOIN 规范:严格按表结构中给出的 JOIN 链路关联,用主外键,禁止笛卡尔积
  8. 排行加 LIMIT:明细/排行类查询加 LIMIT(如 LIMIT 10)
  9. 产品维度 model:涉及产品必须关联 sx_bas_inventory,结果包含 model(规格型号)字段
  10. MySQL 5.7 兼容:ORDER BY 中禁止对聚合别名做算术运算;复杂运算用子查询嵌套后外层排序;避免多层嵌套子查询,优先标准 JOIN + 聚合

四、MCP 调用指引

使用 batchQuerySalesData 工具,参数 queries 为 JSON 字符串数组:

[{"title":"分析维度名称","sql":"SELECT ... WHERE del_flag = '0'"}]
  • 最多 10 条 SQL/批
  • 返回值:Markdown 表格

五、分析报告规范

  1. 100% 基于数据:所有结论来自查询结果,不编造、不推演未给出的趋势
  2. 排版:标准 Markdown,用 emoji 点缀标题和关键要点(📊📈🏆✅⚠️)
  3. 单位:金额统一「万元」保留 1 位小数;数量保留整数加千分位分隔符
  4. 突出 TOP:排行类只列 TOP3-5,避免冗长罗列
  5. 模块整合:将查询维度整合为 2-4 个重点模块,不碎片化
  6. 核心摘要:开篇 3-5 段核心摘要,高度提炼整体态势
  7. 无数据标注:某维度无数据时标注「该维度无有效统计数据」
  8. 可结合行业:可结合光伏金刚线行业特性分析(如线径规格、客户类型)

六、执行流程

Step 1: 理解用户需求 → 确定分析维度(时间/客户/产品/销售员/状态/合同/仓库)
Step 2: 按 SQL 规则生成 JSON 数组(最多 10 条),调 batchQuerySalesData 执行
Step 3: 解析返回的 Markdown 结果
Step 4: 按报告规范生成结构化分析报告

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 提供ERP销售数据分析全流程闭环,解决企业高频刚需痛点
  • 覆盖光伏金刚线行业具体企业场景,具有高度实用价值
  • 从需求理解到报告输出的完整执行链条设计合理
Trigger Precision95/100

Highlights

  • 触发词精准完整,明确限定ERP销售数据分析功能
  • 行业场景描述清晰(光伏金刚线行业),边界明确
  • description位置正确,内容完整无截断
Structure and Standards95/100

Highlights

  • 文档结构完整,六大模块覆盖全流程
  • SQL生成规则详细规范,强制遵守条款清晰
  • 执行流程步骤明确,有端到端示例支撑
Execution Reliability95/100

Highlights

  • 工具调用参数格式规范,JSON结构明确
  • SQL生成规则覆盖主要异常处理(del_flag过滤、类型转换等)
  • 分析报告规范严谨,确保输出质量可控
Evidence Verifiability (mean of the first four)95/100

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.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

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.