From 2d2db5e8665ed775367d5520b84465cb0cd17236 Mon Sep 17 00:00:00 2001 From: yuanzhipeng <2501363769@qq.com> Date: Thu, 8 Jan 2026 00:31:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(lzwcai=5Fmcpskills=5FanalyzeOrder):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0MCP=E6=8A=80=E8=83=BD=E5=88=86=E6=9E=90?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建基于MCP协议的SQL查询执行服务器 - 实现从businessQueries.json动态生成查询工具功能 - 支持中文工具名称自动转换为拼音 - 配置详细操作日志记录(仅输出到文件,不干扰MCP通信) - 添加订单延迟预警分析、工单进度跟踪、供应链风险预警等6个业务查询模板 - 提供完整的安装、使用和开发文档 --- lzwcai_mcpskills_analyzeOrder/README.md | 138 + .../lzwcai_mcpskills_analyzeOrder/.gitignore | 10 + .../.python-version | 1 + .../lzwcai_mcpskills_analyzeOrder/README.md | 154 + .../lzwcai_mcpskills_analyzeOrder/__init__.py | 9 + .../businessQueries.json | 50 + .../logs/lzwcai_mcp_sqlexecutor.log | 233 + .../logs/lzwcai_mcp_sqlexecutor_daily.log | 109 + .../logs/lzwcai_mcp_sqlexecutor_error.log | 0 .../logs/mcp_services.log | 71 + .../lzwcai_mcpskills_analyzeOrder/main.py | 373 ++ .../pyproject.toml | 35 + .../lzwcai_mcpskills_analyzeOrder/sql11 | 169 + .../utils/__init__.py | 25 + .../utils/api_client.py | 318 ++ .../utils/env_config.py | 106 + .../utils/json_helper.py | 60 + .../utils/logger_config.py | 489 ++ .../utils/name_helper.py | 41 + .../utils/schema_helper.py | 166 + .../lzwcai_mcpskills_analyzeOrder/uv.lock | 497 ++ lzwcai_mcpskills_analyzeOrder/main.py | 13 + .../manufacturing_data_model_v1.0.0.md | 1094 +++++ lzwcai_mcpskills_analyzeOrder/pyproject.toml | 35 + .../一页式决策简报.sql | 317 ++ .../人效产值损耗三维模型仪表盘.sql | 193 + .../供应链风险预警.sql | 416 ++ .../工单执行进度与异常节点.sql | 409 ++ .../指标趋势分析与拐点预警.sql | 426 ++ .../订单延迟预警分析.sql | 154 + lzwcai_mcpskills_analyzeWorkOrder/README.md | 10 +- .../__init__.py | 2 +- .../businessQueries.json | 41 - .../lzwcai_mcpskills_analyzeWorkOrder/main.py | 6 +- lzwcai_mcpskills_analyzeWorkOrder/main.py | 4 +- .../pyproject.toml | 8 +- server.log | 6 + sql/dim_bom.json | 342 ++ sql/dim_contract.json | 542 +++ sql/dim_customer.json | 382 ++ sql/dim_equipment.json | 102 + sql/dim_operation.json | 122 + sql/dim_person.json | 1 + sql/dim_product.json | 962 ++++ sql/dim_qc_reason.json | 52 + sql/dim_routing.json | 112 + sql/dim_supplier.json | 322 ++ sql/dim_warehouse.json | 132 + sql/fact_ap_payment.json | 422 ++ sql/fact_ar_receipt.json | 422 ++ sql/fact_cash_flow.json | 322 ++ sql/fact_commission.json | 192 + sql/fact_inventory_count.json | 102 + sql/fact_inventory_movement.json | 4002 +++++++++++++++++ sql/fact_inventory_transfer.json | 122 + sql/fact_invoice.json | 322 ++ sql/fact_labor_report.json | 902 ++++ sql/fact_lead.json | 401 ++ sql/fact_operation_task.json | 852 ++++ sql/fact_opportunity.json | 212 + sql/fact_production_plan.json | 142 + sql/fact_purchase_order.json | 322 ++ sql/fact_purchase_receipt.json | 692 +++ sql/fact_purchase_request.json | 322 ++ sql/fact_purchase_return.json | 72 + sql/fact_quality_inspection.json | 722 +++ sql/fact_sales_order.json | 2102 +++++++++ sql/fact_sales_return.json | 152 + sql/fact_sales_shipment.json | 482 ++ sql/fact_scrap.json | 92 + sql/fact_work_order.json | 1082 +++++ sql/fact_write_off.json | 162 + sql/现有表.json | 107 + 73 files changed, 23927 insertions(+), 56 deletions(-) create mode 100644 lzwcai_mcpskills_analyzeOrder/README.md create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.gitignore create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.python-version create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/README.md create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/__init__.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/businessQueries.json create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor.log create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_daily.log create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_error.log create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/mcp_services.log create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/main.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/pyproject.toml create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/sql11 create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/__init__.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/api_client.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/env_config.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/json_helper.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/logger_config.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/name_helper.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/schema_helper.py create mode 100644 lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/uv.lock create mode 100644 lzwcai_mcpskills_analyzeOrder/main.py create mode 100644 lzwcai_mcpskills_analyzeOrder/manufacturing_data_model_v1.0.0.md create mode 100644 lzwcai_mcpskills_analyzeOrder/pyproject.toml create mode 100644 lzwcai_mcpskills_analyzeOrder/一页式决策简报.sql create mode 100644 lzwcai_mcpskills_analyzeOrder/人效产值损耗三维模型仪表盘.sql create mode 100644 lzwcai_mcpskills_analyzeOrder/供应链风险预警.sql create mode 100644 lzwcai_mcpskills_analyzeOrder/工单执行进度与异常节点.sql create mode 100644 lzwcai_mcpskills_analyzeOrder/指标趋势分析与拐点预警.sql create mode 100644 lzwcai_mcpskills_analyzeOrder/订单延迟预警分析.sql create mode 100644 server.log create mode 100644 sql/dim_bom.json create mode 100644 sql/dim_contract.json create mode 100644 sql/dim_customer.json create mode 100644 sql/dim_equipment.json create mode 100644 sql/dim_operation.json create mode 100644 sql/dim_person.json create mode 100644 sql/dim_product.json create mode 100644 sql/dim_qc_reason.json create mode 100644 sql/dim_routing.json create mode 100644 sql/dim_supplier.json create mode 100644 sql/dim_warehouse.json create mode 100644 sql/fact_ap_payment.json create mode 100644 sql/fact_ar_receipt.json create mode 100644 sql/fact_cash_flow.json create mode 100644 sql/fact_commission.json create mode 100644 sql/fact_inventory_count.json create mode 100644 sql/fact_inventory_movement.json create mode 100644 sql/fact_inventory_transfer.json create mode 100644 sql/fact_invoice.json create mode 100644 sql/fact_labor_report.json create mode 100644 sql/fact_lead.json create mode 100644 sql/fact_operation_task.json create mode 100644 sql/fact_opportunity.json create mode 100644 sql/fact_production_plan.json create mode 100644 sql/fact_purchase_order.json create mode 100644 sql/fact_purchase_receipt.json create mode 100644 sql/fact_purchase_request.json create mode 100644 sql/fact_purchase_return.json create mode 100644 sql/fact_quality_inspection.json create mode 100644 sql/fact_sales_order.json create mode 100644 sql/fact_sales_return.json create mode 100644 sql/fact_sales_shipment.json create mode 100644 sql/fact_scrap.json create mode 100644 sql/fact_work_order.json create mode 100644 sql/fact_write_off.json create mode 100644 sql/现有表.json diff --git a/lzwcai_mcpskills_analyzeOrder/README.md b/lzwcai_mcpskills_analyzeOrder/README.md new file mode 100644 index 0000000..e4bc0ac --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/README.md @@ -0,0 +1,138 @@ +# lzwcai-mcpskills-analyzeOrder + +一个基于 MCP (Model Context Protocol) 的 SQL 查询执行服务器,支持从 JSON 配置文件动态生成查询工具。 + +## 功能特性 + +- 🚀 动态工具生成:从 `businessQueries.json` 自动生成 MCP 工具 +- 🔧 灵活配置:支持自定义业务查询和参数验证 +- 📝 完整日志:详细的操作日志记录 +- 🌐 中文支持:工具名称自动转换为拼音 + +## 安装 + +### 使用 pip 安装 + +```bash +pip install lzwcai-mcpskills-analyzeOrder +``` + +### 从源码安装 + +```bash +git clone +cd lzwcai_mcp_sqlexecutor +pip install -e . +``` + +### 使用 uv 安装(推荐) + +```bash +uv pip install lzwcai-mcpskills-analyzeOrder +``` + +## 使用方法 + +### 命令行启动 + +安装后,可以直接通过命令启动: + +```bash +lzwcai-mcpskills-analyzeOrder +``` + +### 作为 Python 模块运行 + +```bash +python -m lzwcai_mcp_sqlexecutor.main +``` + +### 配置到 MCP 客户端 + +在你的 MCP 客户端配置文件中添加: + +```json +{ + "mcpServers": { + "lzwcai-sqlexecutor": { + "command": "lzwcai-mcpskills-analyzeOrder" + } + } +} +``` + +## 配置说明 + +### businessQueries.json + +在 `businessQueries.json` 中定义你的业务查询: + +```json +[ + { + "id": "query-001", + "businessName": "用户订单查询", + "businessDescription": "根据用户ID查询订单信息", + "sqlTemplate": "SELECT * FROM orders WHERE user_id = {{userId}}", + "parameters": { + "type": "object", + "required": ["userId"], + "properties": { + "userId": { + "type": "integer", + "description": "用户的唯一标识符", + "examples": [10086] + } + } + } + } +] +``` + +## 开发 + +### 依赖项 + +- Python >= 3.13 +- httpx >= 0.28.1 +- mcp[cli] >= 1.10.1 +- pypinyin >= 0.53.0 + +### 本地开发 + +```bash +# 克隆仓库 +git clone +cd lzwcai_mcp_sqlexecutor + +# 安装开发依赖 +pip install -e . + +# 运行服务器 +python -m lzwcai_mcp_sqlexecutor.main +``` + +## 构建与发布 + +### 使用 build 构建 + +```bash +pip install build +python -m build +``` + +### 发布到 PyPI + +```bash +pip install twine +twine upload dist/* +``` + +## 许可证 + +MIT License + +## 作者 + +lzwcai + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.gitignore b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.gitignore new file mode 100644 index 0000000..505a3b1 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.gitignore @@ -0,0 +1,10 @@ +# Python-generated files +__pycache__/ +*.py[oc] +build/ +dist/ +wheels/ +*.egg-info + +# Virtual environments +.venv diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.python-version b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/README.md b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/README.md new file mode 100644 index 0000000..0ec9671 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/README.md @@ -0,0 +1,154 @@ +# lzwcai-mcpskills-analyzeWorkOrder + +一个基于 MCP (Model Context Protocol) 的 SQL 查询执行服务器,支持从 JSON 配置文件动态生成查询工具。 + +## 功能特性 + +- 🚀 动态工具生成:从 `businessQueries.json` 自动生成 MCP 工具 +- 🔧 灵活配置:支持自定义业务查询和参数验证 +- 📝 完整日志:详细的操作日志记录(仅输出到文件,不干扰MCP通信) +- 🌐 中文支持:工具名称自动转换为拼音 + +## 安装 + +### 使用 pip 安装 + +```bash +pip install lzwcai-mcpskills-analyzeWorkOrder +``` + +### 从源码安装 + +```bash +git clone +cd lzwcai_mcp_sqlexecutor +pip install -e . +``` + +### 使用 uv 安装(推荐) + +```bash +uv pip install lzwcai-mcpskills-analyzeWorkOrder +``` + +## 使用方法 + +### 命令行启动 + +安装后,可以直接通过命令启动: + +```bash +lzwcai-mcpskills-analyzeWorkOrder +``` + +### 作为 Python 模块运行 + +```bash +python -m lzwcai_mcp_sqlexecutor.main +``` + +### 配置到 MCP 客户端 + +在你的 MCP 客户端配置文件中添加: + +```json +{ + "mcpServers": { + "lzwcai-sqlexecutor": { + "command": "lzwcai-mcpskills-analyzeWorkOrder" + } + } +} +``` + +## 配置说明 + +### businessQueries.json + +在 `businessQueries.json` 中定义你的业务查询: + +```json +[ + { + "id": "query-001", + "businessName": "用户订单查询", + "businessDescription": "根据用户ID查询订单信息", + "sqlTemplate": "SELECT * FROM orders WHERE user_id = {{userId}}", + "parameters": { + "type": "object", + "required": ["userId"], + "properties": { + "userId": { + "type": "integer", + "description": "用户的唯一标识符", + "examples": [10086] + } + } + } + } +] +``` + +## 开发 + +### 依赖项 + +- Python >= 3.13 +- httpx >= 0.28.1 +- mcp[cli] >= 1.10.1 +- pypinyin >= 0.53.0 + +### 本地开发 + +```bash +# 克隆仓库 +git clone +cd lzwcai_mcp_sqlexecutor + +# 安装开发依赖 +pip install -e . + +# 运行服务器 +python -m lzwcai_mcp_sqlexecutor.main +``` + +## 构建与发布 + +### 使用 build 构建 + +```bash +pip install build +python -m build +``` + +### 发布到 PyPI + +```bash +pip install twine +twine upload dist/* +``` + +## 常见问题 + +### MCP Inspector 显示 JSON 解析错误 + +如果在使用 MCP Inspector 测试时遇到 `SyntaxError: Unexpected non-whitespace character after JSON` 错误,这是因为: + +1. **原因**:MCP 协议使用 stdio(标准输入输出)进行 JSON-RPC 通信,任何输出到 stdout 的内容(如 print 语句或控制台日志)都会破坏 JSON 格式。 + +2. **解决方案**:本服务器已将所有日志输出配置为仅写入文件(位于 `logs/` 目录),不输出到控制台。日志文件包括: + - `lzwcai_mcp_sqlexecutor.log` - 主日志文件 + - `lzwcai_mcp_sqlexecutor_error.log` - 错误日志 + - `lzwcai_mcp_sqlexecutor_daily.log` - 按日期滚动的日志 + - `mcp_services.log` - MCP 服务专用日志 + +3. **查看日志**:如果需要调试,请查看 `logs/` 目录下的日志文件。 + +## 许可证 + +MIT License + +## 作者 + +lzwcai + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/__init__.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/__init__.py new file mode 100644 index 0000000..3e52bf0 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/__init__.py @@ -0,0 +1,9 @@ +""" +lzwcai-mcpskills-analyzeOrder - MCP server for executing business SQL queries +""" + +__version__ = "0.1.2" +__author__ = "lzwcai" + +__all__ = [] + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/businessQueries.json b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/businessQueries.json new file mode 100644 index 0000000..18f9008 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/businessQueries.json @@ -0,0 +1,50 @@ +[ + { + "id": "2006300000000000001", + "businessName": "OrderDelayWarningAnalysis", + "businessDescription": "订单延迟预警分析:依据历史订单的生产周期、物流延误、设备故障等特征,输出延迟概率与红/黄/绿预警等级", + "datasourceId": "19", + "sqlTemplate": "WITH production_cycle_stats AS (SELECT COALESCE(AVG(GREATEST(0, EXTRACT(DAY FROM last_updated_utc - event_time_utc))), 0) AS avg_production_days FROM fact_work_order WHERE status = 'CLOSED' AND last_updated_utc >= event_time_utc), logistics_delay_stats AS (SELECT customer_id, AVG(GREATEST(0, EXTRACT(DAY FROM event_time_utc - doc_date_utc))) AS avg_logistics_delay_days, SUM(CASE WHEN EXTRACT(DAY FROM event_time_utc - doc_date_utc) > 3 THEN 1 ELSE 0 END) AS delay_count FROM fact_sales_shipment WHERE doc_date_utc IS NOT NULL AND event_time_utc IS NOT NULL GROUP BY customer_id), quality_issue_stats AS (SELECT COALESCE(ROUND(SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty + fail_qty), 0), 2), 0) AS defect_rate_pct FROM fact_quality_inspection WHERE pass_qty IS NOT NULL AND fail_qty IS NOT NULL), scrap_stats AS (SELECT COALESCE((SELECT COUNT(*) FROM fact_scrap) * 100.0 / NULLIF((SELECT COUNT(*) FROM fact_work_order WHERE status = 'CLOSED'), 0), 0) AS scrap_rate_pct), active_work_order_risk AS (SELECT COUNT(*) AS active_wo_count, COALESCE(SUM(CASE WHEN planned_qty > 0 AND (completed_qty / planned_qty) < 0.3 AND EXTRACT(DAY FROM NOW() - event_time_utc) > 7 THEN 1 ELSE 0 END), 0) AS lagging_wo_count FROM fact_work_order WHERE status IN ('OPEN', 'STARTED')), global_metrics AS (SELECT pcs.avg_production_days, qis.defect_rate_pct, ss.scrap_rate_pct, awr.active_wo_count, awr.lagging_wo_count FROM production_cycle_stats pcs, quality_issue_stats qis, scrap_stats ss, active_work_order_risk awr) SELECT so.sales_order_number AS order_number, c.customer_name, so.order_date_utc::DATE AS order_date, so.deal_amount AS order_amount, so.payment_status, ROUND(gm.avg_production_days::NUMERIC, 1) AS avg_production_days, ROUND(COALESCE(lds.avg_logistics_delay_days, 0)::NUMERIC, 1) AS avg_logistics_delay_days, COALESCE(lds.delay_count, 0)::INT AS historical_delay_count, ROUND(gm.defect_rate_pct::NUMERIC, 2) AS defect_rate_pct, ROUND(gm.scrap_rate_pct::NUMERIC, 2) AS scrap_rate_pct, gm.active_wo_count::INT AS active_work_order_count, gm.lagging_wo_count::INT AS lagging_work_order_count, ROUND(LEAST(100, GREATEST(0, LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)))::NUMERIC, 1) AS delay_probability_pct, CASE WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 60 THEN 'RED' WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 30 THEN 'YELLOW' ELSE 'GREEN' END AS warning_level, CASE WHEN gm.lagging_wo_count >= 2 THEN 'PRODUCTION_SEVERELY_DELAYED' WHEN COALESCE(lds.avg_logistics_delay_days, 0) > 5 THEN 'HIGH_LOGISTICS_DELAY_RISK' WHEN gm.avg_production_days > 15 THEN 'LONG_PRODUCTION_CYCLE' WHEN gm.defect_rate_pct > 10 THEN 'QUALITY_ISSUES' ELSE 'NORMAL' END AS primary_risk_factor FROM fact_sales_order so LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = 't' CROSS JOIN global_metrics gm LEFT JOIN logistics_delay_stats lds ON so.customer_id = lds.customer_id ORDER BY delay_probability_pct DESC, so.order_date_utc DESC", + "parameters": {} + }, + { + "id": "2006300000000000002", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→PENDING, STARTED→IN_PROGRESS, CLOSED→COMPLETED),呈现执行进度与异常节点", + "datasourceId": "19", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN 'PENDING' WHEN 'STARTED' THEN 'IN_PROGRESS' WHEN 'CLOSED' THEN 'COMPLETED' ELSE 'UNKNOWN' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN 'SEVERELY_DELAYED' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN 'DELAYED' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN 'QUALITY_ISSUE' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN 'LABOR_STALLED' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN 'NO_LABOR_RECORD' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN 'LOW_EFFICIENCY' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number, product_name, product_category, status_name, planned_qty, completed_qty, remaining_qty, completion_rate, worker_count, ROUND(total_work_minutes / 60.0, 1) AS total_work_hours, elapsed_hours, COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS anomaly_flags, CASE WHEN progress_anomaly = 'SEVERELY_DELAYED' OR quality_anomaly IS NOT NULL THEN 'HIGH' WHEN progress_anomaly = 'DELAYED' OR labor_anomaly IS NOT NULL THEN 'MEDIUM' WHEN efficiency_anomaly IS NOT NULL THEN 'LOW' ELSE 'NONE' END AS risk_level FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {} + }, + { + "id": "2006300000000000003", + "businessName": "SupplyChainRiskWarning", + "businessDescription": "供应链风险预警:整合采购系统中的供应商历史交期与质检合格率,结合外采物流数据,识别交期异常+物流停滞组合风险模式,自动推送高风险订单提示", + "datasourceId": "19", + "sqlTemplate": "WITH supplier_delivery AS (SELECT po.supplier_id, COUNT(*) AS order_count, COUNT(pr.purchase_receipt_id) AS receipt_count, AVG(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS avg_delivery_days, MAX(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS max_delivery_days, STDDEV(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS stddev_delivery_days FROM fact_purchase_order po LEFT JOIN fact_purchase_receipt pr ON po.supplier_id = pr.supplier_id GROUP BY po.supplier_id), supplier_quality AS (SELECT pr.supplier_id, COUNT(pr.purchase_receipt_id) AS total_receipts, SUM(pr.receipt_qty_total) AS total_qty, SUM(pr.amount) AS total_amount FROM fact_purchase_receipt pr GROUP BY pr.supplier_id), supplier_returns AS (SELECT pret.supplier_id, COUNT(*) AS return_count, SUM(CASE WHEN pret.return_reason = '损坏' THEN 1 ELSE 0 END) AS damage_count FROM fact_purchase_return pret GROUP BY pret.supplier_id), supplier_quality_rate AS (SELECT sq.supplier_id, sq.total_receipts, sq.total_qty, sq.total_amount, COALESCE(sr.return_count, 0) AS return_count, COALESCE(sr.damage_count, 0) AS damage_count, CASE WHEN sq.total_receipts > 0 THEN (sq.total_receipts - COALESCE(sr.return_count, 0)) * 100.0 / sq.total_receipts ELSE 100 END AS quality_rate FROM supplier_quality sq LEFT JOIN supplier_returns sr ON sq.supplier_id = sr.supplier_id), supplier_risk AS (SELECT s.supplier_id, s.supplier_name, s.supplier_category, COALESCE(sd.order_count, 0) AS order_count, COALESCE(sd.receipt_count, 0) AS receipt_count, ROUND(COALESCE(sd.avg_delivery_days, 0), 1) AS avg_delivery_days, ROUND(COALESCE(sd.max_delivery_days, 0), 1) AS max_delivery_days, ROUND(COALESCE(sd.stddev_delivery_days, 0), 1) AS delivery_volatility, COALESCE(sqr.total_receipts, 0) AS total_receipts, COALESCE(sqr.return_count, 0) AS return_count, ROUND(COALESCE(sqr.quality_rate, 100), 1) AS quality_rate, CASE WHEN COALESCE(sd.avg_delivery_days, 0) > 60 THEN 40 WHEN COALESCE(sd.avg_delivery_days, 0) > 45 THEN 30 WHEN COALESCE(sd.avg_delivery_days, 0) > 30 THEN 20 ELSE 10 END + CASE WHEN COALESCE(sd.stddev_delivery_days, 0) > 20 THEN 30 WHEN COALESCE(sd.stddev_delivery_days, 0) > 10 THEN 20 ELSE 10 END AS delivery_risk_score, CASE WHEN COALESCE(sqr.quality_rate, 100) < 80 THEN 50 WHEN COALESCE(sqr.quality_rate, 100) < 90 THEN 30 WHEN COALESCE(sqr.quality_rate, 100) < 95 THEN 15 ELSE 5 END AS quality_risk_score FROM dim_supplier s LEFT JOIN supplier_delivery sd ON s.supplier_id = sd.supplier_id LEFT JOIN supplier_quality_rate sqr ON s.supplier_id = sqr.supplier_id WHERE s.is_current = 't'), supplier_risk_level AS (SELECT *, delivery_risk_score + quality_risk_score AS total_risk_score, CASE WHEN delivery_risk_score + quality_risk_score >= 80 THEN 'HIGH' WHEN delivery_risk_score + quality_risk_score >= 50 THEN 'MEDIUM' ELSE 'LOW' END AS risk_level, CASE WHEN delivery_risk_score >= 50 AND quality_risk_score >= 30 THEN 'DELIVERY_AND_QUALITY' WHEN delivery_risk_score >= 50 THEN 'DELIVERY_ISSUE' WHEN quality_risk_score >= 30 THEN 'QUALITY_ISSUE' ELSE 'NORMAL' END AS risk_pattern FROM supplier_risk) SELECT supplier_name, supplier_category, order_count, receipt_count, avg_delivery_days, max_delivery_days, delivery_volatility, total_receipts, return_count, quality_rate, delivery_risk_score, quality_risk_score, total_risk_score, risk_level, risk_pattern FROM supplier_risk_level ORDER BY total_risk_score DESC, supplier_name", + "parameters": {} + }, + { + "id": "2006300000000000004", + "businessName": "EfficiencyOutputLossDashboard", + "businessDescription": "人效-产值-损耗三维模型仪表盘:关联订单量×工时×人员数×成本,构建人效—产值—损耗三维模型,按部门(产品类别)汇总展示", + "datasourceId": "19", + "sqlTemplate": "WITH labor_stats AS (SELECT p.product_category AS department, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) AS total_work_minutes, SUM(lr.report_qty) AS total_output_qty, COUNT(DISTINCT lr.work_order_number) AS work_order_count FROM fact_labor_report lr INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), work_order_stats AS (SELECT p.product_category AS department, COUNT(*) AS total_work_orders, SUM(wo.planned_qty) AS total_planned_qty, SUM(wo.completed_qty) AS total_completed_qty, SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order wo INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), quality_stats AS (SELECT p.product_category AS department, SUM(qi.pass_qty) AS total_pass_qty, SUM(qi.fail_qty) AS total_fail_qty, COUNT(*) AS inspection_count FROM fact_quality_inspection qi INNER JOIN dim_product p ON qi.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), sales_stats AS (SELECT AVG(deal_amount) AS avg_order_amount, SUM(deal_amount) AS total_sales_amount, COUNT(*) AS order_count FROM fact_sales_order), scrap_stats AS (SELECT COUNT(*) AS total_scrap_count FROM fact_scrap) SELECT ls.department, ls.worker_count, ROUND(ls.total_work_minutes / 60.0, 2) AS total_work_hours, ls.total_output_qty, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 2) AS output_per_worker, ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0), 2) AS efficiency_index, ws.total_planned_qty AS planned_qty, ws.total_completed_qty AS completed_qty, ROUND(ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS plan_completion_rate, ROUND(ws.total_completed_qty * ss.avg_order_amount / 100, 2) AS estimated_output_value, ROUND(ws.total_completed_qty * ss.avg_order_amount / 100 / NULLIF(ls.worker_count, 0), 2) AS output_value_per_worker, qs.total_pass_qty AS qc_pass_qty, qs.total_fail_qty AS qc_fail_qty, ROUND(qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100, 2) AS defect_rate, ROUND((ws.total_planned_qty - ws.total_completed_qty) / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS production_loss_rate, ROUND((ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0)) * 0.4 + (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) * 0.35 + (qs.total_pass_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) * 0.25, 2) AS performance_score, CASE WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 10 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 50 THEN 'RED' WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 5 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 70 THEN 'YELLOW' ELSE 'GREEN' END AS warning_level FROM labor_stats ls LEFT JOIN work_order_stats ws ON ls.department = ws.department LEFT JOIN quality_stats qs ON ls.department = qs.department CROSS JOIN sales_stats ss CROSS JOIN scrap_stats scr ORDER BY performance_score DESC", + "parameters": {} + }, + { + "id": "2006300000000000005", + "businessName": "OnePageDecisionBrief", + "businessDescription": "一页式决策简报:自动聚合订单、生产、财务、售后等关键数据,生成经营决策简报", + "datasourceId": "19", + "sqlTemplate": "WITH sales_summary AS (SELECT COUNT(*) AS total_orders, SUM(deal_amount) AS total_sales_amount, AVG(deal_amount) AS avg_order_amount, SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_orders, SUM(CASE WHEN payment_status = 'PARTIAL' THEN 1 ELSE 0 END) AS partial_orders, SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_orders, SUM(CASE WHEN payment_status = 'PAID' THEN deal_amount ELSE 0 END) AS paid_amount, SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) AS unpaid_amount FROM fact_sales_order), production_summary AS (SELECT COUNT(*) AS total_work_orders, SUM(planned_qty) AS total_planned_qty, SUM(completed_qty) AS total_completed_qty, SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order), ar_summary AS (SELECT COUNT(*) AS receipt_count, SUM(amount) AS total_receipt_amount, AVG(amount) AS avg_receipt_amount FROM fact_ar_receipt), ap_summary AS (SELECT COUNT(*) AS payment_count, SUM(amount) AS total_payment_amount, AVG(amount) AS avg_payment_amount FROM fact_ap_payment), invoice_summary AS (SELECT COUNT(*) AS invoice_count, SUM(invoice_amount) AS total_invoice_amount, AVG(invoice_amount) AS avg_invoice_amount FROM fact_invoice), return_summary AS (SELECT COUNT(*) AS return_count, SUM(amount) AS total_return_amount, AVG(amount) AS avg_return_amount FROM fact_sales_return), shipment_summary AS (SELECT COUNT(*) AS shipment_count, SUM(amount) AS total_shipment_amount, AVG(amount) AS avg_shipment_amount FROM fact_sales_shipment), purchase_summary AS (SELECT COUNT(*) AS purchase_order_count FROM fact_purchase_order), quality_summary AS (SELECT COUNT(*) AS inspection_count, SUM(pass_qty) AS total_pass_qty, SUM(fail_qty) AS total_fail_qty FROM fact_quality_inspection), labor_summary AS (SELECT COUNT(DISTINCT worker_name) AS worker_count, SUM(duration_minutes) AS total_work_minutes, SUM(report_qty) AS total_output_qty FROM fact_labor_report), scrap_summary AS (SELECT COUNT(*) AS scrap_count FROM fact_scrap) SELECT 'Decision Brief' AS report_title, CURRENT_DATE AS report_date, ss.total_orders AS sales_order_count, ROUND(ss.total_sales_amount, 2) AS total_sales_amount, ROUND(ss.avg_order_amount, 2) AS avg_order_amount, ss.paid_orders AS paid_order_count, ss.partial_orders AS partial_paid_count, ss.unpaid_orders AS unpaid_order_count, ROUND(ss.paid_orders * 100.0 / NULLIF(ss.total_orders, 0), 1) AS payment_completion_rate, ROUND(ss.unpaid_amount, 2) AS receivable_amount, ps.total_work_orders AS work_order_count, ps.closed_orders AS completed_work_orders, ps.started_orders AS in_progress_work_orders, ps.open_orders AS pending_work_orders, ROUND(ps.total_planned_qty, 0) AS planned_qty, ROUND(ps.total_completed_qty, 0) AS completed_qty, ROUND(ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0), 1) AS production_completion_rate, ls.worker_count AS active_worker_count, ROUND(ls.total_work_minutes / 60.0, 1) AS total_work_hours, ROUND(ls.total_output_qty, 0) AS total_output, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 1) AS output_per_worker, ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, qs.inspection_count AS qc_batch_count, ROUND(qs.total_pass_qty, 0) AS pass_qty, ROUND(qs.total_fail_qty, 0) AS fail_qty, ROUND(qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS pass_rate, ROUND(qs.total_fail_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS defect_rate, scr.scrap_count AS scrap_record_count, ar.receipt_count AS ar_receipt_count, ROUND(ar.total_receipt_amount, 2) AS total_ar_amount, ap.payment_count AS ap_payment_count, ROUND(ap.total_payment_amount, 2) AS total_ap_amount, ROUND(ar.total_receipt_amount - ap.total_payment_amount, 2) AS net_cash_flow, inv.invoice_count, ROUND(inv.total_invoice_amount, 2) AS total_invoice_amount, sh.shipment_count, ROUND(sh.total_shipment_amount, 2) AS total_shipment_amount, pur.purchase_order_count, ret.return_count, ROUND(ret.total_return_amount, 2) AS total_return_amount, ROUND(ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0), 2) AS return_rate, CASE WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 95 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 80 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 5 THEN 'EXCELLENT' WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 90 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 60 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 10 THEN 'GOOD' ELSE 'WARNING' END AS health_status FROM sales_summary ss CROSS JOIN production_summary ps CROSS JOIN ar_summary ar CROSS JOIN ap_summary ap CROSS JOIN invoice_summary inv CROSS JOIN return_summary ret CROSS JOIN shipment_summary sh CROSS JOIN purchase_summary pur CROSS JOIN quality_summary qs CROSS JOIN labor_summary ls CROSS JOIN scrap_summary scr", + "parameters": {} + }, + { + "id": "2006300000000000006", + "businessName": "MetricTrendAndTurningPointWarning", + "businessDescription": "指标趋势分析与拐点预警:基于移动平均与线性回归分析人效、产量、废品率趋势,输出上升/下降/平稳判断与拐点预警", + "datasourceId": "19", + "sqlTemplate": "WITH daily_metrics AS (SELECT DATE(lr.event_time_utc::timestamp) AS metric_date, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) / 60.0 AS total_hours, SUM(lr.report_qty) AS total_output, CASE WHEN SUM(lr.duration_minutes) > 0 THEN SUM(lr.report_qty) / (SUM(lr.duration_minutes) / 60.0) ELSE 0 END AS hourly_efficiency FROM fact_labor_report lr GROUP BY DATE(lr.event_time_utc::timestamp)), daily_quality AS (SELECT DATE(qi.event_time_utc::timestamp) AS metric_date, SUM(qi.pass_qty) AS pass_qty, SUM(qi.fail_qty) AS fail_qty, CASE WHEN SUM(qi.pass_qty) + SUM(qi.fail_qty) > 0 THEN SUM(qi.fail_qty) * 100.0 / (SUM(qi.pass_qty) + SUM(qi.fail_qty)) ELSE 0 END AS defect_rate FROM fact_quality_inspection qi GROUP BY DATE(qi.event_time_utc::timestamp)), daily_production AS (SELECT DATE(wo.event_time_utc::timestamp) AS metric_date, SUM(wo.planned_qty) AS planned_qty, SUM(wo.completed_qty) AS completed_qty, CASE WHEN SUM(wo.planned_qty) > 0 THEN SUM(wo.completed_qty) * 100.0 / SUM(wo.planned_qty) ELSE 0 END AS completion_rate FROM fact_work_order wo GROUP BY DATE(wo.event_time_utc::timestamp)), combined_daily AS (SELECT COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) AS metric_date, COALESCE(dm.worker_count, 0) AS worker_count, COALESCE(dm.total_hours, 0) AS total_hours, COALESCE(dm.total_output, 0) AS total_output, COALESCE(dm.hourly_efficiency, 0) AS hourly_efficiency, COALESCE(dq.defect_rate, 0) AS defect_rate, COALESCE(dp.completion_rate, 0) AS completion_rate FROM daily_metrics dm FULL OUTER JOIN daily_quality dq ON dm.metric_date = dq.metric_date FULL OUTER JOIN daily_production dp ON dm.metric_date = dp.metric_date WHERE COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) IS NOT NULL), numbered_data AS (SELECT *, ROW_NUMBER() OVER (ORDER BY metric_date) AS day_seq FROM combined_daily), moving_avg_step1 AS (SELECT metric_date, day_seq, worker_count, total_output, hourly_efficiency, defect_rate, completion_rate, AVG(hourly_efficiency) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_efficiency, AVG(total_output) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_output, AVG(defect_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_defect_rate, AVG(completion_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_completion_rate, AVG(day_seq) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS avg_x FROM numbered_data), moving_avg AS (SELECT *, LAG(ma7_efficiency, 1) OVER (ORDER BY metric_date) AS prev_ma7_efficiency, LAG(ma7_output, 1) OVER (ORDER BY metric_date) AS prev_ma7_output, LAG(ma7_defect_rate, 1) OVER (ORDER BY metric_date) AS prev_ma7_defect_rate FROM moving_avg_step1), slope_calc AS (SELECT *, (ma7_efficiency - LAG(ma7_efficiency, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_efficiency, (ma7_output - LAG(ma7_output, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_output, (ma7_defect_rate - LAG(ma7_defect_rate, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_defect FROM moving_avg), trend_analysis AS (SELECT metric_date, hourly_efficiency, total_output, defect_rate, completion_rate, ROUND(ma7_efficiency, 2) AS ma7_efficiency, ROUND(ma7_output, 2) AS ma7_output, ROUND(ma7_defect_rate, 2) AS ma7_defect_rate, ROUND(COALESCE(slope_efficiency, 0), 4) AS slope_efficiency, ROUND(COALESCE(slope_output, 0), 4) AS slope_output, ROUND(COALESCE(slope_defect, 0), 4) AS slope_defect, prev_ma7_efficiency, prev_ma7_output, prev_ma7_defect_rate, CASE WHEN COALESCE(slope_efficiency, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_efficiency, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS efficiency_trend, CASE WHEN COALESCE(slope_output, 0) > 3 THEN 'RISING' WHEN COALESCE(slope_output, 0) < -3 THEN 'FALLING' ELSE 'STABLE' END AS output_trend, CASE WHEN COALESCE(slope_defect, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_defect, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS defect_trend, CASE WHEN ma7_efficiency > 0 AND ABS(hourly_efficiency - ma7_efficiency) > ma7_efficiency * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS efficiency_status, CASE WHEN ma7_output > 0 AND ABS(total_output - ma7_output) > ma7_output * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS output_status, CASE WHEN defect_rate > ma7_defect_rate * 1.5 AND defect_rate > 5 THEN 'ANOMALY' ELSE 'NORMAL' END AS defect_status FROM slope_calc) SELECT metric_date, ROUND(hourly_efficiency, 2) AS hourly_output, ma7_efficiency AS efficiency_ma7, slope_efficiency, efficiency_trend, efficiency_status, CASE WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency > prev_ma7_efficiency AND slope_efficiency < 0 THEN 'TURNING_POINT' WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency < prev_ma7_efficiency AND slope_efficiency > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS efficiency_turning_point, ROUND(total_output, 0) AS daily_output, ma7_output AS output_ma7, slope_output, output_trend, output_status, CASE WHEN prev_ma7_output IS NOT NULL AND ma7_output > prev_ma7_output AND slope_output < 0 THEN 'TURNING_POINT' WHEN prev_ma7_output IS NOT NULL AND ma7_output < prev_ma7_output AND slope_output > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS output_turning_point, ROUND(defect_rate, 2) AS defect_rate, ma7_defect_rate AS defect_rate_ma7, slope_defect, defect_trend, defect_status, CASE WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate > prev_ma7_defect_rate AND slope_defect < 0 THEN 'TURNING_POINT' WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate < prev_ma7_defect_rate AND slope_defect > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS defect_turning_point FROM trend_analysis ORDER BY metric_date DESC", + "parameters": {} + } +] \ No newline at end of file diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor.log b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor.log new file mode 100644 index 0000000..7327bf8 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor.log @@ -0,0 +1,233 @@ +2026-01-08 00:15:16 - root - INFO - [logger_config.py:151] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_mcpskills_analyzeOrder\lzwcai_mcpskills_analyzeOrder\logs +2026-01-08 00:15:16 - root - INFO - [logger_config.py:152] - 日志配置 - 级别: INFO, 文件大小限制: 10MB, 备份数量: 5 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:362] - 开始运行 MCP SQL Executor 服务器 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:313] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:314] - 正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:315] - 版本: 0.1.0 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:316] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:320] - 环境配置 - Database ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:321] - 环境配置 - Datasource ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:322] - 环境配置 - Skill ID: +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:323] - 环境配置 - Backend Base URL: http://192.168.11.24:8088 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:324] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:329] - MCP 服务器已启动,等待客户端连接... +2026-01-08 00:15:17 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:156] - 收到列出工具请求 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:119] - 初始化查询配置(数据源: local)... +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:55] - 成功加载 6 个业务查询配置 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:123] - 本地配置: 6 条 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:165] - 成功生成 6 个 MCP 工具 +2026-01-08 00:15:19 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OrderDelayWarningAnalysis +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OrderDelayWarningAnalysis", + "businessDescription": "订单延迟预警分析:依据历史订单的生产周期、物流延误、设备故障等特征,输出延迟概率与红/黄/绿预警等级", + "sqlTemplate": "WITH production_cycle_stats AS (SELECT COALESCE(AVG(GREATEST(0, EXTRACT(DAY FROM last_updated_utc - event_time_utc))), 0) AS avg_production_days FROM fact_work_order WHERE status = 'CLOSED' AND last_updated_utc >= event_time_utc), logistics_delay_stats AS (SELECT customer_id, AVG(GREATEST(0, EXTRACT(DAY FROM event_time_utc - doc_date_utc))) AS avg_logistics_delay_days, SUM(CASE WHEN EXTRACT(DAY FROM event_time_utc - doc_date_utc) > 3 THEN 1 ELSE 0 END) AS delay_count FROM fact_sales_shipment WHERE doc_date_utc IS NOT NULL AND event_time_utc IS NOT NULL GROUP BY customer_id), quality_issue_stats AS (SELECT COALESCE(ROUND(SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty + fail_qty), 0), 2), 0) AS defect_rate_pct FROM fact_quality_inspection WHERE pass_qty IS NOT NULL AND fail_qty IS NOT NULL), scrap_stats AS (SELECT COALESCE((SELECT COUNT(*) FROM fact_scrap) * 100.0 / NULLIF((SELECT COUNT(*) FROM fact_work_order WHERE status = 'CLOSED'), 0), 0) AS scrap_rate_pct), active_work_order_risk AS (SELECT COUNT(*) AS active_wo_count, COALESCE(SUM(CASE WHEN planned_qty > 0 AND (completed_qty / planned_qty) < 0.3 AND EXTRACT(DAY FROM NOW() - event_time_utc) > 7 THEN 1 ELSE 0 END), 0) AS lagging_wo_count FROM fact_work_order WHERE status IN ('OPEN', 'STARTED')), global_metrics AS (SELECT pcs.avg_production_days, qis.defect_rate_pct, ss.scrap_rate_pct, awr.active_wo_count, awr.lagging_wo_count FROM production_cycle_stats pcs, quality_issue_stats qis, scrap_stats ss, active_work_order_risk awr) SELECT so.sales_order_number AS \"订单编号\", c.customer_name AS \"客户名称\", so.order_date_utc::DATE AS \"订单日期\", so.deal_amount AS \"订单金额\", so.payment_status AS \"付款状态\", ROUND(gm.avg_production_days::NUMERIC, 1) AS \"历史平均生产周期(天)\", ROUND(COALESCE(lds.avg_logistics_delay_days, 0)::NUMERIC, 1) AS \"历史平均物流延迟(天)\", COALESCE(lds.delay_count, 0)::INT AS \"历史延误次数\", ROUND(gm.defect_rate_pct::NUMERIC, 2) AS \"产品不良率%\", ROUND(gm.scrap_rate_pct::NUMERIC, 2) AS \"报废率%\", gm.active_wo_count::INT AS \"进行中工单数\", gm.lagging_wo_count::INT AS \"滞后工单数\", ROUND(LEAST(100, GREATEST(0, LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)))::NUMERIC, 1) AS \"延迟概率%\", CASE WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 60 THEN '红色' WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 30 THEN '黄色' ELSE '绿色' END AS \"预警等级\", CASE WHEN gm.lagging_wo_count >= 2 THEN '生产严重滞后' WHEN COALESCE(lds.avg_logistics_delay_days, 0) > 5 THEN '物流延误风险高' WHEN gm.avg_production_days > 15 THEN '生产周期过长' WHEN gm.defect_rate_pct > 10 THEN '质量问题突出' ELSE '正常' END AS \"主要风险因素\" FROM fact_sales_order so LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = 't' CROSS JOIN global_metrics gm LEFT JOIN logistics_delay_stats lds ON so.customer_id = lds.customer_id ORDER BY \"延迟概率%\" DESC, so.order_date_utc DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:19 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:27 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→待生产, STARTED→生产中, CLOSED→已完成),呈现执行进度与异常节点", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN '待生产' WHEN 'STARTED' THEN '生产中' WHEN 'CLOSED' THEN '已完成' ELSE '未知' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN '质量异常' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN '无报工记录' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN '效率偏低' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number AS \"工单号\", product_name AS \"产品名称\", product_category AS \"产品类别\", status_name AS \"状态\", planned_qty AS \"计划数量\", completed_qty AS \"完成数量\", remaining_qty AS \"剩余数量\", completion_rate AS \"完成率(%)\", worker_count AS \"参与人数\", ROUND(total_work_minutes / 60.0, 1) AS \"累计工时(小时)\", elapsed_hours AS \"已用时间(小时)\", COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS \"异常标记\", CASE WHEN progress_anomaly = '进度严重滞后' OR quality_anomaly IS NOT NULL THEN '高' WHEN progress_anomaly = '进度滞后' OR labor_anomaly IS NOT NULL THEN '中' WHEN efficiency_anomaly IS NOT NULL THEN '低' ELSE '-' END AS \"风险等级\" FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:28 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:28 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:28 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:37 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OnePageDecisionBrief +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OnePageDecisionBrief", + "businessDescription": "一页式决策简报:自动聚合订单、生产、财务、售后等关键数据,生成经营决策简报", + "sqlTemplate": "WITH sales_summary AS (SELECT COUNT(*) AS total_orders, SUM(deal_amount) AS total_sales_amount, AVG(deal_amount) AS avg_order_amount, SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_orders, SUM(CASE WHEN payment_status = 'PARTIAL' THEN 1 ELSE 0 END) AS partial_orders, SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_orders, SUM(CASE WHEN payment_status = 'PAID' THEN deal_amount ELSE 0 END) AS paid_amount, SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) AS unpaid_amount FROM fact_sales_order), production_summary AS (SELECT COUNT(*) AS total_work_orders, SUM(planned_qty) AS total_planned_qty, SUM(completed_qty) AS total_completed_qty, SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order), ar_summary AS (SELECT COUNT(*) AS receipt_count, SUM(amount) AS total_receipt_amount, AVG(amount) AS avg_receipt_amount FROM fact_ar_receipt), ap_summary AS (SELECT COUNT(*) AS payment_count, SUM(amount) AS total_payment_amount, AVG(amount) AS avg_payment_amount FROM fact_ap_payment), invoice_summary AS (SELECT COUNT(*) AS invoice_count, SUM(invoice_amount) AS total_invoice_amount, AVG(invoice_amount) AS avg_invoice_amount FROM fact_invoice), return_summary AS (SELECT COUNT(*) AS return_count, SUM(amount) AS total_return_amount, AVG(amount) AS avg_return_amount FROM fact_sales_return), shipment_summary AS (SELECT COUNT(*) AS shipment_count, SUM(amount) AS total_shipment_amount, AVG(amount) AS avg_shipment_amount FROM fact_sales_shipment), purchase_summary AS (SELECT COUNT(*) AS purchase_order_count FROM fact_purchase_order), quality_summary AS (SELECT COUNT(*) AS inspection_count, SUM(pass_qty) AS total_pass_qty, SUM(fail_qty) AS total_fail_qty FROM fact_quality_inspection), labor_summary AS (SELECT COUNT(DISTINCT worker_name) AS worker_count, SUM(duration_minutes) AS total_work_minutes, SUM(report_qty) AS total_output_qty FROM fact_labor_report), scrap_summary AS (SELECT COUNT(*) AS scrap_count FROM fact_scrap) SELECT '经营决策简报' AS \"报告标题\", CURRENT_DATE AS \"报告日期\", ss.total_orders AS \"销售订单总数\", ROUND(ss.total_sales_amount, 2) AS \"销售总金额(元)\", ROUND(ss.avg_order_amount, 2) AS \"平均订单金额(元)\", ss.paid_orders AS \"已付款订单\", ss.partial_orders AS \"部分付款订单\", ss.unpaid_orders AS \"未付款订单\", ROUND(ss.paid_orders * 100.0 / NULLIF(ss.total_orders, 0), 1) AS \"付款完成率(%)\", ROUND(ss.unpaid_amount, 2) AS \"待收款金额(元)\", ps.total_work_orders AS \"工单总数\", ps.closed_orders AS \"已完成工单\", ps.started_orders AS \"进行中工单\", ps.open_orders AS \"待开始工单\", ROUND(ps.total_planned_qty, 0) AS \"计划产量\", ROUND(ps.total_completed_qty, 0) AS \"完成产量\", ROUND(ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0), 1) AS \"生产完成率(%)\", ls.worker_count AS \"活跃员工数\", ROUND(ls.total_work_minutes / 60.0, 1) AS \"总工时(小时)\", ROUND(ls.total_output_qty, 0) AS \"总产出量\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 1) AS \"人均产量\", ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS \"时均产量(件/小时)\", qs.inspection_count AS \"质检批次\", ROUND(qs.total_pass_qty, 0) AS \"合格数量\", ROUND(qs.total_fail_qty, 0) AS \"不合格数量\", ROUND(qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS \"合格率(%)\", ROUND(qs.total_fail_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS \"不良率(%)\", scr.scrap_count AS \"报废记录数\", ar.receipt_count AS \"收款笔数\", ROUND(ar.total_receipt_amount, 2) AS \"收款总额(元)\", ap.payment_count AS \"付款笔数\", ROUND(ap.total_payment_amount, 2) AS \"付款总额(元)\", ROUND(ar.total_receipt_amount - ap.total_payment_amount, 2) AS \"净现金流(元)\", inv.invoice_count AS \"开票数量\", ROUND(inv.total_invoice_amount, 2) AS \"开票总额(元)\", sh.shipment_count AS \"发货单数\", ROUND(sh.total_shipment_amount, 2) AS \"发货总金额(元)\", pur.purchase_order_count AS \"采购订单数\", ret.return_count AS \"退货单数\", ROUND(ret.total_return_amount, 2) AS \"退货总金额(元)\", ROUND(ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0), 2) AS \"退货率(%)\", CASE WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 95 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 80 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 5 THEN '优秀 - 各项指标健康' WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 90 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 60 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 10 THEN '良好 - 部分指标需关注' ELSE '预警 - 需要立即改善' END AS \"经营健康度\" FROM sales_summary ss CROSS JOIN production_summary ps CROSS JOIN ar_summary ar CROSS JOIN ap_summary ap CROSS JOIN invoice_summary inv CROSS JOIN return_summary ret CROSS JOIN shipment_summary sh CROSS JOIN purchase_summary pur CROSS JOIN quality_summary qs CROSS JOIN labor_summary ls CROSS JOIN scrap_summary scr", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:38 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:38 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:38 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:58 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: EfficiencyOutputLossDashboard +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:58 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:58 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "EfficiencyOutputLossDashboard", + "businessDescription": "人效-产值-损耗三维模型仪表盘:关联订单量×工时×人员数×成本,构建人效—产值—损耗三维模型,按部门(产品类别)汇总展示", + "sqlTemplate": "WITH labor_stats AS (SELECT p.product_category AS department, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) AS total_work_minutes, SUM(lr.report_qty) AS total_output_qty, COUNT(DISTINCT lr.work_order_number) AS work_order_count FROM fact_labor_report lr INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), work_order_stats AS (SELECT p.product_category AS department, COUNT(*) AS total_work_orders, SUM(wo.planned_qty) AS total_planned_qty, SUM(wo.completed_qty) AS total_completed_qty, SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order wo INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), quality_stats AS (SELECT p.product_category AS department, SUM(qi.pass_qty) AS total_pass_qty, SUM(qi.fail_qty) AS total_fail_qty, COUNT(*) AS inspection_count FROM fact_quality_inspection qi INNER JOIN dim_product p ON qi.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), sales_stats AS (SELECT AVG(deal_amount) AS avg_order_amount, SUM(deal_amount) AS total_sales_amount, COUNT(*) AS order_count FROM fact_sales_order), scrap_stats AS (SELECT COUNT(*) AS total_scrap_count FROM fact_scrap) SELECT ls.department AS \"部门(产品类别)\", ls.worker_count AS \"人员数\", ROUND(ls.total_work_minutes / 60.0, 2) AS \"总工时(小时)\", ls.total_output_qty AS \"总产量\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 2) AS \"人均产量\", ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS \"时均产量(件/小时)\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0), 2) AS \"人效指数(产量/人/小时)\", ws.total_planned_qty AS \"计划产量\", ws.total_completed_qty AS \"完成产量\", ROUND(ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS \"计划完成率(%)\", ROUND(ws.total_completed_qty * ss.avg_order_amount / 100, 2) AS \"估算产值(元)\", ROUND(ws.total_completed_qty * ss.avg_order_amount / 100 / NULLIF(ls.worker_count, 0), 2) AS \"人均产值(元)\", qs.total_pass_qty AS \"质检合格数\", qs.total_fail_qty AS \"质检不合格数\", ROUND(qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100, 2) AS \"不良率(%)\", ROUND((ws.total_planned_qty - ws.total_completed_qty) / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS \"生产损耗率(%)\", ROUND((ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0)) * 0.4 + (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) * 0.35 + (qs.total_pass_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) * 0.25, 2) AS \"综合绩效得分\", CASE WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 10 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 50 THEN '红色预警' WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 5 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 70 THEN '黄色预警' ELSE '正常' END AS \"状态预警\" FROM labor_stats ls LEFT JOIN work_order_stats ws ON ls.department = ws.department LEFT JOIN quality_stats qs ON ls.department = qs.department CROSS JOIN sales_stats ss CROSS JOIN scrap_stats scr ORDER BY \"综合绩效得分\" DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:59 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:59 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:59 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:07 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: SupplyChainRiskWarning +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "SupplyChainRiskWarning", + "businessDescription": "供应链风险预警:整合采购系统中的供应商历史交期与质检合格率,结合外采物流数据,识别交期异常+物流停滞组合风险模式,自动推送高风险订单提示", + "sqlTemplate": "WITH supplier_delivery AS (SELECT po.supplier_id, COUNT(*) AS order_count, COUNT(pr.purchase_receipt_id) AS receipt_count, AVG(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS avg_delivery_days, MAX(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS max_delivery_days, STDDEV(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS stddev_delivery_days FROM fact_purchase_order po LEFT JOIN fact_purchase_receipt pr ON po.supplier_id = pr.supplier_id GROUP BY po.supplier_id), supplier_quality AS (SELECT pr.supplier_id, COUNT(pr.purchase_receipt_id) AS total_receipts, SUM(pr.receipt_qty_total) AS total_qty, SUM(pr.amount) AS total_amount FROM fact_purchase_receipt pr GROUP BY pr.supplier_id), supplier_returns AS (SELECT pret.supplier_id, COUNT(*) AS return_count, SUM(CASE WHEN pret.return_reason = '损坏' THEN 1 ELSE 0 END) AS damage_count FROM fact_purchase_return pret GROUP BY pret.supplier_id), supplier_quality_rate AS (SELECT sq.supplier_id, sq.total_receipts, sq.total_qty, sq.total_amount, COALESCE(sr.return_count, 0) AS return_count, COALESCE(sr.damage_count, 0) AS damage_count, CASE WHEN sq.total_receipts > 0 THEN (sq.total_receipts - COALESCE(sr.return_count, 0)) * 100.0 / sq.total_receipts ELSE 100 END AS quality_rate FROM supplier_quality sq LEFT JOIN supplier_returns sr ON sq.supplier_id = sr.supplier_id), supplier_risk AS (SELECT s.supplier_id, s.supplier_name, s.supplier_category, COALESCE(sd.order_count, 0) AS order_count, COALESCE(sd.receipt_count, 0) AS receipt_count, ROUND(COALESCE(sd.avg_delivery_days, 0), 1) AS avg_delivery_days, ROUND(COALESCE(sd.max_delivery_days, 0), 1) AS max_delivery_days, ROUND(COALESCE(sd.stddev_delivery_days, 0), 1) AS delivery_volatility, COALESCE(sqr.total_receipts, 0) AS total_receipts, COALESCE(sqr.return_count, 0) AS return_count, ROUND(COALESCE(sqr.quality_rate, 100), 1) AS quality_rate, CASE WHEN COALESCE(sd.avg_delivery_days, 0) > 60 THEN 40 WHEN COALESCE(sd.avg_delivery_days, 0) > 45 THEN 30 WHEN COALESCE(sd.avg_delivery_days, 0) > 30 THEN 20 ELSE 10 END + CASE WHEN COALESCE(sd.stddev_delivery_days, 0) > 20 THEN 30 WHEN COALESCE(sd.stddev_delivery_days, 0) > 10 THEN 20 ELSE 10 END AS delivery_risk_score, CASE WHEN COALESCE(sqr.quality_rate, 100) < 80 THEN 50 WHEN COALESCE(sqr.quality_rate, 100) < 90 THEN 30 WHEN COALESCE(sqr.quality_rate, 100) < 95 THEN 15 ELSE 5 END AS quality_risk_score FROM dim_supplier s LEFT JOIN supplier_delivery sd ON s.supplier_id = sd.supplier_id LEFT JOIN supplier_quality_rate sqr ON s.supplier_id = sqr.supplier_id WHERE s.is_current = 't'), supplier_risk_level AS (SELECT *, delivery_risk_score + quality_risk_score AS total_risk_score, CASE WHEN delivery_risk_score + quality_risk_score >= 80 THEN '高风险' WHEN delivery_risk_score + quality_risk_score >= 50 THEN '中风险' ELSE '低风险' END AS risk_level, CASE WHEN delivery_risk_score >= 50 AND quality_risk_score >= 30 THEN '交期异常+质量问题' WHEN delivery_risk_score >= 50 THEN '交期异常' WHEN quality_risk_score >= 30 THEN '质量问题' ELSE '正常' END AS risk_pattern FROM supplier_risk) SELECT supplier_name AS \"供应商名称\", supplier_category AS \"供应商类别\", order_count AS \"订单数\", receipt_count AS \"收货数\", avg_delivery_days AS \"平均交期(天)\", max_delivery_days AS \"最长交期(天)\", delivery_volatility AS \"交期波动\", total_receipts AS \"收货批次\", return_count AS \"退货次数\", quality_rate AS \"合格率(%)\", delivery_risk_score AS \"交期风险分\", quality_risk_score AS \"质量风险分\", total_risk_score AS \"综合风险分\", risk_level AS \"风险等级\", risk_pattern AS \"风险模式\" FROM supplier_risk_level ORDER BY total_risk_score DESC, supplier_name", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:16:07 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:13 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→待生产, STARTED→生产中, CLOSED→已完成),呈现执行进度与异常节点", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN '待生产' WHEN 'STARTED' THEN '生产中' WHEN 'CLOSED' THEN '已完成' ELSE '未知' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN '质量异常' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN '无报工记录' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN '效率偏低' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number AS \"工单号\", product_name AS \"产品名称\", product_category AS \"产品类别\", status_name AS \"状态\", planned_qty AS \"计划数量\", completed_qty AS \"完成数量\", remaining_qty AS \"剩余数量\", completion_rate AS \"完成率(%)\", worker_count AS \"参与人数\", ROUND(total_work_minutes / 60.0, 1) AS \"累计工时(小时)\", elapsed_hours AS \"已用时间(小时)\", COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS \"异常标记\", CASE WHEN progress_anomaly = '进度严重滞后' OR quality_anomaly IS NOT NULL THEN '高' WHEN progress_anomaly = '进度滞后' OR labor_anomaly IS NOT NULL THEN '中' WHEN efficiency_anomaly IS NOT NULL THEN '低' ELSE '-' END AS \"风险等级\" FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:16:13 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:22 - root - INFO - [logger_config.py:151] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_mcpskills_analyzeOrder\lzwcai_mcpskills_analyzeOrder\logs +2026-01-08 00:30:22 - root - INFO - [logger_config.py:152] - 日志配置 - 级别: INFO, 文件大小限制: 10MB, 备份数量: 5 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:362] - 开始运行 MCP SQL Executor 服务器 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:313] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:314] - 正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:315] - 版本: 0.1.0 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:316] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:320] - 环境配置 - Database ID: 19 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:321] - 环境配置 - Datasource ID: 19 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:322] - 环境配置 - Skill ID: +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:323] - 环境配置 - Backend Base URL: http://192.168.11.24:8088 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:324] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:329] - MCP 服务器已启动,等待客户端连接... +2026-01-08 00:30:26 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:156] - 收到列出工具请求 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:119] - 初始化查询配置(数据源: local)... +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:55] - 成功加载 6 个业务查询配置 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:123] - 本地配置: 6 条 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:165] - 成功生成 6 个 MCP 工具 +2026-01-08 00:30:27 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OrderDelayWarningAnalysis +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OrderDelayWarningAnalysis", + "businessDescription": "订单延迟预警分析:依据历史订单的生产周期、物流延误、设备故障等特征,输出延迟概率与红/黄/绿预警等级", + "sqlTemplate": "WITH production_cycle_stats AS (SELECT COALESCE(AVG(GREATEST(0, EXTRACT(DAY FROM last_updated_utc - event_time_utc))), 0) AS avg_production_days FROM fact_work_order WHERE status = 'CLOSED' AND last_updated_utc >= event_time_utc), logistics_delay_stats AS (SELECT customer_id, AVG(GREATEST(0, EXTRACT(DAY FROM event_time_utc - doc_date_utc))) AS avg_logistics_delay_days, SUM(CASE WHEN EXTRACT(DAY FROM event_time_utc - doc_date_utc) > 3 THEN 1 ELSE 0 END) AS delay_count FROM fact_sales_shipment WHERE doc_date_utc IS NOT NULL AND event_time_utc IS NOT NULL GROUP BY customer_id), quality_issue_stats AS (SELECT COALESCE(ROUND(SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty + fail_qty), 0), 2), 0) AS defect_rate_pct FROM fact_quality_inspection WHERE pass_qty IS NOT NULL AND fail_qty IS NOT NULL), scrap_stats AS (SELECT COALESCE((SELECT COUNT(*) FROM fact_scrap) * 100.0 / NULLIF((SELECT COUNT(*) FROM fact_work_order WHERE status = 'CLOSED'), 0), 0) AS scrap_rate_pct), active_work_order_risk AS (SELECT COUNT(*) AS active_wo_count, COALESCE(SUM(CASE WHEN planned_qty > 0 AND (completed_qty / planned_qty) < 0.3 AND EXTRACT(DAY FROM NOW() - event_time_utc) > 7 THEN 1 ELSE 0 END), 0) AS lagging_wo_count FROM fact_work_order WHERE status IN ('OPEN', 'STARTED')), global_metrics AS (SELECT pcs.avg_production_days, qis.defect_rate_pct, ss.scrap_rate_pct, awr.active_wo_count, awr.lagging_wo_count FROM production_cycle_stats pcs, quality_issue_stats qis, scrap_stats ss, active_work_order_risk awr) SELECT so.sales_order_number AS order_number, c.customer_name, so.order_date_utc::DATE AS order_date, so.deal_amount AS order_amount, so.payment_status, ROUND(gm.avg_production_days::NUMERIC, 1) AS avg_production_days, ROUND(COALESCE(lds.avg_logistics_delay_days, 0)::NUMERIC, 1) AS avg_logistics_delay_days, COALESCE(lds.delay_count, 0)::INT AS historical_delay_count, ROUND(gm.defect_rate_pct::NUMERIC, 2) AS defect_rate_pct, ROUND(gm.scrap_rate_pct::NUMERIC, 2) AS scrap_rate_pct, gm.active_wo_count::INT AS active_work_order_count, gm.lagging_wo_count::INT AS lagging_work_order_count, ROUND(LEAST(100, GREATEST(0, LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)))::NUMERIC, 1) AS delay_probability_pct, CASE WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 60 THEN 'RED' WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 30 THEN 'YELLOW' ELSE 'GREEN' END AS warning_level, CASE WHEN gm.lagging_wo_count >= 2 THEN 'PRODUCTION_SEVERELY_DELAYED' WHEN COALESCE(lds.avg_logistics_delay_days, 0) > 5 THEN 'HIGH_LOGISTICS_DELAY_RISK' WHEN gm.avg_production_days > 15 THEN 'LONG_PRODUCTION_CYCLE' WHEN gm.defect_rate_pct > 10 THEN 'QUALITY_ISSUES' ELSE 'NORMAL' END AS primary_risk_factor FROM fact_sales_order so LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = 't' CROSS JOIN global_metrics gm LEFT JOIN logistics_delay_stats lds ON so.customer_id = lds.customer_id ORDER BY delay_probability_pct DESC, so.order_date_utc DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:27 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:32 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:32 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:32 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→PENDING, STARTED→IN_PROGRESS, CLOSED→COMPLETED),呈现执行进度与异常节点", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN 'PENDING' WHEN 'STARTED' THEN 'IN_PROGRESS' WHEN 'CLOSED' THEN 'COMPLETED' ELSE 'UNKNOWN' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN 'SEVERELY_DELAYED' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN 'DELAYED' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN 'QUALITY_ISSUE' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN 'LABOR_STALLED' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN 'NO_LABOR_RECORD' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN 'LOW_EFFICIENCY' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number, product_name, product_category, status_name, planned_qty, completed_qty, remaining_qty, completion_rate, worker_count, ROUND(total_work_minutes / 60.0, 1) AS total_work_hours, elapsed_hours, COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS anomaly_flags, CASE WHEN progress_anomaly = 'SEVERELY_DELAYED' OR quality_anomaly IS NOT NULL THEN 'HIGH' WHEN progress_anomaly = 'DELAYED' OR labor_anomaly IS NOT NULL THEN 'MEDIUM' WHEN efficiency_anomaly IS NOT NULL THEN 'LOW' ELSE 'NONE' END AS risk_level FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:32 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:32 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:34 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: SupplyChainRiskWarning +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:34 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:34 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "SupplyChainRiskWarning", + "businessDescription": "供应链风险预警:整合采购系统中的供应商历史交期与质检合格率,结合外采物流数据,识别交期异常+物流停滞组合风险模式,自动推送高风险订单提示", + "sqlTemplate": "WITH supplier_delivery AS (SELECT po.supplier_id, COUNT(*) AS order_count, COUNT(pr.purchase_receipt_id) AS receipt_count, AVG(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS avg_delivery_days, MAX(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS max_delivery_days, STDDEV(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS stddev_delivery_days FROM fact_purchase_order po LEFT JOIN fact_purchase_receipt pr ON po.supplier_id = pr.supplier_id GROUP BY po.supplier_id), supplier_quality AS (SELECT pr.supplier_id, COUNT(pr.purchase_receipt_id) AS total_receipts, SUM(pr.receipt_qty_total) AS total_qty, SUM(pr.amount) AS total_amount FROM fact_purchase_receipt pr GROUP BY pr.supplier_id), supplier_returns AS (SELECT pret.supplier_id, COUNT(*) AS return_count, SUM(CASE WHEN pret.return_reason = '损坏' THEN 1 ELSE 0 END) AS damage_count FROM fact_purchase_return pret GROUP BY pret.supplier_id), supplier_quality_rate AS (SELECT sq.supplier_id, sq.total_receipts, sq.total_qty, sq.total_amount, COALESCE(sr.return_count, 0) AS return_count, COALESCE(sr.damage_count, 0) AS damage_count, CASE WHEN sq.total_receipts > 0 THEN (sq.total_receipts - COALESCE(sr.return_count, 0)) * 100.0 / sq.total_receipts ELSE 100 END AS quality_rate FROM supplier_quality sq LEFT JOIN supplier_returns sr ON sq.supplier_id = sr.supplier_id), supplier_risk AS (SELECT s.supplier_id, s.supplier_name, s.supplier_category, COALESCE(sd.order_count, 0) AS order_count, COALESCE(sd.receipt_count, 0) AS receipt_count, ROUND(COALESCE(sd.avg_delivery_days, 0), 1) AS avg_delivery_days, ROUND(COALESCE(sd.max_delivery_days, 0), 1) AS max_delivery_days, ROUND(COALESCE(sd.stddev_delivery_days, 0), 1) AS delivery_volatility, COALESCE(sqr.total_receipts, 0) AS total_receipts, COALESCE(sqr.return_count, 0) AS return_count, ROUND(COALESCE(sqr.quality_rate, 100), 1) AS quality_rate, CASE WHEN COALESCE(sd.avg_delivery_days, 0) > 60 THEN 40 WHEN COALESCE(sd.avg_delivery_days, 0) > 45 THEN 30 WHEN COALESCE(sd.avg_delivery_days, 0) > 30 THEN 20 ELSE 10 END + CASE WHEN COALESCE(sd.stddev_delivery_days, 0) > 20 THEN 30 WHEN COALESCE(sd.stddev_delivery_days, 0) > 10 THEN 20 ELSE 10 END AS delivery_risk_score, CASE WHEN COALESCE(sqr.quality_rate, 100) < 80 THEN 50 WHEN COALESCE(sqr.quality_rate, 100) < 90 THEN 30 WHEN COALESCE(sqr.quality_rate, 100) < 95 THEN 15 ELSE 5 END AS quality_risk_score FROM dim_supplier s LEFT JOIN supplier_delivery sd ON s.supplier_id = sd.supplier_id LEFT JOIN supplier_quality_rate sqr ON s.supplier_id = sqr.supplier_id WHERE s.is_current = 't'), supplier_risk_level AS (SELECT *, delivery_risk_score + quality_risk_score AS total_risk_score, CASE WHEN delivery_risk_score + quality_risk_score >= 80 THEN 'HIGH' WHEN delivery_risk_score + quality_risk_score >= 50 THEN 'MEDIUM' ELSE 'LOW' END AS risk_level, CASE WHEN delivery_risk_score >= 50 AND quality_risk_score >= 30 THEN 'DELIVERY_AND_QUALITY' WHEN delivery_risk_score >= 50 THEN 'DELIVERY_ISSUE' WHEN quality_risk_score >= 30 THEN 'QUALITY_ISSUE' ELSE 'NORMAL' END AS risk_pattern FROM supplier_risk) SELECT supplier_name, supplier_category, order_count, receipt_count, avg_delivery_days, max_delivery_days, delivery_volatility, total_receipts, return_count, quality_rate, delivery_risk_score, quality_risk_score, total_risk_score, risk_level, risk_pattern FROM supplier_risk_level ORDER BY total_risk_score DESC, supplier_name", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:34 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:34 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:35 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: EfficiencyOutputLossDashboard +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:35 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:35 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "EfficiencyOutputLossDashboard", + "businessDescription": "人效-产值-损耗三维模型仪表盘:关联订单量×工时×人员数×成本,构建人效—产值—损耗三维模型,按部门(产品类别)汇总展示", + "sqlTemplate": "WITH labor_stats AS (SELECT p.product_category AS department, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) AS total_work_minutes, SUM(lr.report_qty) AS total_output_qty, COUNT(DISTINCT lr.work_order_number) AS work_order_count FROM fact_labor_report lr INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), work_order_stats AS (SELECT p.product_category AS department, COUNT(*) AS total_work_orders, SUM(wo.planned_qty) AS total_planned_qty, SUM(wo.completed_qty) AS total_completed_qty, SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order wo INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), quality_stats AS (SELECT p.product_category AS department, SUM(qi.pass_qty) AS total_pass_qty, SUM(qi.fail_qty) AS total_fail_qty, COUNT(*) AS inspection_count FROM fact_quality_inspection qi INNER JOIN dim_product p ON qi.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), sales_stats AS (SELECT AVG(deal_amount) AS avg_order_amount, SUM(deal_amount) AS total_sales_amount, COUNT(*) AS order_count FROM fact_sales_order), scrap_stats AS (SELECT COUNT(*) AS total_scrap_count FROM fact_scrap) SELECT ls.department, ls.worker_count, ROUND(ls.total_work_minutes / 60.0, 2) AS total_work_hours, ls.total_output_qty, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 2) AS output_per_worker, ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0), 2) AS efficiency_index, ws.total_planned_qty AS planned_qty, ws.total_completed_qty AS completed_qty, ROUND(ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS plan_completion_rate, ROUND(ws.total_completed_qty * ss.avg_order_amount / 100, 2) AS estimated_output_value, ROUND(ws.total_completed_qty * ss.avg_order_amount / 100 / NULLIF(ls.worker_count, 0), 2) AS output_value_per_worker, qs.total_pass_qty AS qc_pass_qty, qs.total_fail_qty AS qc_fail_qty, ROUND(qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100, 2) AS defect_rate, ROUND((ws.total_planned_qty - ws.total_completed_qty) / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS production_loss_rate, ROUND((ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0)) * 0.4 + (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) * 0.35 + (qs.total_pass_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) * 0.25, 2) AS performance_score, CASE WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 10 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 50 THEN 'RED' WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 5 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 70 THEN 'YELLOW' ELSE 'GREEN' END AS warning_level FROM labor_stats ls LEFT JOIN work_order_stats ws ON ls.department = ws.department LEFT JOIN quality_stats qs ON ls.department = qs.department CROSS JOIN sales_stats ss CROSS JOIN scrap_stats scr ORDER BY performance_score DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:35 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:35 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:37 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:37 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OnePageDecisionBrief +2026-01-08 00:30:37 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OnePageDecisionBrief", + "businessDescription": "一页式决策简报:自动聚合订单、生产、财务、售后等关键数据,生成经营决策简报", + "sqlTemplate": "WITH sales_summary AS (SELECT COUNT(*) AS total_orders, SUM(deal_amount) AS total_sales_amount, AVG(deal_amount) AS avg_order_amount, SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_orders, SUM(CASE WHEN payment_status = 'PARTIAL' THEN 1 ELSE 0 END) AS partial_orders, SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_orders, SUM(CASE WHEN payment_status = 'PAID' THEN deal_amount ELSE 0 END) AS paid_amount, SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) AS unpaid_amount FROM fact_sales_order), production_summary AS (SELECT COUNT(*) AS total_work_orders, SUM(planned_qty) AS total_planned_qty, SUM(completed_qty) AS total_completed_qty, SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order), ar_summary AS (SELECT COUNT(*) AS receipt_count, SUM(amount) AS total_receipt_amount, AVG(amount) AS avg_receipt_amount FROM fact_ar_receipt), ap_summary AS (SELECT COUNT(*) AS payment_count, SUM(amount) AS total_payment_amount, AVG(amount) AS avg_payment_amount FROM fact_ap_payment), invoice_summary AS (SELECT COUNT(*) AS invoice_count, SUM(invoice_amount) AS total_invoice_amount, AVG(invoice_amount) AS avg_invoice_amount FROM fact_invoice), return_summary AS (SELECT COUNT(*) AS return_count, SUM(amount) AS total_return_amount, AVG(amount) AS avg_return_amount FROM fact_sales_return), shipment_summary AS (SELECT COUNT(*) AS shipment_count, SUM(amount) AS total_shipment_amount, AVG(amount) AS avg_shipment_amount FROM fact_sales_shipment), purchase_summary AS (SELECT COUNT(*) AS purchase_order_count FROM fact_purchase_order), quality_summary AS (SELECT COUNT(*) AS inspection_count, SUM(pass_qty) AS total_pass_qty, SUM(fail_qty) AS total_fail_qty FROM fact_quality_inspection), labor_summary AS (SELECT COUNT(DISTINCT worker_name) AS worker_count, SUM(duration_minutes) AS total_work_minutes, SUM(report_qty) AS total_output_qty FROM fact_labor_report), scrap_summary AS (SELECT COUNT(*) AS scrap_count FROM fact_scrap) SELECT 'Decision Brief' AS report_title, CURRENT_DATE AS report_date, ss.total_orders AS sales_order_count, ROUND(ss.total_sales_amount, 2) AS total_sales_amount, ROUND(ss.avg_order_amount, 2) AS avg_order_amount, ss.paid_orders AS paid_order_count, ss.partial_orders AS partial_paid_count, ss.unpaid_orders AS unpaid_order_count, ROUND(ss.paid_orders * 100.0 / NULLIF(ss.total_orders, 0), 1) AS payment_completion_rate, ROUND(ss.unpaid_amount, 2) AS receivable_amount, ps.total_work_orders AS work_order_count, ps.closed_orders AS completed_work_orders, ps.started_orders AS in_progress_work_orders, ps.open_orders AS pending_work_orders, ROUND(ps.total_planned_qty, 0) AS planned_qty, ROUND(ps.total_completed_qty, 0) AS completed_qty, ROUND(ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0), 1) AS production_completion_rate, ls.worker_count AS active_worker_count, ROUND(ls.total_work_minutes / 60.0, 1) AS total_work_hours, ROUND(ls.total_output_qty, 0) AS total_output, ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 1) AS output_per_worker, ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, qs.inspection_count AS qc_batch_count, ROUND(qs.total_pass_qty, 0) AS pass_qty, ROUND(qs.total_fail_qty, 0) AS fail_qty, ROUND(qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS pass_rate, ROUND(qs.total_fail_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS defect_rate, scr.scrap_count AS scrap_record_count, ar.receipt_count AS ar_receipt_count, ROUND(ar.total_receipt_amount, 2) AS total_ar_amount, ap.payment_count AS ap_payment_count, ROUND(ap.total_payment_amount, 2) AS total_ap_amount, ROUND(ar.total_receipt_amount - ap.total_payment_amount, 2) AS net_cash_flow, inv.invoice_count, ROUND(inv.total_invoice_amount, 2) AS total_invoice_amount, sh.shipment_count, ROUND(sh.total_shipment_amount, 2) AS total_shipment_amount, pur.purchase_order_count, ret.return_count, ROUND(ret.total_return_amount, 2) AS total_return_amount, ROUND(ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0), 2) AS return_rate, CASE WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 95 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 80 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 5 THEN 'EXCELLENT' WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 90 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 60 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 10 THEN 'GOOD' ELSE 'WARNING' END AS health_status FROM sales_summary ss CROSS JOIN production_summary ps CROSS JOIN ar_summary ar CROSS JOIN ap_summary ap CROSS JOIN invoice_summary inv CROSS JOIN return_summary ret CROSS JOIN shipment_summary sh CROSS JOIN purchase_summary pur CROSS JOIN quality_summary qs CROSS JOIN labor_summary ls CROSS JOIN scrap_summary scr", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:38 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:38 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:38 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:39 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: MetricTrendAndTurningPointWarning +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:39 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:39 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "MetricTrendAndTurningPointWarning", + "businessDescription": "指标趋势分析与拐点预警:基于移动平均与线性回归分析人效、产量、废品率趋势,输出上升/下降/平稳判断与拐点预警", + "sqlTemplate": "WITH daily_metrics AS (SELECT DATE(lr.event_time_utc::timestamp) AS metric_date, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) / 60.0 AS total_hours, SUM(lr.report_qty) AS total_output, CASE WHEN SUM(lr.duration_minutes) > 0 THEN SUM(lr.report_qty) / (SUM(lr.duration_minutes) / 60.0) ELSE 0 END AS hourly_efficiency FROM fact_labor_report lr GROUP BY DATE(lr.event_time_utc::timestamp)), daily_quality AS (SELECT DATE(qi.event_time_utc::timestamp) AS metric_date, SUM(qi.pass_qty) AS pass_qty, SUM(qi.fail_qty) AS fail_qty, CASE WHEN SUM(qi.pass_qty) + SUM(qi.fail_qty) > 0 THEN SUM(qi.fail_qty) * 100.0 / (SUM(qi.pass_qty) + SUM(qi.fail_qty)) ELSE 0 END AS defect_rate FROM fact_quality_inspection qi GROUP BY DATE(qi.event_time_utc::timestamp)), daily_production AS (SELECT DATE(wo.event_time_utc::timestamp) AS metric_date, SUM(wo.planned_qty) AS planned_qty, SUM(wo.completed_qty) AS completed_qty, CASE WHEN SUM(wo.planned_qty) > 0 THEN SUM(wo.completed_qty) * 100.0 / SUM(wo.planned_qty) ELSE 0 END AS completion_rate FROM fact_work_order wo GROUP BY DATE(wo.event_time_utc::timestamp)), combined_daily AS (SELECT COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) AS metric_date, COALESCE(dm.worker_count, 0) AS worker_count, COALESCE(dm.total_hours, 0) AS total_hours, COALESCE(dm.total_output, 0) AS total_output, COALESCE(dm.hourly_efficiency, 0) AS hourly_efficiency, COALESCE(dq.defect_rate, 0) AS defect_rate, COALESCE(dp.completion_rate, 0) AS completion_rate FROM daily_metrics dm FULL OUTER JOIN daily_quality dq ON dm.metric_date = dq.metric_date FULL OUTER JOIN daily_production dp ON dm.metric_date = dp.metric_date WHERE COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) IS NOT NULL), numbered_data AS (SELECT *, ROW_NUMBER() OVER (ORDER BY metric_date) AS day_seq FROM combined_daily), moving_avg_step1 AS (SELECT metric_date, day_seq, worker_count, total_output, hourly_efficiency, defect_rate, completion_rate, AVG(hourly_efficiency) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_efficiency, AVG(total_output) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_output, AVG(defect_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_defect_rate, AVG(completion_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_completion_rate, AVG(day_seq) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS avg_x FROM numbered_data), moving_avg AS (SELECT *, LAG(ma7_efficiency, 1) OVER (ORDER BY metric_date) AS prev_ma7_efficiency, LAG(ma7_output, 1) OVER (ORDER BY metric_date) AS prev_ma7_output, LAG(ma7_defect_rate, 1) OVER (ORDER BY metric_date) AS prev_ma7_defect_rate FROM moving_avg_step1), slope_calc AS (SELECT *, (ma7_efficiency - LAG(ma7_efficiency, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_efficiency, (ma7_output - LAG(ma7_output, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_output, (ma7_defect_rate - LAG(ma7_defect_rate, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_defect FROM moving_avg), trend_analysis AS (SELECT metric_date, hourly_efficiency, total_output, defect_rate, completion_rate, ROUND(ma7_efficiency, 2) AS ma7_efficiency, ROUND(ma7_output, 2) AS ma7_output, ROUND(ma7_defect_rate, 2) AS ma7_defect_rate, ROUND(COALESCE(slope_efficiency, 0), 4) AS slope_efficiency, ROUND(COALESCE(slope_output, 0), 4) AS slope_output, ROUND(COALESCE(slope_defect, 0), 4) AS slope_defect, prev_ma7_efficiency, prev_ma7_output, prev_ma7_defect_rate, CASE WHEN COALESCE(slope_efficiency, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_efficiency, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS efficiency_trend, CASE WHEN COALESCE(slope_output, 0) > 3 THEN 'RISING' WHEN COALESCE(slope_output, 0) < -3 THEN 'FALLING' ELSE 'STABLE' END AS output_trend, CASE WHEN COALESCE(slope_defect, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_defect, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS defect_trend, CASE WHEN ma7_efficiency > 0 AND ABS(hourly_efficiency - ma7_efficiency) > ma7_efficiency * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS efficiency_status, CASE WHEN ma7_output > 0 AND ABS(total_output - ma7_output) > ma7_output * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS output_status, CASE WHEN defect_rate > ma7_defect_rate * 1.5 AND defect_rate > 5 THEN 'ANOMALY' ELSE 'NORMAL' END AS defect_status FROM slope_calc) SELECT metric_date, ROUND(hourly_efficiency, 2) AS hourly_output, ma7_efficiency AS efficiency_ma7, slope_efficiency, efficiency_trend, efficiency_status, CASE WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency > prev_ma7_efficiency AND slope_efficiency < 0 THEN 'TURNING_POINT' WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency < prev_ma7_efficiency AND slope_efficiency > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS efficiency_turning_point, ROUND(total_output, 0) AS daily_output, ma7_output AS output_ma7, slope_output, output_trend, output_status, CASE WHEN prev_ma7_output IS NOT NULL AND ma7_output > prev_ma7_output AND slope_output < 0 THEN 'TURNING_POINT' WHEN prev_ma7_output IS NOT NULL AND ma7_output < prev_ma7_output AND slope_output > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS output_turning_point, ROUND(defect_rate, 2) AS defect_rate, ma7_defect_rate AS defect_rate_ma7, slope_defect, defect_trend, defect_status, CASE WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate > prev_ma7_defect_rate AND slope_defect < 0 THEN 'TURNING_POINT' WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate < prev_ma7_defect_rate AND slope_defect > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS defect_turning_point FROM trend_analysis ORDER BY metric_date DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:39 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:39 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:44 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: MetricTrendAndTurningPointWarning +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:44 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:30:44 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "MetricTrendAndTurningPointWarning", + "businessDescription": "指标趋势分析与拐点预警:基于移动平均与线性回归分析人效、产量、废品率趋势,输出上升/下降/平稳判断与拐点预警", + "sqlTemplate": "WITH daily_metrics AS (SELECT DATE(lr.event_time_utc::timestamp) AS metric_date, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) / 60.0 AS total_hours, SUM(lr.report_qty) AS total_output, CASE WHEN SUM(lr.duration_minutes) > 0 THEN SUM(lr.report_qty) / (SUM(lr.duration_minutes) / 60.0) ELSE 0 END AS hourly_efficiency FROM fact_labor_report lr GROUP BY DATE(lr.event_time_utc::timestamp)), daily_quality AS (SELECT DATE(qi.event_time_utc::timestamp) AS metric_date, SUM(qi.pass_qty) AS pass_qty, SUM(qi.fail_qty) AS fail_qty, CASE WHEN SUM(qi.pass_qty) + SUM(qi.fail_qty) > 0 THEN SUM(qi.fail_qty) * 100.0 / (SUM(qi.pass_qty) + SUM(qi.fail_qty)) ELSE 0 END AS defect_rate FROM fact_quality_inspection qi GROUP BY DATE(qi.event_time_utc::timestamp)), daily_production AS (SELECT DATE(wo.event_time_utc::timestamp) AS metric_date, SUM(wo.planned_qty) AS planned_qty, SUM(wo.completed_qty) AS completed_qty, CASE WHEN SUM(wo.planned_qty) > 0 THEN SUM(wo.completed_qty) * 100.0 / SUM(wo.planned_qty) ELSE 0 END AS completion_rate FROM fact_work_order wo GROUP BY DATE(wo.event_time_utc::timestamp)), combined_daily AS (SELECT COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) AS metric_date, COALESCE(dm.worker_count, 0) AS worker_count, COALESCE(dm.total_hours, 0) AS total_hours, COALESCE(dm.total_output, 0) AS total_output, COALESCE(dm.hourly_efficiency, 0) AS hourly_efficiency, COALESCE(dq.defect_rate, 0) AS defect_rate, COALESCE(dp.completion_rate, 0) AS completion_rate FROM daily_metrics dm FULL OUTER JOIN daily_quality dq ON dm.metric_date = dq.metric_date FULL OUTER JOIN daily_production dp ON dm.metric_date = dp.metric_date WHERE COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) IS NOT NULL), numbered_data AS (SELECT *, ROW_NUMBER() OVER (ORDER BY metric_date) AS day_seq FROM combined_daily), moving_avg_step1 AS (SELECT metric_date, day_seq, worker_count, total_output, hourly_efficiency, defect_rate, completion_rate, AVG(hourly_efficiency) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_efficiency, AVG(total_output) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_output, AVG(defect_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_defect_rate, AVG(completion_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_completion_rate, AVG(day_seq) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS avg_x FROM numbered_data), moving_avg AS (SELECT *, LAG(ma7_efficiency, 1) OVER (ORDER BY metric_date) AS prev_ma7_efficiency, LAG(ma7_output, 1) OVER (ORDER BY metric_date) AS prev_ma7_output, LAG(ma7_defect_rate, 1) OVER (ORDER BY metric_date) AS prev_ma7_defect_rate FROM moving_avg_step1), slope_calc AS (SELECT *, (ma7_efficiency - LAG(ma7_efficiency, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_efficiency, (ma7_output - LAG(ma7_output, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_output, (ma7_defect_rate - LAG(ma7_defect_rate, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_defect FROM moving_avg), trend_analysis AS (SELECT metric_date, hourly_efficiency, total_output, defect_rate, completion_rate, ROUND(ma7_efficiency, 2) AS ma7_efficiency, ROUND(ma7_output, 2) AS ma7_output, ROUND(ma7_defect_rate, 2) AS ma7_defect_rate, ROUND(COALESCE(slope_efficiency, 0), 4) AS slope_efficiency, ROUND(COALESCE(slope_output, 0), 4) AS slope_output, ROUND(COALESCE(slope_defect, 0), 4) AS slope_defect, prev_ma7_efficiency, prev_ma7_output, prev_ma7_defect_rate, CASE WHEN COALESCE(slope_efficiency, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_efficiency, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS efficiency_trend, CASE WHEN COALESCE(slope_output, 0) > 3 THEN 'RISING' WHEN COALESCE(slope_output, 0) < -3 THEN 'FALLING' ELSE 'STABLE' END AS output_trend, CASE WHEN COALESCE(slope_defect, 0) > 0.3 THEN 'RISING' WHEN COALESCE(slope_defect, 0) < -0.3 THEN 'FALLING' ELSE 'STABLE' END AS defect_trend, CASE WHEN ma7_efficiency > 0 AND ABS(hourly_efficiency - ma7_efficiency) > ma7_efficiency * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS efficiency_status, CASE WHEN ma7_output > 0 AND ABS(total_output - ma7_output) > ma7_output * 0.3 THEN 'ANOMALY' ELSE 'NORMAL' END AS output_status, CASE WHEN defect_rate > ma7_defect_rate * 1.5 AND defect_rate > 5 THEN 'ANOMALY' ELSE 'NORMAL' END AS defect_status FROM slope_calc) SELECT metric_date, ROUND(hourly_efficiency, 2) AS hourly_output, ma7_efficiency AS efficiency_ma7, slope_efficiency, efficiency_trend, efficiency_status, CASE WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency > prev_ma7_efficiency AND slope_efficiency < 0 THEN 'TURNING_POINT' WHEN prev_ma7_efficiency IS NOT NULL AND ma7_efficiency < prev_ma7_efficiency AND slope_efficiency > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS efficiency_turning_point, ROUND(total_output, 0) AS daily_output, ma7_output AS output_ma7, slope_output, output_trend, output_status, CASE WHEN prev_ma7_output IS NOT NULL AND ma7_output > prev_ma7_output AND slope_output < 0 THEN 'TURNING_POINT' WHEN prev_ma7_output IS NOT NULL AND ma7_output < prev_ma7_output AND slope_output > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS output_turning_point, ROUND(defect_rate, 2) AS defect_rate, ma7_defect_rate AS defect_rate_ma7, slope_defect, defect_trend, defect_status, CASE WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate > prev_ma7_defect_rate AND slope_defect < 0 THEN 'TURNING_POINT' WHEN prev_ma7_defect_rate IS NOT NULL AND ma7_defect_rate < prev_ma7_defect_rate AND slope_defect > 0 THEN 'TURNING_POINT' ELSE 'NONE' END AS defect_turning_point FROM trend_analysis ORDER BY metric_date DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:30:44 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:30:44 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_daily.log b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_daily.log new file mode 100644 index 0000000..1346525 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_daily.log @@ -0,0 +1,109 @@ +2026-01-08 00:15:16 - root - INFO - [logger_config.py:151] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_mcpskills_analyzeOrder\lzwcai_mcpskills_analyzeOrder\logs +2026-01-08 00:15:16 - root - INFO - [logger_config.py:152] - 日志配置 - 级别: INFO, 文件大小限制: 10MB, 备份数量: 5 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:362] - 开始运行 MCP SQL Executor 服务器 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:313] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:314] - 正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:315] - 版本: 0.1.0 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:316] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:320] - 环境配置 - Database ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:321] - 环境配置 - Datasource ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:322] - 环境配置 - Skill ID: +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:323] - 环境配置 - Backend Base URL: http://192.168.11.24:8088 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:324] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:329] - MCP 服务器已启动,等待客户端连接... +2026-01-08 00:15:17 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:156] - 收到列出工具请求 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:119] - 初始化查询配置(数据源: local)... +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:55] - 成功加载 6 个业务查询配置 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:123] - 本地配置: 6 条 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:165] - 成功生成 6 个 MCP 工具 +2026-01-08 00:15:19 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OrderDelayWarningAnalysis +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OrderDelayWarningAnalysis", + "businessDescription": "订单延迟预警分析:依据历史订单的生产周期、物流延误、设备故障等特征,输出延迟概率与红/黄/绿预警等级", + "sqlTemplate": "WITH production_cycle_stats AS (SELECT COALESCE(AVG(GREATEST(0, EXTRACT(DAY FROM last_updated_utc - event_time_utc))), 0) AS avg_production_days FROM fact_work_order WHERE status = 'CLOSED' AND last_updated_utc >= event_time_utc), logistics_delay_stats AS (SELECT customer_id, AVG(GREATEST(0, EXTRACT(DAY FROM event_time_utc - doc_date_utc))) AS avg_logistics_delay_days, SUM(CASE WHEN EXTRACT(DAY FROM event_time_utc - doc_date_utc) > 3 THEN 1 ELSE 0 END) AS delay_count FROM fact_sales_shipment WHERE doc_date_utc IS NOT NULL AND event_time_utc IS NOT NULL GROUP BY customer_id), quality_issue_stats AS (SELECT COALESCE(ROUND(SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty + fail_qty), 0), 2), 0) AS defect_rate_pct FROM fact_quality_inspection WHERE pass_qty IS NOT NULL AND fail_qty IS NOT NULL), scrap_stats AS (SELECT COALESCE((SELECT COUNT(*) FROM fact_scrap) * 100.0 / NULLIF((SELECT COUNT(*) FROM fact_work_order WHERE status = 'CLOSED'), 0), 0) AS scrap_rate_pct), active_work_order_risk AS (SELECT COUNT(*) AS active_wo_count, COALESCE(SUM(CASE WHEN planned_qty > 0 AND (completed_qty / planned_qty) < 0.3 AND EXTRACT(DAY FROM NOW() - event_time_utc) > 7 THEN 1 ELSE 0 END), 0) AS lagging_wo_count FROM fact_work_order WHERE status IN ('OPEN', 'STARTED')), global_metrics AS (SELECT pcs.avg_production_days, qis.defect_rate_pct, ss.scrap_rate_pct, awr.active_wo_count, awr.lagging_wo_count FROM production_cycle_stats pcs, quality_issue_stats qis, scrap_stats ss, active_work_order_risk awr) SELECT so.sales_order_number AS \"订单编号\", c.customer_name AS \"客户名称\", so.order_date_utc::DATE AS \"订单日期\", so.deal_amount AS \"订单金额\", so.payment_status AS \"付款状态\", ROUND(gm.avg_production_days::NUMERIC, 1) AS \"历史平均生产周期(天)\", ROUND(COALESCE(lds.avg_logistics_delay_days, 0)::NUMERIC, 1) AS \"历史平均物流延迟(天)\", COALESCE(lds.delay_count, 0)::INT AS \"历史延误次数\", ROUND(gm.defect_rate_pct::NUMERIC, 2) AS \"产品不良率%\", ROUND(gm.scrap_rate_pct::NUMERIC, 2) AS \"报废率%\", gm.active_wo_count::INT AS \"进行中工单数\", gm.lagging_wo_count::INT AS \"滞后工单数\", ROUND(LEAST(100, GREATEST(0, LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)))::NUMERIC, 1) AS \"延迟概率%\", CASE WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 60 THEN '红色' WHEN (LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + LEAST(25, gm.defect_rate_pct * 2.5) + LEAST(20, gm.lagging_wo_count * 10)) >= 30 THEN '黄色' ELSE '绿色' END AS \"预警等级\", CASE WHEN gm.lagging_wo_count >= 2 THEN '生产严重滞后' WHEN COALESCE(lds.avg_logistics_delay_days, 0) > 5 THEN '物流延误风险高' WHEN gm.avg_production_days > 15 THEN '生产周期过长' WHEN gm.defect_rate_pct > 10 THEN '质量问题突出' ELSE '正常' END AS \"主要风险因素\" FROM fact_sales_order so LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = 't' CROSS JOIN global_metrics gm LEFT JOIN logistics_delay_stats lds ON so.customer_id = lds.customer_id ORDER BY \"延迟概率%\" DESC, so.order_date_utc DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:19 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:19 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:27 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:27 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→待生产, STARTED→生产中, CLOSED→已完成),呈现执行进度与异常节点", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN '待生产' WHEN 'STARTED' THEN '生产中' WHEN 'CLOSED' THEN '已完成' ELSE '未知' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN '质量异常' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN '无报工记录' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN '效率偏低' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number AS \"工单号\", product_name AS \"产品名称\", product_category AS \"产品类别\", status_name AS \"状态\", planned_qty AS \"计划数量\", completed_qty AS \"完成数量\", remaining_qty AS \"剩余数量\", completion_rate AS \"完成率(%)\", worker_count AS \"参与人数\", ROUND(total_work_minutes / 60.0, 1) AS \"累计工时(小时)\", elapsed_hours AS \"已用时间(小时)\", COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS \"异常标记\", CASE WHEN progress_anomaly = '进度严重滞后' OR quality_anomaly IS NOT NULL THEN '高' WHEN progress_anomaly = '进度滞后' OR labor_anomaly IS NOT NULL THEN '中' WHEN efficiency_anomaly IS NOT NULL THEN '低' ELSE '-' END AS \"风险等级\" FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:28 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:28 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:28 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:37 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OnePageDecisionBrief +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:37 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "OnePageDecisionBrief", + "businessDescription": "一页式决策简报:自动聚合订单、生产、财务、售后等关键数据,生成经营决策简报", + "sqlTemplate": "WITH sales_summary AS (SELECT COUNT(*) AS total_orders, SUM(deal_amount) AS total_sales_amount, AVG(deal_amount) AS avg_order_amount, SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_orders, SUM(CASE WHEN payment_status = 'PARTIAL' THEN 1 ELSE 0 END) AS partial_orders, SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_orders, SUM(CASE WHEN payment_status = 'PAID' THEN deal_amount ELSE 0 END) AS paid_amount, SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) AS unpaid_amount FROM fact_sales_order), production_summary AS (SELECT COUNT(*) AS total_work_orders, SUM(planned_qty) AS total_planned_qty, SUM(completed_qty) AS total_completed_qty, SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order), ar_summary AS (SELECT COUNT(*) AS receipt_count, SUM(amount) AS total_receipt_amount, AVG(amount) AS avg_receipt_amount FROM fact_ar_receipt), ap_summary AS (SELECT COUNT(*) AS payment_count, SUM(amount) AS total_payment_amount, AVG(amount) AS avg_payment_amount FROM fact_ap_payment), invoice_summary AS (SELECT COUNT(*) AS invoice_count, SUM(invoice_amount) AS total_invoice_amount, AVG(invoice_amount) AS avg_invoice_amount FROM fact_invoice), return_summary AS (SELECT COUNT(*) AS return_count, SUM(amount) AS total_return_amount, AVG(amount) AS avg_return_amount FROM fact_sales_return), shipment_summary AS (SELECT COUNT(*) AS shipment_count, SUM(amount) AS total_shipment_amount, AVG(amount) AS avg_shipment_amount FROM fact_sales_shipment), purchase_summary AS (SELECT COUNT(*) AS purchase_order_count FROM fact_purchase_order), quality_summary AS (SELECT COUNT(*) AS inspection_count, SUM(pass_qty) AS total_pass_qty, SUM(fail_qty) AS total_fail_qty FROM fact_quality_inspection), labor_summary AS (SELECT COUNT(DISTINCT worker_name) AS worker_count, SUM(duration_minutes) AS total_work_minutes, SUM(report_qty) AS total_output_qty FROM fact_labor_report), scrap_summary AS (SELECT COUNT(*) AS scrap_count FROM fact_scrap) SELECT '经营决策简报' AS \"报告标题\", CURRENT_DATE AS \"报告日期\", ss.total_orders AS \"销售订单总数\", ROUND(ss.total_sales_amount, 2) AS \"销售总金额(元)\", ROUND(ss.avg_order_amount, 2) AS \"平均订单金额(元)\", ss.paid_orders AS \"已付款订单\", ss.partial_orders AS \"部分付款订单\", ss.unpaid_orders AS \"未付款订单\", ROUND(ss.paid_orders * 100.0 / NULLIF(ss.total_orders, 0), 1) AS \"付款完成率(%)\", ROUND(ss.unpaid_amount, 2) AS \"待收款金额(元)\", ps.total_work_orders AS \"工单总数\", ps.closed_orders AS \"已完成工单\", ps.started_orders AS \"进行中工单\", ps.open_orders AS \"待开始工单\", ROUND(ps.total_planned_qty, 0) AS \"计划产量\", ROUND(ps.total_completed_qty, 0) AS \"完成产量\", ROUND(ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0), 1) AS \"生产完成率(%)\", ls.worker_count AS \"活跃员工数\", ROUND(ls.total_work_minutes / 60.0, 1) AS \"总工时(小时)\", ROUND(ls.total_output_qty, 0) AS \"总产出量\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 1) AS \"人均产量\", ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS \"时均产量(件/小时)\", qs.inspection_count AS \"质检批次\", ROUND(qs.total_pass_qty, 0) AS \"合格数量\", ROUND(qs.total_fail_qty, 0) AS \"不合格数量\", ROUND(qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS \"合格率(%)\", ROUND(qs.total_fail_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS \"不良率(%)\", scr.scrap_count AS \"报废记录数\", ar.receipt_count AS \"收款笔数\", ROUND(ar.total_receipt_amount, 2) AS \"收款总额(元)\", ap.payment_count AS \"付款笔数\", ROUND(ap.total_payment_amount, 2) AS \"付款总额(元)\", ROUND(ar.total_receipt_amount - ap.total_payment_amount, 2) AS \"净现金流(元)\", inv.invoice_count AS \"开票数量\", ROUND(inv.total_invoice_amount, 2) AS \"开票总额(元)\", sh.shipment_count AS \"发货单数\", ROUND(sh.total_shipment_amount, 2) AS \"发货总金额(元)\", pur.purchase_order_count AS \"采购订单数\", ret.return_count AS \"退货单数\", ROUND(ret.total_return_amount, 2) AS \"退货总金额(元)\", ROUND(ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0), 2) AS \"退货率(%)\", CASE WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 95 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 80 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 5 THEN '优秀 - 各项指标健康' WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 90 AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 60 AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 10 THEN '良好 - 部分指标需关注' ELSE '预警 - 需要立即改善' END AS \"经营健康度\" FROM sales_summary ss CROSS JOIN production_summary ps CROSS JOIN ar_summary ar CROSS JOIN ap_summary ap CROSS JOIN invoice_summary inv CROSS JOIN return_summary ret CROSS JOIN shipment_summary sh CROSS JOIN purchase_summary pur CROSS JOIN quality_summary qs CROSS JOIN labor_summary ls CROSS JOIN scrap_summary scr", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:38 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:38 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:38 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:58 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: EfficiencyOutputLossDashboard +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:58 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:15:58 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "EfficiencyOutputLossDashboard", + "businessDescription": "人效-产值-损耗三维模型仪表盘:关联订单量×工时×人员数×成本,构建人效—产值—损耗三维模型,按部门(产品类别)汇总展示", + "sqlTemplate": "WITH labor_stats AS (SELECT p.product_category AS department, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(lr.duration_minutes) AS total_work_minutes, SUM(lr.report_qty) AS total_output_qty, COUNT(DISTINCT lr.work_order_number) AS work_order_count FROM fact_labor_report lr INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), work_order_stats AS (SELECT p.product_category AS department, COUNT(*) AS total_work_orders, SUM(wo.planned_qty) AS total_planned_qty, SUM(wo.completed_qty) AS total_completed_qty, SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders FROM fact_work_order wo INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), quality_stats AS (SELECT p.product_category AS department, SUM(qi.pass_qty) AS total_pass_qty, SUM(qi.fail_qty) AS total_fail_qty, COUNT(*) AS inspection_count FROM fact_quality_inspection qi INNER JOIN dim_product p ON qi.product_id = p.product_id AND p.is_current = 't' GROUP BY p.product_category), sales_stats AS (SELECT AVG(deal_amount) AS avg_order_amount, SUM(deal_amount) AS total_sales_amount, COUNT(*) AS order_count FROM fact_sales_order), scrap_stats AS (SELECT COUNT(*) AS total_scrap_count FROM fact_scrap) SELECT ls.department AS \"部门(产品类别)\", ls.worker_count AS \"人员数\", ROUND(ls.total_work_minutes / 60.0, 2) AS \"总工时(小时)\", ls.total_output_qty AS \"总产量\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 2) AS \"人均产量\", ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS \"时均产量(件/小时)\", ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0), 2) AS \"人效指数(产量/人/小时)\", ws.total_planned_qty AS \"计划产量\", ws.total_completed_qty AS \"完成产量\", ROUND(ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS \"计划完成率(%)\", ROUND(ws.total_completed_qty * ss.avg_order_amount / 100, 2) AS \"估算产值(元)\", ROUND(ws.total_completed_qty * ss.avg_order_amount / 100 / NULLIF(ls.worker_count, 0), 2) AS \"人均产值(元)\", qs.total_pass_qty AS \"质检合格数\", qs.total_fail_qty AS \"质检不合格数\", ROUND(qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100, 2) AS \"不良率(%)\", ROUND((ws.total_planned_qty - ws.total_completed_qty) / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS \"生产损耗率(%)\", ROUND((ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0)) * 0.4 + (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) * 0.35 + (qs.total_pass_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) * 0.25, 2) AS \"综合绩效得分\", CASE WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 10 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 50 THEN '红色预警' WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 5 OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 70 THEN '黄色预警' ELSE '正常' END AS \"状态预警\" FROM labor_stats ls LEFT JOIN work_order_stats ws ON ls.department = ws.department LEFT JOIN quality_stats qs ON ls.department = qs.department CROSS JOIN sales_stats ss CROSS JOIN scrap_stats scr ORDER BY \"综合绩效得分\" DESC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:15:59 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:15:59 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:15:59 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:07 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: SupplyChainRiskWarning +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "SupplyChainRiskWarning", + "businessDescription": "供应链风险预警:整合采购系统中的供应商历史交期与质检合格率,结合外采物流数据,识别交期异常+物流停滞组合风险模式,自动推送高风险订单提示", + "sqlTemplate": "WITH supplier_delivery AS (SELECT po.supplier_id, COUNT(*) AS order_count, COUNT(pr.purchase_receipt_id) AS receipt_count, AVG(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS avg_delivery_days, MAX(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS max_delivery_days, STDDEV(CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) ELSE NULL END) AS stddev_delivery_days FROM fact_purchase_order po LEFT JOIN fact_purchase_receipt pr ON po.supplier_id = pr.supplier_id GROUP BY po.supplier_id), supplier_quality AS (SELECT pr.supplier_id, COUNT(pr.purchase_receipt_id) AS total_receipts, SUM(pr.receipt_qty_total) AS total_qty, SUM(pr.amount) AS total_amount FROM fact_purchase_receipt pr GROUP BY pr.supplier_id), supplier_returns AS (SELECT pret.supplier_id, COUNT(*) AS return_count, SUM(CASE WHEN pret.return_reason = '损坏' THEN 1 ELSE 0 END) AS damage_count FROM fact_purchase_return pret GROUP BY pret.supplier_id), supplier_quality_rate AS (SELECT sq.supplier_id, sq.total_receipts, sq.total_qty, sq.total_amount, COALESCE(sr.return_count, 0) AS return_count, COALESCE(sr.damage_count, 0) AS damage_count, CASE WHEN sq.total_receipts > 0 THEN (sq.total_receipts - COALESCE(sr.return_count, 0)) * 100.0 / sq.total_receipts ELSE 100 END AS quality_rate FROM supplier_quality sq LEFT JOIN supplier_returns sr ON sq.supplier_id = sr.supplier_id), supplier_risk AS (SELECT s.supplier_id, s.supplier_name, s.supplier_category, COALESCE(sd.order_count, 0) AS order_count, COALESCE(sd.receipt_count, 0) AS receipt_count, ROUND(COALESCE(sd.avg_delivery_days, 0), 1) AS avg_delivery_days, ROUND(COALESCE(sd.max_delivery_days, 0), 1) AS max_delivery_days, ROUND(COALESCE(sd.stddev_delivery_days, 0), 1) AS delivery_volatility, COALESCE(sqr.total_receipts, 0) AS total_receipts, COALESCE(sqr.return_count, 0) AS return_count, ROUND(COALESCE(sqr.quality_rate, 100), 1) AS quality_rate, CASE WHEN COALESCE(sd.avg_delivery_days, 0) > 60 THEN 40 WHEN COALESCE(sd.avg_delivery_days, 0) > 45 THEN 30 WHEN COALESCE(sd.avg_delivery_days, 0) > 30 THEN 20 ELSE 10 END + CASE WHEN COALESCE(sd.stddev_delivery_days, 0) > 20 THEN 30 WHEN COALESCE(sd.stddev_delivery_days, 0) > 10 THEN 20 ELSE 10 END AS delivery_risk_score, CASE WHEN COALESCE(sqr.quality_rate, 100) < 80 THEN 50 WHEN COALESCE(sqr.quality_rate, 100) < 90 THEN 30 WHEN COALESCE(sqr.quality_rate, 100) < 95 THEN 15 ELSE 5 END AS quality_risk_score FROM dim_supplier s LEFT JOIN supplier_delivery sd ON s.supplier_id = sd.supplier_id LEFT JOIN supplier_quality_rate sqr ON s.supplier_id = sqr.supplier_id WHERE s.is_current = 't'), supplier_risk_level AS (SELECT *, delivery_risk_score + quality_risk_score AS total_risk_score, CASE WHEN delivery_risk_score + quality_risk_score >= 80 THEN '高风险' WHEN delivery_risk_score + quality_risk_score >= 50 THEN '中风险' ELSE '低风险' END AS risk_level, CASE WHEN delivery_risk_score >= 50 AND quality_risk_score >= 30 THEN '交期异常+质量问题' WHEN delivery_risk_score >= 50 THEN '交期异常' WHEN quality_risk_score >= 30 THEN '质量问题' ELSE '正常' END AS risk_pattern FROM supplier_risk) SELECT supplier_name AS \"供应商名称\", supplier_category AS \"供应商类别\", order_count AS \"订单数\", receipt_count AS \"收货数\", avg_delivery_days AS \"平均交期(天)\", max_delivery_days AS \"最长交期(天)\", delivery_volatility AS \"交期波动\", total_receipts AS \"收货批次\", return_count AS \"退货次数\", quality_rate AS \"合格率(%)\", delivery_risk_score AS \"交期风险分\", quality_risk_score AS \"质量风险分\", total_risk_score AS \"综合风险分\", risk_level AS \"风险等级\", risk_pattern AS \"风险模式\" FROM supplier_risk_level ORDER BY total_risk_score DESC, supplier_name", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:16:07 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:16:07 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:13 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:138] - 正在调用测试SQL API: http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:139] - 请求参数: { + "datasourceId": "19", + "businessName": "WorkOrderProgressAndAnomalyNodes", + "businessDescription": "工单执行进度与异常节点:实时拉取工单数据,动态映射订单各环节状态(OPEN→待生产, STARTED→生产中, CLOSED→已完成),呈现执行进度与异常节点", + "sqlTemplate": "WITH work_order_base AS (SELECT wo.work_order_id, wo.work_order_number, wo.product_id, wo.status, wo.planned_qty, wo.completed_qty, wo.event_time_utc::timestamp AS start_time, wo.last_updated_utc::timestamp AS last_update, wo.source_system FROM fact_work_order wo), product_info AS (SELECT product_id, product_name, product_category FROM dim_product WHERE is_current = 't'), labor_summary AS (SELECT work_order_number, COUNT(DISTINCT worker_name) AS worker_count, SUM(report_qty) AS total_report_qty, SUM(duration_minutes) AS total_minutes, MAX(event_time_utc::timestamp) AS last_report_time FROM fact_labor_report GROUP BY work_order_number), quality_summary AS (SELECT work_order_number, SUM(pass_qty) AS pass_qty, SUM(fail_qty) AS fail_qty FROM fact_quality_inspection GROUP BY work_order_number), work_order_progress AS (SELECT wb.work_order_id, wb.work_order_number, p.product_name, p.product_category, wb.status AS raw_status, CASE wb.status WHEN 'OPEN' THEN '待生产' WHEN 'STARTED' THEN '生产中' WHEN 'CLOSED' THEN '已完成' ELSE '未知' END AS status_name, wb.planned_qty, wb.completed_qty, CASE WHEN wb.planned_qty > 0 THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) ELSE 0 END AS completion_rate, GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, wb.start_time, wb.last_update, ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, COALESCE(ls.worker_count, 0) AS worker_count, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_minutes, 0) AS total_work_minutes, ls.last_report_time, COALESCE(qs.pass_qty, 0) AS qc_pass_qty, COALESCE(qs.fail_qty, 0) AS qc_fail_qty FROM work_order_base wb LEFT JOIN product_info p ON wb.product_id = p.product_id LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number), anomaly_detection AS (SELECT *, CASE WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' ELSE NULL END AS progress_anomaly, CASE WHEN qc_pass_qty + qc_fail_qty > 0 AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN '质量异常' ELSE NULL END AS quality_anomaly, CASE WHEN raw_status = 'STARTED' AND last_report_time IS NOT NULL AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' WHEN raw_status = 'STARTED' AND last_report_time IS NULL AND elapsed_hours > 24 THEN '无报工记录' ELSE NULL END AS labor_anomaly, CASE WHEN total_work_minutes > 0 AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN '效率偏低' ELSE NULL END AS efficiency_anomaly FROM work_order_progress) SELECT work_order_number AS \"工单号\", product_name AS \"产品名称\", product_category AS \"产品类别\", status_name AS \"状态\", planned_qty AS \"计划数量\", completed_qty AS \"完成数量\", remaining_qty AS \"剩余数量\", completion_rate AS \"完成率(%)\", worker_count AS \"参与人数\", ROUND(total_work_minutes / 60.0, 1) AS \"累计工时(小时)\", elapsed_hours AS \"已用时间(小时)\", COALESCE(progress_anomaly, '') || CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(quality_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(labor_anomaly, '') || CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || COALESCE(efficiency_anomaly, '') AS \"异常标记\", CASE WHEN progress_anomaly = '进度严重滞后' OR quality_anomaly IS NOT NULL THEN '高' WHEN progress_anomaly = '进度滞后' OR labor_anomaly IS NOT NULL THEN '中' WHEN efficiency_anomaly IS NOT NULL THEN '低' ELSE '-' END AS \"风险等级\" FROM anomaly_detection ORDER BY CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, completion_rate ASC", + "parameters": {}, + "testParams": {} +} +2026-01-08 00:16:13 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.11.24:8088/datasource/sqlExecutionLog/testSqlWithSchema "HTTP/1.1 200 " +2026-01-08 00:16:13 - lzwcai_mcpskills_analyzeOrder.utils.api_client - INFO - [api_client.py:154] - 测试SQL API调用成功 +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_error.log b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/lzwcai_mcp_sqlexecutor_error.log new file mode 100644 index 0000000..e69de29 diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/mcp_services.log b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/mcp_services.log new file mode 100644 index 0000000..7cca1e2 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/logs/mcp_services.log @@ -0,0 +1,71 @@ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:362] - 开始运行 MCP SQL Executor 服务器 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:313] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:314] - 正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:315] - 版本: 0.1.0 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:316] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:320] - 环境配置 - Database ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:321] - 环境配置 - Datasource ID: 19 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:322] - 环境配置 - Skill ID: +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:323] - 环境配置 - Backend Base URL: http://192.168.11.24:8088 +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:324] - ============================================================ +2026-01-08 00:15:16 - mcp_services - INFO - [main.py:329] - MCP 服务器已启动,等待客户端连接... +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:156] - 收到列出工具请求 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:119] - 初始化查询配置(数据源: local)... +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:55] - 成功加载 6 个业务查询配置 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:123] - 本地配置: 6 条 +2026-01-08 00:15:17 - mcp_services - INFO - [main.py:165] - 成功生成 6 个 MCP 工具 +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OrderDelayWarningAnalysis +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:19 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:15:27 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:28 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OnePageDecisionBrief +2026-01-08 00:15:37 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:38 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: EfficiencyOutputLossDashboard +2026-01-08 00:15:58 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:15:59 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: SupplyChainRiskWarning +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:07 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:16:13 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:362] - 开始运行 MCP SQL Executor 服务器 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:313] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:314] - 正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:315] - 版本: 0.1.0 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:316] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:320] - 环境配置 - Database ID: 19 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:321] - 环境配置 - Datasource ID: 19 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:322] - 环境配置 - Skill ID: +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:323] - 环境配置 - Backend Base URL: http://192.168.11.24:8088 +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:324] - ============================================================ +2026-01-08 00:30:22 - mcp_services - INFO - [main.py:329] - MCP 服务器已启动,等待客户端连接... +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:156] - 收到列出工具请求 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:119] - 初始化查询配置(数据源: local)... +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:55] - 成功加载 6 个业务查询配置 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:123] - 本地配置: 6 条 +2026-01-08 00:30:26 - mcp_services - INFO - [main.py:165] - 成功生成 6 个 MCP 工具 +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OrderDelayWarningAnalysis +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:27 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: WorkOrderProgressAndAnomalyNodes +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:32 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: SupplyChainRiskWarning +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:34 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: EfficiencyOutputLossDashboard +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:35 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:37 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: OnePageDecisionBrief +2026-01-08 00:30:37 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:38 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: MetricTrendAndTurningPointWarning +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:39 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:190] - 收到工具调用请求: MetricTrendAndTurningPointWarning +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:225] - 正在调用测试SQL API... +2026-01-08 00:30:44 - mcp_services - INFO - [main.py:227] - 测试SQL API调用成功 diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/main.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/main.py new file mode 100644 index 0000000..07f4694 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/main.py @@ -0,0 +1,373 @@ +from pathlib import Path +from typing import Any +import asyncio +import logging + +# 支持直接运行和模块导入两种方式 +try: + from .utils import load_json, generate_tool_name, generate_input_schema + from .utils import get_skill_by_id, DataSourceAPIClient, process_skill_response, test_sql_with_schema + from .utils import get_database_id, get_datasource_id, get_skill_id, get_env_config + from .utils.logger_config import logger_config +except ImportError: + from utils import load_json, generate_tool_name, generate_input_schema + from utils import get_skill_by_id, DataSourceAPIClient, process_skill_response, test_sql_with_schema + from utils import get_database_id, get_datasource_id, get_skill_id, get_env_config + from utils.logger_config import logger_config + +from mcp.server.models import InitializationOptions +from mcp.server import NotificationOptions, Server +import mcp.types as types + +# 初始化 MCP 专用日志器 +mcp_logger = logger_config.setup_mcp_logging() + +# ========== 数据源配置 ========== +# 数据源类型常量 +DATA_SOURCE_API = "api" # 仅使用API数据 +DATA_SOURCE_LOCAL = "local" # 仅使用本地JSON数据 +DATA_SOURCE_BOTH = "both" # 合并本地和API数据 + +# 默认数据源(可修改) +DEFAULT_DATA_SOURCE = DATA_SOURCE_LOCAL +# ================================ + + +def get_queries(): + """ + 获取业务查询配置 + + Returns: + list: 包含所有业务查询配置的列表 + """ + try: + # 获取当前文件所在目录 + current_dir = Path(__file__).parent + + # 构建 businessQueries.json 的路径 + json_path = current_dir / "businessQueries.json" + + mcp_logger.debug(f"正在读取业务查询配置文件: {json_path}") + + # 使用 load_json 方法读取 JSON 文件 + queries = load_json(json_path) + + mcp_logger.info(f"成功加载 {len(queries)} 个业务查询配置") + + return queries + except Exception as e: + mcp_logger.error(f"加载业务查询配置失败: {e}", exc_info=True) + raise + + +def generate_tool_schema_from_query(query: dict) -> types.Tool: + """ + 根据查询配置生成 MCP 工具模式 + + Args: + query: 单个查询配置字典 + + Returns: + types.Tool: MCP 工具对象 + """ + try: + # 获取参数定义并生成 inputSchema + parameters = query.get('parameters', {}) + input_schema = generate_input_schema(parameters) + + # 生成工具名称(格式: tool_拼音_id) + # tool_name = generate_tool_name(query['businessName'], query['id']) + tool_name = query['businessName'] + # 构建工具描述,包含业务名称和业务描述 + description = f"{query['businessName']}: {query['businessDescription']}" + + mcp_logger.debug(f"生成工具模式: {tool_name} - {query['businessName']}") + + return types.Tool( + name=tool_name, + description=description, + inputSchema=input_schema + ) + except Exception as e: + mcp_logger.error(f"生成工具模式失败: {query.get('id', 'unknown')}, 错误: {e}", exc_info=True) + raise + + +# 创建 MCP 服务器实例 +server = Server("lzwcai-mcpskills-analyzeOrder") + +# 缓存查询配置,避免重复加载 +_queries_cache = None + + +async def get_queries_cache(source: str = None): + """ + 获取或初始化查询配置缓存 + + Args: + source: 数据源类型(默认使用 DEFAULT_DATA_SOURCE) + - "api": 仅使用API数据 + - "local": 仅使用本地JSON数据 + - "both": 合并本地和API数据 + + Returns: + 查询配置列表 + """ + global _queries_cache + if _queries_cache is None: + source = source or DEFAULT_DATA_SOURCE + mcp_logger.info(f"初始化查询配置(数据源: {source})...") + + if source == DATA_SOURCE_LOCAL: + _queries_cache = get_queries() + mcp_logger.info(f"本地配置: {len(_queries_cache)} 条") + + elif source == DATA_SOURCE_API: + try: + _queries_cache = await call_third_party_api() + mcp_logger.info(f"API配置: {len(_queries_cache)} 条") + mcp_logger.info(f"API配置数组: {_queries_cache}") + except Exception as e: + mcp_logger.warning(f"API获取失败,降级使用本地配置: {e}") + _queries_cache = get_queries() + + else: # DATA_SOURCE_BOTH + local = get_queries() + try: + api = await call_third_party_api() + except Exception as e: + mcp_logger.warning(f"API获取失败: {e}") + api = [] + _queries_cache = local + api + mcp_logger.info(f"配置总数: {len(_queries_cache)} 条(本地{len(local)}+API{len(api)})") + + return _queries_cache + + +@server.list_tools() +async def handle_list_tools() -> list[types.Tool]: + """ + 列出所有动态生成的 MCP 工具 + + Returns: + list[types.Tool]: 所有可用的工具列表 + """ + try: + mcp_logger.info("收到列出工具请求") + + queries = await get_queries_cache() + tools = [] + + for query in queries: + tool = generate_tool_schema_from_query(query) + tools.append(tool) + + mcp_logger.info(f"成功生成 {len(tools)} 个 MCP 工具") + mcp_logger.debug(f"工具列表: {[tool.name for tool in tools]}") + + return tools + except Exception as e: + mcp_logger.error(f"列出工具失败: {e}", exc_info=True) + raise + + +@server.call_tool() +async def handle_call_tool( + name: str, + arguments: dict[str, Any] | None +) -> list[types.TextContent]: + """ + 处理工具调用请求 + + Args: + name: 工具名称 + arguments: 工具参数 + + Returns: + list[types.TextContent]: 工具执行结果(返回参数和对应的接口配置) + """ + try: + mcp_logger.info(f"收到工具调用请求: {name}") + mcp_logger.debug(f"工具参数: {arguments}") + + # 获取查询配置缓存 + queries = await get_queries_cache() + + # 根据工具名称查找对应的 item(接口配置) + tool_item = None + for query in queries: + # tool_name = generate_tool_name(query['businessName'], query['id']) + tool_name = query['businessName'] + if tool_name == name: + tool_item = query + break + + # 构建返回结果 + import json + + if tool_item: + request_data = { + "datasourceId": get_datasource_id(), + "businessName": tool_item.get("businessName"), + "businessDescription": tool_item.get("businessDescription"), + "sqlTemplate": tool_item.get("sqlTemplate"), + "parameters": tool_item.get("parameters"), + "testParams": arguments or {} + } + + # 如果 arguments 中有 targetDatabaseName 且有值,添加到 request_data + if arguments and arguments.get("targetDatabaseName"): + request_data["targetDatabaseName"] = arguments["targetDatabaseName"] + mcp_logger.debug(f"添加目标数据库名称: {arguments['targetDatabaseName']}") + + # 调用测试SQL API + try: + mcp_logger.info("正在调用测试SQL API...") + api_response = test_sql_with_schema(request_data) + mcp_logger.info("测试SQL API调用成功") + + # 返回包含 data 字段的结果 + result = { + "success": True, + "data": api_response + } + result_text = json.dumps(result, ensure_ascii=False, indent=2) + + except Exception as e: + error_msg = f"调用测试SQL API失败: {str(e)}" + mcp_logger.error(error_msg, exc_info=True) + result = { + "success": False, + "error": error_msg, + "data": None + } + result_text = json.dumps(result, ensure_ascii=False, indent=2) + else: + error_msg = f"未找到工具 {name} 对应的配置" + result = { + "success": False, + "error": error_msg, + "data": None + } + result_text = json.dumps(result, ensure_ascii=False, indent=2) + + mcp_logger.debug(f"工具调用结果: {result_text}") + + return [ + types.TextContent( + type="text", + text=result_text + ) + ] + except Exception as e: + error_msg = f"工具调用失败: {name}, 错误: {e}" + mcp_logger.error(error_msg, exc_info=True) + return [ + types.TextContent( + type="text", + text=f"错误: {error_msg}" + ) + ] + + +async def call_third_party_api(skill_id: str = None) -> list: + """ + 调用第三方API获取技能信息并返回处理后的数据 + + Args: + skill_id: 技能ID(默认从环境变量 SKILL_ID 读取,如果未设置则使用 1981000305474482178) + + Returns: + 处理后的查询配置列表(businessQueries格式) + + Example: + queries = await call_third_party_api() + # 返回: [{"id": "...", "businessName": "...", ...}, ...] + """ + try: + # 如果没有传入 skill_id,则从环境变量读取 + if skill_id is None: + skill_id = get_skill_id() + + mcp_logger.info(f"调用第三方API,skill_id: {skill_id}") + + # 获取原始数据 + raw_result = get_skill_by_id(skill_id) + + mcp_logger.info(f"成功{raw_result}") + + # 处理并返回 + processed_queries = process_skill_response(raw_result) + + mcp_logger.info(f"成功获取并处理 {len(processed_queries)} 条数据") + return processed_queries + + except Exception as e: + mcp_logger.error(f"API调用失败: {e}", exc_info=True) + raise + + +async def async_main(): + """MCP 服务器异步主函数""" + try: + mcp_logger.info("=" * 60) + mcp_logger.info("正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder") + mcp_logger.info("版本: 0.1.0") + mcp_logger.info("=" * 60) + + # 输出环境配置信息 + env_config = get_env_config() + mcp_logger.info(f"环境配置 - Database ID: {env_config['database_id']}") + mcp_logger.info(f"环境配置 - Datasource ID: {env_config['datasource_id']}") + mcp_logger.info(f"环境配置 - Skill ID: {env_config['skill_id']}") + mcp_logger.info(f"环境配置 - Backend Base URL: {env_config['backend_base_url']}") + mcp_logger.info("=" * 60) + + from mcp.server.stdio import stdio_server + + async with stdio_server() as (read_stream, write_stream): + mcp_logger.info("MCP 服务器已启动,等待客户端连接...") + + await server.run( + read_stream, + write_stream, + InitializationOptions( + server_name="lzwcai-mcpskills-analyzeOrder", + server_version="0.1.0", + capabilities=server.get_capabilities( + notification_options=NotificationOptions(), + experimental_capabilities={}, + ), + ), + ) + + mcp_logger.info("MCP 服务器已关闭") + + except Exception as e: + mcp_logger.error(f"MCP 服务器运行失败: {e}", exc_info=True) + raise + + +def main(): + """入口点函数(用于 console_scripts)""" + try: + # 初始化系统日志 + # MCP协议使用stdio通信,必须禁用控制台输出以避免干扰JSON-RPC通信 + logger_config.setup_logging( + app_name="lzwcai_mcp_sqlexecutor", + log_level=logging.INFO, + console_output=False # 禁用控制台输出 + ) + + mcp_logger.info("开始运行 MCP SQL Executor 服务器") + asyncio.run(async_main()) + + except KeyboardInterrupt: + mcp_logger.info("收到中断信号,正在关闭服务器...") + except Exception as e: + mcp_logger.error(f"程序运行失败: {e}", exc_info=True) + raise + + +if __name__ == "__main__": + main() diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/pyproject.toml b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/pyproject.toml new file mode 100644 index 0000000..c12ec43 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "lzwcai-mcpskills-analyzeWorkOrder" +version = "0.1.10" +description = "MCP server for executing business SQL queries with dynamic tool generation" +readme = "README.md" +requires-python = ">=3.13" +license = {text = "MIT"} +authors = [ + {name = "lzwcai", email = "your-email@example.com"}, +] +keywords = ["mcp", "sql", "executor", "server"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.13", +] +dependencies = [ + "httpx>=0.28.1", + "mcp[cli]>=1.10.1", + "pypinyin>=0.53.0", +] + +[project.scripts] +lzwcai-mcpskills-analyzeWorkOrder = "lzwcai_mcpskills_analyzeWorkOrder.main:main" + +[tool.hatch.build.targets.wheel] +packages = ["lzwcai_mcpskills_analyzeWorkOrder"] + +[tool.hatch.build.targets.wheel.force-include] +"lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json" = "lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json" diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/sql11 b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/sql11 new file mode 100644 index 0000000..39b7319 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/sql11 @@ -0,0 +1,169 @@ +-- ===================================================== +-- 交付风险预测:延迟概率与红/黄/绿预警等级 +-- 基于历史订单的生产周期、物流延误、设备故障等特征 +-- ===================================================== + +WITH +-- 1. 全局生产特征(汇总所有工单) +global_production AS ( + SELECT + COUNT(*) AS total_wo_count, + AVG(CASE WHEN planned_qty > 0 THEN completed_qty / planned_qty ELSE 0 END) AS avg_completion_rate, + SUM(CASE WHEN status IN ('OPEN', 'STARTED') THEN 1 ELSE 0 END) AS pending_wo_count, + SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_wo_count + FROM fact_work_order +), + +-- 2. 全局质检特征 +global_quality AS ( + SELECT + COUNT(*) AS total_inspection_count, + SUM(COALESCE(pass_qty, 0)) AS total_pass_qty, + SUM(COALESCE(fail_qty, 0)) AS total_fail_qty, + CASE WHEN SUM(COALESCE(pass_qty, 0) + COALESCE(fail_qty, 0)) > 0 + THEN SUM(COALESCE(pass_qty, 0))::FLOAT / SUM(COALESCE(pass_qty, 0) + COALESCE(fail_qty, 0)) + ELSE 1 END AS qc_pass_rate + FROM fact_quality_inspection +), + +-- 3. 全局工序不良特征 +global_operation AS ( + SELECT + COUNT(*) AS total_task_count, + SUM(COALESCE(good_qty, 0)) AS total_good_qty, + SUM(COALESCE(bad_qty, 0)) AS total_bad_qty, + CASE WHEN SUM(COALESCE(good_qty, 0) + COALESCE(bad_qty, 0)) > 0 + THEN SUM(COALESCE(bad_qty, 0))::FLOAT / SUM(COALESCE(good_qty, 0) + COALESCE(bad_qty, 0)) + ELSE 0 END AS operation_defect_rate + FROM fact_operation_task +), + +-- 4. 客户级别发货统计 +customer_shipment AS ( + SELECT + customer_id, + COUNT(*) AS shipment_count, + SUM(COALESCE(amount, 0)) AS total_shipment_amount + FROM fact_sales_shipment + GROUP BY customer_id +), + +-- 5. 客户级别退货统计 +customer_return AS ( + SELECT + customer_id, + COUNT(*) AS return_count, + SUM(COALESCE(amount, 0)) AS total_return_amount + FROM fact_sales_return + GROUP BY customer_id +), + +-- 6. 订单风险评估 +order_risk AS ( + SELECT + so.sales_order_id, + so.sales_order_number, + c.customer_name, + so.order_date_utc, + so.deal_amount, + so.payment_status, + + -- 全局生产指标 + gp.avg_completion_rate AS production_completion_rate, + gp.pending_wo_count, + gp.total_wo_count AS work_order_count, + + -- 全局质检指标 + gq.qc_pass_rate, + gq.total_fail_qty, + + -- 全局工序指标 + go.operation_defect_rate, + + -- 客户级别指标 + COALESCE(cs.shipment_count, 0) AS shipment_count, + COALESCE(cr.return_count, 0) AS return_count, + CASE WHEN COALESCE(cs.shipment_count, 0) > 0 + THEN COALESCE(cr.return_count, 0)::FLOAT / cs.shipment_count + ELSE 0 END AS return_rate + + FROM fact_sales_order so + LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = true + CROSS JOIN global_production gp + CROSS JOIN global_quality gq + CROSS JOIN global_operation go + LEFT JOIN customer_shipment cs ON so.customer_id = cs.customer_id + LEFT JOIN customer_return cr ON so.customer_id = cr.customer_id +) + +-- 7. 最终输出 +SELECT + sales_order_id, + sales_order_number, + customer_name, + order_date_utc, + deal_amount, + payment_status, + + -- 风险特征 + work_order_count, + ROUND(production_completion_rate::NUMERIC, 2) AS production_completion_rate, + pending_wo_count, + ROUND(qc_pass_rate::NUMERIC, 2) AS qc_pass_rate, + ROUND(operation_defect_rate::NUMERIC, 4) AS operation_defect_rate, + return_count, + ROUND(return_rate::NUMERIC, 4) AS return_rate, + + -- 延迟概率 + ROUND(( + CASE WHEN production_completion_rate < 0.3 THEN 0.30 + WHEN production_completion_rate < 0.5 THEN 0.20 + WHEN production_completion_rate < 0.8 THEN 0.10 + ELSE 0 END + + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 + WHEN qc_pass_rate < 0.9 THEN 0.15 + WHEN qc_pass_rate < 0.95 THEN 0.08 + ELSE 0 END + + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 + WHEN operation_defect_rate > 0.05 THEN 0.12 + WHEN operation_defect_rate > 0.02 THEN 0.05 + ELSE 0 END + + CASE WHEN return_rate > 0.1 THEN 0.15 + WHEN return_rate > 0.05 THEN 0.08 + WHEN return_rate > 0.02 THEN 0.03 + ELSE 0 END + + CASE WHEN payment_status = 'UNPAID' THEN 0.10 + WHEN payment_status = 'PARTIAL' THEN 0.05 + ELSE 0 END + )::NUMERIC, 2) AS delay_probability, + + -- 红/黄/绿预警 + CASE + WHEN ( + CASE WHEN production_completion_rate < 0.3 THEN 0.30 WHEN production_completion_rate < 0.5 THEN 0.20 WHEN production_completion_rate < 0.8 THEN 0.10 ELSE 0 END + + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 WHEN qc_pass_rate < 0.9 THEN 0.15 WHEN qc_pass_rate < 0.95 THEN 0.08 ELSE 0 END + + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 WHEN operation_defect_rate > 0.05 THEN 0.12 WHEN operation_defect_rate > 0.02 THEN 0.05 ELSE 0 END + + CASE WHEN return_rate > 0.1 THEN 0.15 WHEN return_rate > 0.05 THEN 0.08 WHEN return_rate > 0.02 THEN 0.03 ELSE 0 END + + CASE WHEN payment_status = 'UNPAID' THEN 0.10 WHEN payment_status = 'PARTIAL' THEN 0.05 ELSE 0 END + ) >= 0.50 THEN 'RED' + WHEN ( + CASE WHEN production_completion_rate < 0.3 THEN 0.30 WHEN production_completion_rate < 0.5 THEN 0.20 WHEN production_completion_rate < 0.8 THEN 0.10 ELSE 0 END + + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 WHEN qc_pass_rate < 0.9 THEN 0.15 WHEN qc_pass_rate < 0.95 THEN 0.08 ELSE 0 END + + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 WHEN operation_defect_rate > 0.05 THEN 0.12 WHEN operation_defect_rate > 0.02 THEN 0.05 ELSE 0 END + + CASE WHEN return_rate > 0.1 THEN 0.15 WHEN return_rate > 0.05 THEN 0.08 WHEN return_rate > 0.02 THEN 0.03 ELSE 0 END + + CASE WHEN payment_status = 'UNPAID' THEN 0.10 WHEN payment_status = 'PARTIAL' THEN 0.05 ELSE 0 END + ) >= 0.25 THEN 'YELLOW' + ELSE 'GREEN' + END AS risk_level, + + -- 风险原因 + CONCAT_WS(' | ', + CASE WHEN production_completion_rate < 0.5 THEN '生产进度滞后' END, + CASE WHEN qc_pass_rate < 0.9 THEN '质检通过率低' END, + CASE WHEN operation_defect_rate > 0.05 THEN '工序不良率高' END, + CASE WHEN return_rate > 0.05 THEN '历史退货率高' END, + CASE WHEN payment_status = 'UNPAID' THEN '未付款' END + ) AS risk_reasons + +FROM order_risk +ORDER BY delay_probability DESC, deal_amount DESC; diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/__init__.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/__init__.py new file mode 100644 index 0000000..3df2b44 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/__init__.py @@ -0,0 +1,25 @@ +"""Utils package for lzwcai_mcp_sqlexecutor""" + +from .json_helper import load_json +from .name_helper import generate_tool_name +from .schema_helper import generate_input_schema, validate_input_schema +from .api_client import DataSourceAPIClient, get_skill_by_id, process_skill_response, test_sql_with_schema +from .env_config import get_database_id, get_datasource_id, get_skill_id, get_backend_base_url, get_env_config, set_env_variable + +__all__ = [ + 'load_json', + 'generate_tool_name', + 'generate_input_schema', + 'validate_input_schema', + 'DataSourceAPIClient', + 'get_skill_by_id', + 'process_skill_response', + 'test_sql_with_schema', + 'get_database_id', + 'get_datasource_id', + 'get_skill_id', + 'get_backend_base_url', + 'get_env_config', + 'set_env_variable' +] + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/api_client.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/api_client.py new file mode 100644 index 0000000..cf49a0a --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/api_client.py @@ -0,0 +1,318 @@ +""" +第三方API调用客户端 +用于调用外部数据源接口 +""" + +import httpx +import logging +import json +from typing import Dict, Any, Optional, List + +# 支持直接运行和模块导入两种方式 +try: + from .env_config import get_backend_base_url +except ImportError: + from env_config import get_backend_base_url + +# 获取日志记录器 +logger = logging.getLogger(__name__) + + +class DataSourceAPIClient: + """数据源API客户端""" + + def __init__( + self, + base_url: Optional[str] = None, + token: Optional[str] = None + ): + """ + 初始化API客户端 + + Args: + base_url: API基础URL(默认从环境变量 BACKEND_BASE_URL 读取,如果未设置则使用 http://192.168.2.236:8088) + token: 认证令牌(Bearer Token) + """ + # 如果没有传入 base_url,则从环境变量读取 + if base_url is None: + base_url = get_backend_base_url() + + self.base_url = base_url.rstrip('/') + self.token = token or "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjJiYTk4ODllLWM2ZGItNDQ5YS1iZmFjLTQ2YzMxODFlODg5NCJ9.dvi8zm0LsWvJ_h9zD5blnHFRxa4z4_WBm1R487ekE7HlHzrN6dnvqhK8askqT5b1EcE8myHwRzLVMoI8UOjOrw" + self.client = httpx.Client(timeout=30.0) + + def _get_headers(self) -> Dict[str, str]: + """ + 获取请求头 + + Returns: + 请求头字典 + """ + return { + 'Authorization': f'Bearer {self.token}', + } + + def get_skill_by_id(self, skill_id: str) -> Dict[str, Any]: + """ + 根据技能ID获取技能信息 + + Args: + skill_id: 技能ID + + Returns: + API响应数据 + + Raises: + Exception: 请求失败时抛出 + """ + try: + url = f"{self.base_url}/datasource/skill/getBySkillId/{skill_id}" + + logger.info(f"正在调用API: {url}") + logger.info(f"请求参数 - skill_id: {skill_id}") + + response = self.client.get( + url, + headers=self._get_headers() + ) + + # 检查HTTP状态码 + response.raise_for_status() + + # 解析JSON响应 + data = response.json() + + logger.info(f"API调用成功: {url}") + logger.debug(f"响应数据: {data}") + + return data + + except httpx.TimeoutException: + error_msg = f"API请求超时: {url}" + logger.error(error_msg) + raise Exception(error_msg) + + except httpx.HTTPStatusError as e: + error_msg = f"API请求失败 (HTTP {e.response.status_code}): {url}" + logger.error(error_msg) + logger.error(f"错误响应: {e.response.text}") + raise Exception(error_msg) + + except httpx.RequestError as e: + error_msg = f"API请求异常: {url}, 错误: {str(e)}" + logger.error(error_msg) + raise Exception(error_msg) + + except Exception as e: + error_msg = f"处理API响应时出错: {str(e)}" + logger.error(error_msg, exc_info=True) + raise Exception(error_msg) + + def test_sql_with_schema(self, request_data: Dict[str, Any]) -> Dict[str, Any]: + """ + 测试SQL语句并返回执行结果 + + Args: + request_data: 请求数据,包含以下字段: + - datasourceId: 数据源ID + - businessName: 业务名称 + - businessDescription: 业务描述 + - sqlTemplate: SQL模板 + - parameters: 参数定义 + - testParams: 测试参数 + + Returns: + API响应数据 + + Raises: + Exception: 请求失败时抛出 + """ + try: + url = f"{self.base_url}/datasource/sqlExecutionLog/testSqlWithSchema" + + # 构建请求头(包含Content-Type) + headers = self._get_headers() + headers['Content-Type'] = 'application/json' + headers['Accept'] = '*/*' + + logger.info(f"正在调用测试SQL API: {url}") + logger.info(f"请求参数: {json.dumps(request_data, ensure_ascii=False, indent=2)}") + + # 发送POST请求 + response = self.client.post( + url, + headers=headers, + json=request_data + ) + + # 检查HTTP状态码 + response.raise_for_status() + + # 解析JSON响应 + result = response.json() + + logger.info(f"测试SQL API调用成功") + logger.debug(f"响应数据: {json.dumps(result, ensure_ascii=False, indent=2)}") + + # 处理返回数据结构: {code, data: {errorMessage, data}, msg} + # 检查外层 code + if result.get("code") != 200: + error_msg = result.get("msg", "接口返回错误") + logger.error(f"接口返回错误: code={result.get('code')}, msg={error_msg}") + raise Exception(error_msg) + + # 检查内层 errorMessage + inner_data = result.get("data", {}) + if inner_data.get("errorMessage"): + error_msg = inner_data.get("errorMessage") + logger.error(f"接口业务错误: {error_msg}") + raise Exception(error_msg) + + # 返回 data.data + return inner_data.get("data") + + except httpx.TimeoutException: + error_msg = f"测试SQL API请求超时: {url}" + logger.error(error_msg) + raise Exception(error_msg) + + except httpx.HTTPStatusError as e: + error_msg = f"测试SQL API请求失败 (HTTP {e.response.status_code}): {url}" + logger.error(error_msg) + logger.error(f"错误响应: {e.response.text}") + raise Exception(error_msg) + + except httpx.RequestError as e: + error_msg = f"测试SQL API请求异常: {url}, 错误: {str(e)}" + logger.error(error_msg) + raise Exception(error_msg) + + except Exception as e: + error_msg = f"处理测试SQL API响应时出错: {str(e)}" + logger.error(error_msg, exc_info=True) + raise Exception(error_msg) + + def close(self): + """关闭HTTP客户端""" + self.client.close() + + +# 创建默认客户端实例 +default_client = DataSourceAPIClient() + + +def get_skill_by_id(skill_id: str, base_url: Optional[str] = None, token: Optional[str] = None) -> Dict[str, Any]: + """ + 便捷函数:根据技能ID获取技能信息 + + Args: + skill_id: 技能ID + base_url: API基础URL(可选,默认从环境变量 BACKEND_BASE_URL 读取) + token: 认证令牌(可选,使用默认值) + + Returns: + API响应数据 + """ + if base_url or token: + client = DataSourceAPIClient( + base_url=base_url, + token=token + ) + return client.get_skill_by_id(skill_id) + else: + return default_client.get_skill_by_id(skill_id) + + +def test_sql_with_schema(request_data: Dict[str, Any], base_url: Optional[str] = None, token: Optional[str] = None) -> Dict[str, Any]: + """ + 便捷函数:测试SQL语句并返回执行结果 + + Args: + request_data: 请求数据,包含以下字段: + - datasourceId: 数据源ID + - businessName: 业务名称 + - businessDescription: 业务描述 + - sqlTemplate: SQL模板 + - parameters: 参数定义 + - testParams: 测试参数 + base_url: API基础URL(可选,默认从环境变量 BACKEND_BASE_URL 读取) + token: 认证令牌(可选,使用默认值) + + Returns: + API响应数据 + """ + if base_url or token: + client = DataSourceAPIClient( + base_url=base_url, + token=token + ) + return client.test_sql_with_schema(request_data) + else: + return default_client.test_sql_with_schema(request_data) + + +def process_skill_response(response: Dict[str, Any]) -> List[Dict[str, Any]]: + """ + 处理API响应数据,映射为businessQueries格式 + + Args: + response: API原始响应数据 + + Returns: + 处理后的查询配置列表 + """ + try: + # 提取data数组 + data_list = response.get("data", []) + + # 默认的员工ID参数schema + default_employee_schema = { + "type": "object", + "required": ["employeeId"], + "properties": { + "employeeId": { + "type": "number", + "description": "员工ID,用于标识员工的唯一数字标识符", + "examples": [1001, 2002] + } + } + } + + # 映射每个skill为businessQuery格式 + queries = [] + for skill in data_list: + # 解析sqlParams字符串为JSON对象 + sql_params = json.loads(skill.get("sqlParams", "{}")) + + # 判断sqlParams是否为空对象 + is_empty_params = ( + not sql_params.get("properties") or + len(sql_params.get("properties", {})) == 0 + ) and ( + not sql_params.get("required") or + len(sql_params.get("required", [])) == 0 + ) + + # 如果是空对象,使用默认的员工ID参数 + if is_empty_params: + logger.info(f"技能 {skill.get('name')} (ID: {skill.get('id')}) 的sqlParams为空,使用默认员工ID参数") + sql_params = default_employee_schema + + # 映射字段 + query = { + "id": skill.get("id"), + "businessName": skill.get("name"), + "businessDescription": skill.get("description"), + "sqlTemplate": skill.get("sqlTemplate"), + "parameters": sql_params, + "datasourceId": skill.get("datasourceId") + } + queries.append(query) + + logger.info(f"成功处理 {len(queries)} 条技能数据") + return queries + + except Exception as e: + logger.error(f"处理API响应数据失败: {e}", exc_info=True) + raise + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/env_config.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/env_config.py new file mode 100644 index 0000000..585b0a6 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/env_config.py @@ -0,0 +1,106 @@ +"""环境变量配置模块""" + +import os +from typing import Optional + + +def get_database_id(default: str = "29") -> str: + """ + 获取数据库ID环境变量 + + Args: + default: 默认值(默认为 "29") + + Returns: + str: 数据库ID + + Environment Variables: + databaseId: 数据库ID + """ + return os.environ.get("databaseId", default) + + +def get_datasource_id(default: str = "") -> str: + """ + 获取数据源ID环境变量 + + Args: + default: 默认值(默认为 "") + + Returns: + str: 数据源ID + + Environment Variables: + datasourceId: 数据源ID + """ + return os.environ.get("datasourceId", default) + + +def get_skill_id(default: str = "") -> str: + """ + 获取技能ID环境变量 + + Args: + default: 默认值(默认为 "") + + Returns: + str: 技能ID + + Environment Variables: + skillId: 技能ID + """ + return os.environ.get("skillId", default) + + +def get_backend_base_url(default: str = "http://lzwcai-demp-corp-manager:8086") -> str: + """ + 获取后端API基础URL环境变量 + + Args: + default: 默认值(默认为 "http://lzwcai-demp-corp-manager:8086") + + Returns: + str: 后端API基础URL + + Environment Variables: + backendBaseUrl: 后端API基础URL + """ + return os.environ.get("backendBaseUrl", default) + + +def get_env_config() -> dict: + """ + 获取所有环境配置 + + Returns: + dict: 包含所有配置的字典 + + Example: + config = get_env_config() + print(config['database_id']) # 输出: "29" + print(config['datasource_id']) # 输出: "" + print(config['skill_id']) # 输出: "" + print(config['backend_base_url']) # 输出: "http://lzwcai-demp-corp-manager:8086" + """ + return { + "database_id": get_database_id(), + "datasource_id": get_datasource_id(), + "skill_id": get_skill_id(), + "backend_base_url": get_backend_base_url() + } + + +def set_env_variable(key: str, value: str) -> None: + """ + 设置环境变量(仅在当前进程中有效) + + Args: + key: 环境变量名 + value: 环境变量值 + + Example: + set_env_variable("databaseId", "30") + set_env_variable("skillId", "1234567890") + """ + os.environ[key] = value + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/json_helper.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/json_helper.py new file mode 100644 index 0000000..1a6fc95 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/json_helper.py @@ -0,0 +1,60 @@ +"""JSON 文件读取工具""" + +import json +from pathlib import Path +from typing import Any, Union + + +def load_json(json_path: Union[str, Path]) -> Any: + """ + 读取 JSON 文件并返回其内容 + + Args: + json_path: JSON 文件的路径(支持字符串或 Path 对象) + + Returns: + JSON 文件中解析后的数据(可以是字典、列表或其他 JSON 类型) + + Raises: + FileNotFoundError: 当文件不存在时 + json.JSONDecodeError: 当 JSON 格式无效时 + Exception: 其他读取错误 + + Example: + >>> data = load_json('config.json') + >>> print(data) + {'key': 'value'} + + >>> data = load_json(Path('data/users.json')) + >>> print(data) + [{'id': 1, 'name': 'Alice'}] + """ + try: + # 转换为 Path 对象 + path = Path(json_path) + + # 检查文件是否存在 + if not path.exists(): + raise FileNotFoundError(f"JSON 文件不存在: {json_path}") + + # 检查是否为文件 + if not path.is_file(): + raise ValueError(f"路径不是一个文件: {json_path}") + + # 读取并解析 JSON 文件 + with open(path, 'r', encoding='utf-8') as f: + data = json.load(f) + + return data + + except json.JSONDecodeError as e: + raise json.JSONDecodeError( + f"JSON 格式错误: {e.msg}", + e.doc, + e.pos + ) + except FileNotFoundError: + raise + except Exception as e: + raise Exception(f"读取 JSON 文件时发生错误: {str(e)}") + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/logger_config.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/logger_config.py new file mode 100644 index 0000000..290964f --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/logger_config.py @@ -0,0 +1,489 @@ +# -*- coding: utf-8 -*- +""" +统一日志配置模块 +提供系统级别的日志配置和管理 +""" + +import os +import sys +import logging +from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler +from datetime import datetime +from pathlib import Path + + +class LoggerConfig: + """日志配置管理类""" + + def __init__(self, logs_dir: str = None): + """初始化日志配置 + + Args: + logs_dir: 日志目录路径,默认为项目根目录下的logs文件夹 + """ + # 确定日志目录 + if logs_dir: + self.logs_dir = Path(logs_dir) + else: + # 获取项目根目录(logger_config.py 在 utils 目录下,需要上升两层到达项目根目录) + project_root = Path(__file__).parent.parent + self.logs_dir = project_root / "logs" + + # 创建日志目录 + self.logs_dir.mkdir(exist_ok=True) + + # 日志格式 + self.log_format = '%(asctime)s - %(name)s - %(levelname)s - [%(filename)s:%(lineno)d] - %(message)s' + self.date_format = '%Y-%m-%d %H:%M:%S' + + # 从环境变量获取日志级别,默认为INFO + self.log_level = self._get_log_level_from_env() + + # 是否已初始化 + self._initialized = False + + def _get_log_level_from_env(self) -> int: + """从环境变量获取日志级别 + + Returns: + int: 日志级别 + """ + log_level_str = os.getenv('LOG_LEVEL', 'INFO').upper() + + # 日志级别映射 + level_mapping = { + 'DEBUG': logging.DEBUG, + 'INFO': logging.INFO, + 'WARNING': logging.WARNING, + 'WARN': logging.WARNING, # 兼容性别名 + 'ERROR': logging.ERROR, + 'CRITICAL': logging.CRITICAL, + 'FATAL': logging.CRITICAL # 兼容性别名 + } + + return level_mapping.get(log_level_str, logging.INFO) + + def setup_logging(self, + app_name: str = "lzwcai_mcp_sqlexecutor", + log_level: int = logging.INFO, + max_file_size: int = 10 * 1024 * 1024, # 10MB + backup_count: int = 5, + console_output: bool = True) -> logging.Logger: + """设置系统日志配置 + + Args: + app_name: 应用名称,用于日志文件命名 + log_level: 日志级别 + max_file_size: 单个日志文件最大大小(字节) + backup_count: 保留的备份文件数量 + console_output: 是否输出到控制台 + + Returns: + logging.Logger: 配置好的根日志器 + """ + if self._initialized: + return logging.getLogger() + + # 设置根日志器 + root_logger = logging.getLogger() + root_logger.setLevel(log_level) + + # 清除现有的处理器 + for handler in root_logger.handlers[:]: + root_logger.removeHandler(handler) + + # 创建格式化器 + formatter = logging.Formatter(self.log_format, self.date_format) + + # 1. 主日志文件 - 按大小滚动 + main_log_file = self.logs_dir / f"{app_name}.log" + file_handler = RotatingFileHandler( + main_log_file, + maxBytes=max_file_size, + backupCount=backup_count, + encoding='utf-8' + ) + file_handler.setLevel(log_level) + file_handler.setFormatter(formatter) + root_logger.addHandler(file_handler) + + # 2. 错误日志文件 - 只记录ERROR及以上级别 + error_log_file = self.logs_dir / f"{app_name}_error.log" + error_handler = RotatingFileHandler( + error_log_file, + maxBytes=max_file_size, + backupCount=backup_count, + encoding='utf-8' + ) + error_handler.setLevel(logging.ERROR) + error_handler.setFormatter(formatter) + root_logger.addHandler(error_handler) + + # 3. 按日期滚动的日志文件 + daily_log_file = self.logs_dir / f"{app_name}_daily.log" + daily_handler = TimedRotatingFileHandler( + daily_log_file, + when='midnight', + interval=1, + backupCount=30, # 保留30天 + encoding='utf-8' + ) + daily_handler.setLevel(log_level) + daily_handler.setFormatter(formatter) + daily_handler.suffix = "%Y-%m-%d" + root_logger.addHandler(daily_handler) + + # 4. 控制台输出 + # 重要:MCP协议使用stdio时,必须将日志输出到stderr,stdout仅用于JSON-RPC通信 + if console_output: + console_handler = logging.StreamHandler(sys.stderr) + console_handler.setLevel(log_level) + console_formatter = logging.Formatter( + '%(asctime)s - %(name)s - %(levelname)s - %(message)s', + self.date_format + ) + console_handler.setFormatter(console_formatter) + root_logger.addHandler(console_handler) + + self._initialized = True + + # 记录初始化信息 + root_logger.info(f"日志系统初始化完成 - 日志目录: {self.logs_dir}") + root_logger.info(f"日志配置 - 级别: {logging.getLevelName(log_level)}, 文件大小限制: {max_file_size//1024//1024}MB, 备份数量: {backup_count}") + + return root_logger + + def get_module_logger(self, module_name: str) -> logging.Logger: + """获取模块专用日志器 + + Args: + module_name: 模块名称 + + Returns: + logging.Logger: 模块日志器 + """ + return logging.getLogger(module_name) + + def create_component_logger(self, + component_name: str, + log_file: str = None, + log_level: int = None) -> logging.Logger: + """为特定组件创建独立的日志器 + + Args: + component_name: 组件名称 + log_file: 独立日志文件名(可选) + log_level: 日志级别(可选) + + Returns: + logging.Logger: 组件日志器 + """ + logger = logging.getLogger(component_name) + + if log_file: + # 为组件创建独立的日志文件 + component_log_file = self.logs_dir / log_file + handler = RotatingFileHandler( + component_log_file, + maxBytes=5 * 1024 * 1024, # 5MB + backupCount=3, + encoding='utf-8' + ) + + formatter = logging.Formatter(self.log_format, self.date_format) + handler.setFormatter(formatter) + + if log_level: + handler.setLevel(log_level) + + logger.addHandler(handler) + logger.info(f"组件日志器创建完成: {component_name} -> {component_log_file}") + + return logger + + def setup_mqtt_logging(self) -> logging.Logger: + """设置MQTT专用日志 + + Returns: + logging.Logger: MQTT日志器 + """ + return self.create_component_logger( + "mqtt_communication", + "mqtt_communication.log", + logging.DEBUG + ) + + def setup_mcp_logging(self) -> logging.Logger: + """设置MCP专用日志 + + Returns: + logging.Logger: MCP日志器 + """ + return self.create_component_logger( + "mcp_services", + "mcp_services.log", + logging.DEBUG + ) + + def setup_api_logging(self) -> logging.Logger: + """设置API专用日志 + + Returns: + logging.Logger: API日志器 + """ + return self.create_component_logger( + "api_requests", + "api_requests.log", + logging.INFO + ) + + def get_logs_info(self) -> dict: + """获取日志系统信息 + + Returns: + dict: 日志系统信息 + """ + log_files = [] + if self.logs_dir.exists(): + for log_file in self.logs_dir.glob("*.log*"): + stat = log_file.stat() + log_files.append({ + "name": log_file.name, + "size": stat.st_size, + "modified": datetime.fromtimestamp(stat.st_mtime).isoformat() + }) + + return { + "logs_directory": str(self.logs_dir), + "initialized": self._initialized, + "log_files": log_files, + "total_files": len(log_files) + } + + def cleanup_old_logs(self, days: int = 30): + """清理旧日志文件 + + Args: + days: 保留天数 + """ + if not self.logs_dir.exists(): + return + + from datetime import timedelta + cutoff_time = datetime.now() - timedelta(days=days) + + cleaned_files = [] + for log_file in self.logs_dir.glob("*.log*"): + if log_file.stat().st_mtime < cutoff_time.timestamp(): + try: + log_file.unlink() + cleaned_files.append(log_file.name) + except Exception as e: + logging.error(f"清理日志文件失败: {log_file.name}, 错误: {e}") + + if cleaned_files: + logging.info(f"清理了 {len(cleaned_files)} 个旧日志文件: {cleaned_files}") + + def set_log_level(self, level: int, logger_name: str = None): + """动态调整日志级别 + + Args: + level: 新的日志级别 (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL) + logger_name: 指定日志器名称,None表示调整根日志器 + """ + if logger_name: + logger = logging.getLogger(logger_name) + else: + logger = logging.getLogger() + + old_level = logger.level + logger.setLevel(level) + + # 同时调整所有处理器的级别 + for handler in logger.handlers: + if not isinstance(handler, logging.StreamHandler) or handler.stream not in (sys.stdout, sys.stderr): + # 不调整控制台处理器的级别,保持原有设置 + handler.setLevel(level) + + level_name = logging.getLevelName(level) + old_level_name = logging.getLevelName(old_level) + target = logger_name or "根日志器" + + logger.info(f"日志级别已调整: {target} {old_level_name} -> {level_name}") + + def set_temporary_log_level(self, level: int, logger_name: str = None): + """临时调整日志级别(会保存原始级别用于恢复) + + Args: + level: 临时日志级别 + logger_name: 指定日志器名称,None表示调整根日志器 + """ + if not hasattr(self, '_original_levels'): + self._original_levels = {} + + target_name = logger_name or 'root' + + if logger_name: + logger = logging.getLogger(logger_name) + else: + logger = logging.getLogger() + + # 保存原始级别 + if target_name not in self._original_levels: + self._original_levels[target_name] = logger.level + + # 设置新级别 + self.set_log_level(level, logger_name) + + level_name = logging.getLevelName(level) + target = logger_name or "根日志器" + logger.info(f"临时调整日志级别: {target} -> {level_name} (可通过restore_log_level恢复)") + + def restore_log_level(self, logger_name: str = None): + """恢复日志级别到调整前的状态 + + Args: + logger_name: 指定日志器名称,None表示恢复根日志器 + """ + if not hasattr(self, '_original_levels'): + logging.warning("没有找到保存的原始日志级别") + return + + target_name = logger_name or 'root' + + if target_name not in self._original_levels: + logging.warning(f"没有找到 {target_name} 的原始日志级别") + return + + original_level = self._original_levels[target_name] + self.set_log_level(original_level, logger_name) + + # 清除保存的级别 + del self._original_levels[target_name] + + target = logger_name or "根日志器" + level_name = logging.getLevelName(original_level) + logging.info(f"已恢复日志级别: {target} -> {level_name}") + + def get_current_log_levels(self) -> dict: + """获取当前所有日志器的级别信息 + + Returns: + dict: 日志器级别信息 + """ + levels_info = {} + + # 根日志器 + root_logger = logging.getLogger() + levels_info['root'] = { + 'level': root_logger.level, + 'level_name': logging.getLevelName(root_logger.level), + 'handlers_count': len(root_logger.handlers) + } + + # 其他已创建的日志器 + for name, logger in logging.Logger.manager.loggerDict.items(): + if isinstance(logger, logging.Logger): + levels_info[name] = { + 'level': logger.level, + 'level_name': logging.getLevelName(logger.level), + 'handlers_count': len(logger.handlers) + } + + return levels_info + + +# 全局日志配置实例 +logger_config = LoggerConfig() + + +def setup_system_logging(app_name: str = "lzwcai_mcp_sqlexecutor", + log_level: int = logging.INFO) -> logging.Logger: + """系统日志初始化快捷函数 + + Args: + app_name: 应用名称 + log_level: 日志级别 + + Returns: + logging.Logger: 根日志器 + """ + return logger_config.setup_logging(app_name, log_level) + + +def get_logger(name: str) -> logging.Logger: + """获取日志器的快捷函数 + + Args: + name: 日志器名称 + + Returns: + logging.Logger: 日志器实例 + """ + return logger_config.get_module_logger(name) + + +def set_log_level(level: int, logger_name: str = None): + """动态调整日志级别的快捷函数 + + Args: + level: 新的日志级别 (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL) + logger_name: 指定日志器名称,None表示调整根日志器 + + Examples: + # 调整根日志器为DEBUG级别 + set_log_level(logging.DEBUG) + + # 调整特定模块日志器为WARNING级别 + set_log_level(logging.WARNING, "agent_ontology.core") + """ + logger_config.set_log_level(level, logger_name) + + +def set_temporary_log_level(level: int, logger_name: str = None): + """临时调整日志级别的快捷函数 + + Args: + level: 临时日志级别 + logger_name: 指定日志器名称,None表示调整根日志器 + + Examples: + # 临时调整为DEBUG级别进行调试 + set_temporary_log_level(logging.DEBUG) + # ... 进行调试 ... + # 恢复原始级别 + restore_log_level() + """ + logger_config.set_temporary_log_level(level, logger_name) + + +def restore_log_level(logger_name: str = None): + """恢复日志级别的快捷函数 + + Args: + logger_name: 指定日志器名称,None表示恢复根日志器 + """ + logger_config.restore_log_level(logger_name) + + +def get_current_log_levels() -> dict: + """获取当前日志级别信息的快捷函数 + + Returns: + dict: 日志器级别信息 + + Examples: + levels = get_current_log_levels() + print(f"根日志器级别: {levels['root']['level_name']}") + """ + return logger_config.get_current_log_levels() + + +# 便捷的日志级别常量 +class LogLevel: + """日志级别常量类""" + DEBUG = logging.DEBUG + INFO = logging.INFO + WARNING = logging.WARNING + ERROR = logging.ERROR + CRITICAL = logging.CRITICAL \ No newline at end of file diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/name_helper.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/name_helper.py new file mode 100644 index 0000000..d66cf32 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/name_helper.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +""" +名称生成工具模块 +""" + +from pypinyin import lazy_pinyin, Style +import logging + +logger = logging.getLogger(__name__) + + +def generate_tool_name(business_name: str, tool_id: str) -> str: + """ + 根据业务名称和ID生成工具名称 + 格式: tool_拼音_id + + Args: + business_name: 业务名称(中文) + tool_id: 工具ID + + Returns: + str: 格式化的工具名称 + """ + try: + # 将中文转换为拼音(无音调,小写) + pinyin_list = lazy_pinyin(business_name, style=Style.NORMAL) + # 拼接拼音 + pinyin_str = ''.join(pinyin_list) + + # 将 ID 中的 '-' 替换为 '_' + formatted_id = tool_id.replace('-', '_') + + # 组合成最终的工具名称 + tool_name = f"tool_{pinyin_str}_{formatted_id}" + + return tool_name + except Exception as e: + logger.error(f"生成工具名称失败: {business_name}, {tool_id}, 错误: {e}", exc_info=True) + # 降级处理:如果拼音转换失败,使用 ID + return f"tool_{tool_id.replace('-', '_')}" + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/schema_helper.py b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/schema_helper.py new file mode 100644 index 0000000..626559f --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/utils/schema_helper.py @@ -0,0 +1,166 @@ +# -*- coding: utf-8 -*- +""" +Schema 生成工具模块 +""" + +from typing import Any, Dict, List + + +def generate_input_schema(parameters: Dict[str, Any]) -> Dict[str, Any]: + """ + 从查询配置的参数定义生成 MCP 工具的 inputSchema + + 此函数会保留完整的 JSON Schema 信息,包括: + - type: Schema 类型(通常是 "object") + - required: 必填字段列表 + - properties: 属性定义(包括每个属性的 type, description, format, examples 等) + - description: Schema 的整体描述(如果有) + - 以及其他任何 JSON Schema 标准字段 + + 此函数还会自动添加以下字段(如果原始 parameters 中未定义): + - targetDatabaseName: 目标数据库名称(非必填,默认为空字符串) + + Args: + parameters: 查询配置中的参数定义字典,应该是一个完整的 JSON Schema 对象 + + Returns: + Dict[str, Any]: 符合 JSON Schema 规范的 inputSchema 对象 + + Example: + >>> params = { + ... "type": "object", + ... "required": ["userId", "startTime"], + ... "properties": { + ... "userId": { + ... "type": "integer", + ... "description": "用户的唯一标识符", + ... "examples": [10086] + ... }, + ... "startTime": { + ... "type": "string", + ... "format": "date-time", + ... "description": "查询的起始时间", + ... "examples": ["2023-01-01 00:00:00"] + ... } + ... } + ... } + >>> schema = generate_input_schema(params) + >>> # schema 将包含所有原始信息,包括 format 和 examples + >>> # 同时会自动添加 targetDatabaseName 字段 + """ + # 如果 parameters 本身就是一个完整的 JSON Schema 对象,直接使用 + # 但确保至少包含 type 和 properties + if not parameters: + # 如果 parameters 为空,返回一个空的 object schema + return { + "type": "object", + "properties": {}, + "required": [] + } + + # 检查 parameters 是否已经是完整的 JSON Schema 格式 + # 完整格式应该有 "type": "object" 和 "properties" 字段 + if "type" in parameters and parameters.get("type") == "object" and "properties" in parameters: + # 已经是完整的 JSON Schema 格式,直接使用 + input_schema = dict(parameters) + else: + # parameters 是简化格式(直接是参数定义),需要转换为 JSON Schema 格式 + # 例如: {"workOrderNumber": {"type": "string", "description": "...", "required": true}} + properties = {} + required = [] + + for param_name, param_def in parameters.items(): + if isinstance(param_def, dict): + # 提取 required 标记 + if param_def.get("required", False): + required.append(param_name) + + # 复制参数定义,但移除 required 字段(它应该在顶层的 required 数组中) + prop_def = {k: v for k, v in param_def.items() if k != "required"} + properties[param_name] = prop_def + + input_schema = { + "type": "object", + "properties": properties, + "required": required + } + + # 确保必需的字段存在 + if "type" not in input_schema: + input_schema["type"] = "object" + + if "properties" not in input_schema: + input_schema["properties"] = {} + + if "required" not in input_schema: + input_schema["required"] = [] + + # 添加 targetDatabaseName 字段(如果不存在) + if "targetDatabaseName" not in input_schema["properties"]: + input_schema["properties"]["targetDatabaseName"] = { + "type": "string", + "description": "目标数据库名称", + "default": "" + } + + # 保留所有其他字段,如 description, examples, format 等 + # JSON Schema 标准支持的字段都会被保留: + # - additionalProperties + # - patternProperties + # - minProperties / maxProperties + # - dependencies + # - 等等 + + return input_schema + + +def validate_input_schema(schema: Dict[str, Any]) -> tuple[bool, str]: + """ + 验证 inputSchema 是否符合基本的 JSON Schema 规范 + + Args: + schema: 要验证的 schema 对象 + + Returns: + tuple[bool, str]: (是否有效, 错误消息或成功消息) + + Example: + >>> schema = {"type": "object", "properties": {"id": {"type": "string"}}} + >>> is_valid, msg = validate_input_schema(schema) + >>> print(is_valid, msg) + True, "Schema 验证通过" + """ + if not isinstance(schema, dict): + return False, "Schema 必须是一个字典对象" + + if schema.get("type") != "object": + return False, "Schema 的 type 字段必须是 'object'" + + if "properties" not in schema: + return False, "Schema 必须包含 properties 字段" + + if not isinstance(schema.get("properties"), dict): + return False, "Schema 的 properties 字段必须是一个字典对象" + + # 验证 required 字段(如果存在) + if "required" in schema: + required = schema["required"] + if not isinstance(required, list): + return False, "Schema 的 required 字段必须是一个列表" + + # 验证所有 required 的字段都在 properties 中定义 + properties = schema["properties"] + for field in required: + if field not in properties: + return False, f"必填字段 '{field}' 未在 properties 中定义" + + # 验证 properties 中每个字段的定义 + for prop_name, prop_def in schema["properties"].items(): + if not isinstance(prop_def, dict): + return False, f"属性 '{prop_name}' 的定义必须是一个字典对象" + + if "type" not in prop_def: + return False, f"属性 '{prop_name}' 必须包含 type 字段" + + return True, "Schema 验证通过" + diff --git a/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/uv.lock b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/uv.lock new file mode 100644 index 0000000..017ec10 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/lzwcai_mcpskills_analyzeOrder/uv.lock @@ -0,0 +1,497 @@ +version = 1 +revision = 2 +requires-python = ">=3.13" + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/aff/07c09a53a08bc/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/1f0/2e8b43a8fbbc3/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53" }, +] + +[[package]] +name = "anyio" +version = "4.11.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "idna" }, + { name = "sniffio" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/82a/8d0b81e318cc5/anyio-4.11.0.tar.gz", hash = "sha256:82a8d0b81e318cc5ce71a5f1f8b5c4e63619620b63141ef8c995fa0db95a57c4" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/028/7e96f4d26d414/anyio-4.11.0-py3-none-any.whl", hash = "sha256:0287e96f4d26d4149305414d4e3bc32f0dcd0862365a4bddea19d7a1ec38c4fc" }, +] + +[[package]] +name = "attrs" +version = "25.4.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/16d/5969b87f0859e/attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/adc/f7e2a1fb3b36a/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373" }, +] + +[[package]] +name = "certifi" +version = "2025.10.5" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/47c/09d31ccf2acf0/certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/0f2/12c2744a9bb6d/certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de" }, +] + +[[package]] +name = "click" +version = "8.3.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/e7b/8232224eba16f/click-8.3.0.tar.gz", hash = "sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/9b9/f285302c6e306/click-8.3.0-py3-none-any.whl", hash = "sha256:9b9f285302c6e3064f4330c05f05b81945b2a39544279343e6e7c5f27a9baddc" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/086/95f5cb7ed6e05/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/4f1/d9991f5acc0ca/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/4e3/5b956cf45792e/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/63c/f8bbe7522de3b/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/6e3/4463af53fd2ab/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/2d4/00746a40668fc/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/75e/98c5f16b0f35b/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/d90/9fcccc110f8c7/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad" }, +] + +[[package]] +name = "httpx-sse" +version = "0.4.3" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/9b1/ed0127459a660/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/0ac/1c9fe3c0afad2/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/795/dafcc9c04ed0c/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/771/a87f49d9defaf/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea" }, +] + +[[package]] +name = "jsonschema" +version = "4.25.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "attrs" }, + { name = "jsonschema-specifications" }, + { name = "referencing" }, + { name = "rpds-py" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/e4a/9655ce0da0c0b/jsonschema-4.25.1.tar.gz", hash = "sha256:e4a9655ce0da0c0b67a085847e00a3a51449e1157f4f75e9fb5aa545e122eb85" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/3fb/a0169e345c717/jsonschema-4.25.1-py3-none-any.whl", hash = "sha256:3fba0169e345c7175110351d456342c364814cfcf3b964ba4587f22915230a63" }, +] + +[[package]] +name = "jsonschema-specifications" +version = "2025.9.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "referencing" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/b54/0987f239e7456/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/988/02fee3a11ee76/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe" }, +] + +[[package]] +name = "lzwcai-mcpskills-analyzeWorkOrder" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "httpx" }, + { name = "mcp", extra = ["cli"] }, +] + +[package.metadata] +requires-dist = [ + { name = "httpx", specifier = ">=0.28.1" }, + { name = "mcp", extras = ["cli"], specifier = ">=1.10.1" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.0.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/cb0/a2b4aa34f932c/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/873/27c59b172c501/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147" }, +] + +[[package]] +name = "mcp" +version = "1.10.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "anyio" }, + { name = "httpx" }, + { name = "httpx-sse" }, + { name = "jsonschema" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "python-multipart" }, + { name = "sse-starlette" }, + { name = "starlette" }, + { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/aaa/0957d8307feef/mcp-1.10.1.tar.gz", hash = "sha256:aaa0957d8307feeff180da2d9d359f2b801f35c0c67f1882136239055ef034c2" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/4d0/8301aefe906dc/mcp-1.10.1-py3-none-any.whl", hash = "sha256:4d08301aefe906dce0fa482289db55ce1db831e3e67212e65b5e23ad8454b3c5" }, +] + +[package.optional-dependencies] +cli = [ + { name = "python-dotenv" }, + { name = "typer" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/bb4/13d29f5eea38f/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/840/08a41e51615a4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8" }, +] + +[[package]] +name = "pydantic" +version = "2.12.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/7b8/fa15b831a4bbd/pydantic-2.12.2.tar.gz", hash = "sha256:7b8fa15b831a4bbde9d5b84028641ac3080a4ca2cbd4a621a661687e741624fd" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/25f/f718ee909acd8/pydantic-2.12.2-py3-none-any.whl", hash = "sha256:25ff718ee909acd82f1ff9b1a4acfd781bb23ab3739adaa7144f19a6a4e231ae" }, +] + +[[package]] +name = "pydantic-core" +version = "2.41.4" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/70e/47929a9d4a190/pydantic_core-2.41.4.tar.gz", hash = "sha256:70e47929a9d4a1905a67e4b687d5946026390568a8e952b92824118063cee4d5" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/85e/050ad9e5f6fe1/pydantic_core-2.41.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:85e050ad9e5f6fe1004eec65c914332e52f429bc0ae12d6fa2092407a462c746" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/e73/93f1d64792763/pydantic_core-2.41.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e7393f1d64792763a48924ba31d1e44c2cfbc05e3b1c2c9abb4ceeadd912cced" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/94d/ab0940b0d1fb2/pydantic_core-2.41.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94dab0940b0d1fb28bcab847adf887c66a27a40291eedf0b473be58761c9799a" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/de7/c42f897e689ee/pydantic_core-2.41.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:de7c42f897e689ee6f9e93c4bec72b99ae3b32a2ade1c7e4798e690ff5246e02" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/664/b319919326227/pydantic_core-2.41.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:664b3199193262277b8b3cd1e754fb07f2c6023289c815a1e1e8fb415cb247b1" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d95/b253b88f7d308/pydantic_core-2.41.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95b253b88f7d308b1c0b417c4624f44553ba4762816f94e6986819b9c273fb2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a13/51f5bbdbbabc6/pydantic_core-2.41.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1351f5bbdbbabc689727cb91649a00cb9ee7203e0a6e54e9f5ba9e22e384b84" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/1af/fa4798520b148/pydantic_core-2.41.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1affa4798520b148d7182da0615d648e752de4ab1a9566b7471bc803d88a062d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/7b7/4e18052fea4aa/pydantic_core-2.41.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7b74e18052fea4aa8dea2fb7dbc23d15439695da6cbe6cfc1b694af1115df09d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/285/b643d75c0e30a/pydantic_core-2.41.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:285b643d75c0e30abda9dc1077395624f314a37e3c09ca402d4015ef5979f1a2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/f52/679ff4218d713/pydantic_core-2.41.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:f52679ff4218d713b3b33f88c89ccbf3a5c2c12ba665fb80ccc4192b4608dbab" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ecd/e6dedd6fff127/pydantic_core-2.41.4-cp313-cp313-win32.whl", hash = "sha256:ecde6dedd6fff127c273c76821bb754d793be1024bc33314a120f83a3c69460c" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d08/1a1f3800f0540/pydantic_core-2.41.4-cp313-cp313-win_amd64.whl", hash = "sha256:d081a1f3800f05409ed868ebb2d74ac39dd0c1ff6c035b5162356d76030736d4" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/f8e/49c9c364a7edc/pydantic_core-2.41.4-cp313-cp313-win_arm64.whl", hash = "sha256:f8e49c9c364a7edcbe2a310f12733aad95b022495ef2a8d653f645e5d20c1564" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ed9/7fd56a561f5eb/pydantic_core-2.41.4-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:ed97fd56a561f5eb5706cebe94f1ad7c13b84d98312a05546f2ad036bafe87f4" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a87/0c307bf1ee91f/pydantic_core-2.41.4-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a870c307bf1ee91fc58a9a61338ff780d01bfae45922624816878dce784095d2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d25/e97bc1f5f8f79/pydantic_core-2.41.4-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d25e97bc1f5f8f7985bdc2335ef9e73843bb561eb1fa6831fdfc295c1c2061cf" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d40/5d14bea042f16/pydantic_core-2.41.4-cp313-cp313t-win_amd64.whl", hash = "sha256:d405d14bea042f166512add3091c1af40437c2e7f86988f3915fabd27b1e9cd2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/19f/3684868309db5/pydantic_core-2.41.4-cp313-cp313t-win_arm64.whl", hash = "sha256:19f3684868309db5263a11bace3c45d93f6f24afa2ffe75a647583df22a2ff89" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/e92/05d97ed08a82e/pydantic_core-2.41.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:e9205d97ed08a82ebb9a307e92914bb30e18cdf6f6b12ca4bedadb1588a0bfe1" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/82d/f1f432b37d832/pydantic_core-2.41.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:82df1f432b37d832709fbcc0e24394bba04a01b6ecf1ee87578145c19cde12ac" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/fc3/b4cc4539e055c/pydantic_core-2.41.4-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc3b4cc4539e055cfa39a3763c939f9d409eb40e85813257dcd761985a108554" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/b1e/b1754fce47c63/pydantic_core-2.41.4-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b1eb1754fce47c63d2ff57fdb88c351a6c0150995890088b33767a10218eaa4e" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/e6a/b5ab30ef325b4/pydantic_core-2.41.4-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e6ab5ab30ef325b443f379ddb575a34969c333004fca5a1daa0133a6ffaad616" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/31a/41030b1d9ca49/pydantic_core-2.41.4-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:31a41030b1d9ca497634092b46481b937ff9397a86f9f51bd41c4767b6fc04af" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a44/ac1738591472c/pydantic_core-2.41.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a44ac1738591472c3d020f61c6df1e4015180d6262ebd39bf2aeb52571b60f12" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d72/f2b5e6e82ab8f/pydantic_core-2.41.4-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d72f2b5e6e82ab8f94ea7d0d42f83c487dc159c5240d8f83beae684472864e2d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/c4d/1e854aaf04448/pydantic_core-2.41.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:c4d1e854aaf044487d31143f541f7aafe7b482ae72a022c664b2de2e466ed0ad" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/b56/8af94267729d7/pydantic_core-2.41.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b568af94267729d76e6ee5ececda4e283d07bbb28e8148bb17adad93d025d25a" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/6d5/5fb8b1e8929b3/pydantic_core-2.41.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:6d55fb8b1e8929b341cc313a81a26e0d48aa3b519c1dbaadec3a6a2b4fcad025" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/5b6/6584e549e2e32/pydantic_core-2.41.4-cp314-cp314-win32.whl", hash = "sha256:5b66584e549e2e32a1398df11da2e0a7eff45d5c2d9db9d5667c5e6ac764d77e" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/557/a0aab88664cc5/pydantic_core-2.41.4-cp314-cp314-win_amd64.whl", hash = "sha256:557a0aab88664cc552285316809cab897716a372afaf8efdbef756f8b890e894" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/3f1/ea6f48a045745/pydantic_core-2.41.4-cp314-cp314-win_arm64.whl", hash = "sha256:3f1ea6f48a045745d0d9f325989d8abd3f1eaf47dd00485912d1a3a63c623a8d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/6c1/fe4c5404c448b/pydantic_core-2.41.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6c1fe4c5404c448b13188dd8bd2ebc2bdd7e6727fa61ff481bcc2cca894018da" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/523/e7da4d43b113b/pydantic_core-2.41.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:523e7da4d43b113bf8e7b49fa4ec0c35bf4fe66b2230bfc5c13cc498f12c6c3e" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/572/9225de81fb65b/pydantic_core-2.41.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5729225de81fb65b70fdb1907fcf08c75d498f4a6f15af005aabb1fdadc19dfa" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/de2/cfbb09e88f0f7/pydantic_core-2.41.4-cp314-cp314t-win_amd64.whl", hash = "sha256:de2cfbb09e88f0f795fd90cf955858fc2c691df65b1f21f0aa00b99f3fbc661d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d34/f950ae05a83e0/pydantic_core-2.41.4-cp314-cp314t-win_arm64.whl", hash = "sha256:d34f950ae05a83e0ede899c595f312ca976023ea1db100cd5aa188f7005e3ab0" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.11.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/d0e/87a1c7d33593b/pydantic_settings-2.11.0.tar.gz", hash = "sha256:d0e87a1c7d33593beb7194adb8470fc426e95ba02af83a0f23474a04c9a08180" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/fe2/cea3413b9530d/pydantic_settings-2.11.0-py3-none-any.whl", hash = "sha256:fe2cea3413b9530d10f3a5875adffb17ada5c1e1bab0b2885546d7310415207c" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/636/cb2477cec7f89/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/865/40386c03d588b/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b" }, +] + +[[package]] +name = "python-dotenv" +version = "1.1.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/a8a/6399716257f45/python_dotenv-1.1.1.tar.gz", hash = "sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/31f/23644fe2602f8/python_dotenv-1.1.1-py3-none-any.whl", hash = "sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc" }, +] + +[[package]] +name = "python-multipart" +version = "0.0.20" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/8dd/0cab45b8e2306/python_multipart-0.0.20.tar.gz", hash = "sha256:8dd0cab45b8e23064ae09147625994d090fa46f5b0d1e13af944c331a7fa9d13" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/8a6/2d3a8335e0658/python_multipart-0.0.20-py3-none-any.whl", hash = "sha256:8a62d3a8335e06589fe01f2a3e178cdcc632f3fbe0d492ad9ee0ec35aab1f104" }, +] + +[[package]] +name = "referencing" +version = "0.37.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "attrs" }, + { name = "rpds-py" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/44a/efc3142c5b842/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/381/329a9f99628c9/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231" }, +] + +[[package]] +name = "rich" +version = "14.2.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/73f/f50c7c0c1c77c/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/76b/c51fe2e57d2b1/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd" }, +] + +[[package]] +name = "rpds-py" +version = "0.27.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/26a/1c73171d10b7a/rpds_py-0.27.1.tar.gz", hash = "sha256:26a1c73171d10b7acccbded82bf6a586ab8203601e565badc74bbbf8bc5a10f8" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/e4b/9fcfbc0216338/rpds_py-0.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e4b9fcfbc021633863a37e92571d6f91851fa656f0180246e84cbd8b3f6b329b" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/144/1811a96eadca9/rpds_py-0.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1441811a96eadca93c517d08df75de45e5ffe68aa3089924f963c782c4b898cf" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/552/66dafa22e672f/rpds_py-0.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55266dafa22e672f5a4f65019015f90336ed31c6383bd53f5e7826d21a0e0b83" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d78/827d7ac08627e/rpds_py-0.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d78827d7ac08627ea2c8e02c9e5b41180ea5ea1f747e9db0915e3adf36b62dcf" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ae9/2443798a40a92/rpds_py-0.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae92443798a40a92dc5f0b01d8a7c93adde0c4dc965310a29ae7c64d72b9fad2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/c46/c9dd2403b66a2/rpds_py-0.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c46c9dd2403b66a2a3b9720ec4b74d4ab49d4fabf9f03dfdce2d42af913fe8d0" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/2ef/e4eb1d01b7f5f/rpds_py-0.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2efe4eb1d01b7f5f1939f4ef30ecea6c6b3521eec451fb93191bf84b2a522418" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/15d/3b4d83582d10c/rpds_py-0.27.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:15d3b4d83582d10c601f481eca29c3f138d44c92187d197aff663a269197c02d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/4ed/2e16abbc982a1/rpds_py-0.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4ed2e16abbc982a169d30d1a420274a709949e2cbdef119fe2ec9d870b42f274" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a75/f305c9b013289/rpds_py-0.27.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a75f305c9b013289121ec0f1181931975df78738cdf650093e6b86d74aa7d8dd" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/67c/e762070474588/rpds_py-0.27.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:67ce7620704745881a3d4b0ada80ab4d99df390838839921f99e63c474f82cf2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/9d9/92ac10eb86d9b/rpds_py-0.27.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9d992ac10eb86d9b6f369647b6a3f412fc0075cfd5d799530e84d335e440a002" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/4f7/5e4bd8ab8db62/rpds_py-0.27.1-cp313-cp313-win32.whl", hash = "sha256:4f75e4bd8ab8db624e02c8e2fc4063021b58becdbe6df793a8111d9343aec1e3" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/f90/25faafc62ed0b/rpds_py-0.27.1-cp313-cp313-win_amd64.whl", hash = "sha256:f9025faafc62ed0b75a53e541895ca272815bec18abe2249ff6501c8f2e12b83" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ed1/0dc32829e7d22/rpds_py-0.27.1-cp313-cp313-win_arm64.whl", hash = "sha256:ed10dc32829e7d222b7d3b93136d25a406ba9788f6a7ebf6809092da1f4d279d" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/920/22bbbad0d4426/rpds_py-0.27.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:92022bbbad0d4426e616815b16bc4127f83c9a74940e1ccf3cfe0b387aba0228" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/471/62fdab9407ec3/rpds_py-0.27.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:47162fdab9407ec3f160805ac3e154df042e577dd53341745fc7fb3f625e6d92" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/fb8/9bec23fddc489/rpds_py-0.27.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb89bec23fddc489e5d78b550a7b773557c9ab58b7946154a10a6f7a214a48b2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/e48/af21883ded2b3/rpds_py-0.27.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e48af21883ded2b3e9eb48cb7880ad8598b31ab752ff3be6457001d78f416723" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/6f5/b7bd8e219ed50/rpds_py-0.27.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6f5b7bd8e219ed50299e58551a410b64daafb5017d54bbe822e003856f06a802" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/08f/1e20bccf73b08/rpds_py-0.27.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:08f1e20bccf73b08d12d804d6e1c22ca5530e71659e6673bce31a6bb71c1e73f" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/0dc/5dceeaefcc96d/rpds_py-0.27.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0dc5dceeaefcc96dc192e3a80bbe1d6c410c469e97bdd47494a7d930987f18b2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d76/f9cc8665acdc0/rpds_py-0.27.1-cp313-cp313t-manylinux_2_31_riscv64.whl", hash = "sha256:d76f9cc8665acdc0c9177043746775aa7babbf479b5520b78ae4002d889f5c21" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/134/fae0e36022eda/rpds_py-0.27.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:134fae0e36022edad8290a6661edf40c023562964efea0cc0ec7f5d392d2aaef" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/eb1/1a4f1b2b63337/rpds_py-0.27.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:eb11a4f1b2b63337cfd3b4d110af778a59aae51c81d195768e353d8b52f88081" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/13e/608ac9f50a0ed/rpds_py-0.27.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:13e608ac9f50a0ed4faec0e90ece76ae33b34c0e8656e3dceb9a7db994c692cd" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/dd2/135527aa40f06/rpds_py-0.27.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dd2135527aa40f061350c3f8f89da2644de26cd73e4de458e79606384f4f68e7" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/302/0724ade63fe32/rpds_py-0.27.1-cp313-cp313t-win32.whl", hash = "sha256:3020724ade63fe320a972e2ffd93b5623227e684315adce194941167fee02688" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/8ee/50c3e41739886/rpds_py-0.27.1-cp313-cp313t-win_amd64.whl", hash = "sha256:8ee50c3e41739886606388ba3ab3ee2aae9f35fb23f833091833255a31740797" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/acb/9aafccaae278f/rpds_py-0.27.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:acb9aafccaae278f449d9c713b64a9e68662e7799dbd5859e2c6b3c67b56d334" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/b7f/b801aa7f845dd/rpds_py-0.27.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b7fb801aa7f845ddf601c49630deeeccde7ce10065561d92729bfe81bd21fb33" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/fe0/dd05afb46597b/rpds_py-0.27.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe0dd05afb46597b9a2e11c351e5e4283c741237e7f617ffb3252780cca9336a" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/b6d/fb0e058adb12d/rpds_py-0.27.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b6dfb0e058adb12d8b1d1b25f686e94ffa65d9995a5157afe99743bf7369d62b" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ed0/90ccd235f6fa8/rpds_py-0.27.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed090ccd235f6fa8bb5861684567f0a83e04f52dfc2e5c05f2e4b1309fcf85e7" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/bf8/76e79763eecf3/rpds_py-0.27.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bf876e79763eecf3e7356f157540d6a093cef395b65514f17a356f62af6cc136" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/12e/d005216a51b1d/rpds_py-0.27.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12ed005216a51b1d6e2b02a7bd31885fe317e45897de81d86dcce7d74618ffff" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ee4/308f409a40e50/rpds_py-0.27.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:ee4308f409a40e50593c7e3bb8cbe0b4d4c66d1674a316324f0c2f5383b486f9" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/0b0/8d152555acf1f/rpds_py-0.27.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0b08d152555acf1f455154d498ca855618c1378ec810646fcd7c76416ac6dc60" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/dce/51c828941973a/rpds_py-0.27.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:dce51c828941973a5684d458214d3a36fcd28da3e1875d659388f4f9f12cc33e" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/c14/76d6f29eb81aa/rpds_py-0.27.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:c1476d6f29eb81aa4151c9a31219b03f1f798dc43d8af1250a870735516a1212" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/3ce/0cac322b0d69b/rpds_py-0.27.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:3ce0cac322b0d69b63c9cdb895ee1b65805ec9ffad37639f291dd79467bee675" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/dfb/fac137d2a3d07/rpds_py-0.27.1-cp314-cp314-win32.whl", hash = "sha256:dfbfac137d2a3d0725758cd141f878bf4329ba25e34979797c89474a89a8a3a3" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a6e/57b0abfe7cc51/rpds_py-0.27.1-cp314-cp314-win_amd64.whl", hash = "sha256:a6e57b0abfe7cc513450fcf529eb486b6e4d3f8aee83e92eb5f1ef848218d456" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/faf/8d146f3d476ab/rpds_py-0.27.1-cp314-cp314-win_arm64.whl", hash = "sha256:faf8d146f3d476abfee026c4ae3bdd9ca14236ae4e4c310cbd1cf75ba33d24a3" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/ba8/1d2b56b6d4911/rpds_py-0.27.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:ba81d2b56b6d4911ce735aad0a1d4495e808b8ee4dc58715998741a26874e7c2" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/84f/7d509870098de/rpds_py-0.27.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:84f7d509870098de0e864cad0102711c1e24e9b1a50ee713b65928adb22269e4" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/a9e/960fc78fecd11/rpds_py-0.27.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9e960fc78fecd1100539f14132425e1d5fe44ecb9239f8f27f079962021523e" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/62f/85b665cedab1a/rpds_py-0.27.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:62f85b665cedab1a503747617393573995dac4600ff51869d69ad2f39eb5e817" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/fed/467af29776f65/rpds_py-0.27.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fed467af29776f6556250c9ed85ea5a4dd121ab56a5f8b206e3e7a4c551e48ec" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/f27/29615f9d430af/rpds_py-0.27.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2729615f9d430af0ae6b36cf042cb55c0936408d543fb691e1a9e36648fd35a" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/1b2/07d881a9aef7b/rpds_py-0.27.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b207d881a9aef7ba753d69c123a35d96ca7cb808056998f6b9e8747321f03b8" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/639/fd5efec029f99/rpds_py-0.27.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:639fd5efec029f99b79ae47e5d7e00ad8a773da899b6309f6786ecaf22948c48" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/fec/c80cb2a90e28a/rpds_py-0.27.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fecc80cb2a90e28af8a9b366edacf33d7a91cbfe4c2c4544ea1246e949cfebeb" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/42a/89282d711711d/rpds_py-0.27.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:42a89282d711711d0a62d6f57d81aa43a1368686c45bc1c46b7f079d55692734" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/cf9/931f14223de59/rpds_py-0.27.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:cf9931f14223de59551ab9d38ed18d92f14f055a5f78c1d8ad6493f735021bbb" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/f39/f58a27cc6e59f/rpds_py-0.27.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f39f58a27cc6e59f432b568ed8429c7e1641324fbe38131de852cd77b2d534b0" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/d5f/a0ee122dc09e2/rpds_py-0.27.1-cp314-cp314t-win32.whl", hash = "sha256:d5fa0ee122dc09e23607a28e6d7b150da16c662e66409bbe85230e4c85bb528a" }, + { url = "http://devpi.iepai.fun/root/pypi/+f/656/7d2bb951e2123/rpds_py-0.27.1-cp314-cp314t-win_amd64.whl", hash = "sha256:6567d2bb951e21232c2f660c24cf3470bb96de56cdcb3f071a83feeaff8a2772" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/8db/ca0739d487e5b/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/7ec/fff8f2fd72616/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686" }, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/f43/24edc670a0f49/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/2f6/da418d1f1e0fd/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2" }, +] + +[[package]] +name = "sse-starlette" +version = "3.0.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/ccd/60b5765ebb358/sse_starlette-3.0.2.tar.gz", hash = "sha256:ccd60b5765ebb3584d0de2d7a6e4f745672581de4f5005ab31c3a25d10b52b3a" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/16b/7cbfddbcd4eac/sse_starlette-3.0.2-py3-none-any.whl", hash = "sha256:16b7cbfddbcd4eaca11f7b586f3b8a080f1afe952c15813455b162edea619e5a" }, +] + +[[package]] +name = "starlette" +version = "0.48.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/7e8/cee469a8ab235/starlette-0.48.0.tar.gz", hash = "sha256:7e8cee469a8ab2352911528110ce9088fdc6a37d9876926e73da7ce4aa4c7a46" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/076/4ca97b0975825/starlette-0.48.0-py3-none-any.whl", hash = "sha256:0764ca97b097582558ecb498132ed0c7d942f233f365b86ba37770e026510659" }, +] + +[[package]] +name = "typer" +version = "0.19.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, + { name = "typing-extensions" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/9ad/824308ded0ad0/typer-0.19.2.tar.gz", hash = "sha256:9ad824308ded0ad06cc716434705f691d4ee0bfd0fb081839d2e426860e7fdca" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/755/e7e19670ffad8/typer-0.19.2-py3-none-any.whl", hash = "sha256:755e7e19670ffad8283db353267cb81ef252f595aa6834a0d1ca9312d9326cb9" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/0ce/a48d173cc12fa/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/f0f/a19c6845758ab/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/ba5/61c48a67c5958/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/4ed/1cacbdc298c22/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7" }, +] + +[[package]] +name = "uvicorn" +version = "0.37.0" +source = { registry = "http://devpi.iepai.fun/lzwc/dev/+simple/" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "http://devpi.iepai.fun/root/pypi/+f/411/5c8add6d3fd53/uvicorn-0.37.0.tar.gz", hash = "sha256:4115c8add6d3fd536c8ee77f0e14a7fd2ebba939fed9b02583a97f80648f9e13" } +wheels = [ + { url = "http://devpi.iepai.fun/root/pypi/+f/913/b2b8867234373/uvicorn-0.37.0-py3-none-any.whl", hash = "sha256:913b2b88672343739927ce381ff9e2ad62541f9f8289664fa1d1d3803fa2ce6c" }, +] diff --git a/lzwcai_mcpskills_analyzeOrder/main.py b/lzwcai_mcpskills_analyzeOrder/main.py new file mode 100644 index 0000000..015f7d0 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/main.py @@ -0,0 +1,13 @@ +""" +Entry point for lzwcai-mcpskills-analyzeOrder +Runs the MCP server for SQL query execution +""" +import os + +os.environ["databaseId"] = "19" +os.environ["datasourceId"] = "19" +os.environ["backendBaseUrl"] = "http://192.168.11.24:8088" +if __name__ == "__main__": + # Import and run the actual MCP server + from lzwcai_mcpskills_analyzeOrder.main import main + main() diff --git a/lzwcai_mcpskills_analyzeOrder/manufacturing_data_model_v1.0.0.md b/lzwcai_mcpskills_analyzeOrder/manufacturing_data_model_v1.0.0.md new file mode 100644 index 0000000..02b9ec4 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/manufacturing_data_model_v1.0.0.md @@ -0,0 +1,1094 @@ +# manufacturing_data_model_v1.0.0 + +## 需求概述 + +本模型基于 `module/` 目录下 52 份业务导出 Excel,面向制造企业端到端经营与生产分析(线索→商机→合同→订单→采购/生产→入出库→质检→开票/收付款/核销→资金流→分佣),抽象形成可扩展的分析型数据模型。 + +设计目标: + +- 兼容 ISA-95 / IEC 62264:区分 Level 3(生产执行)与 Level 4(经营管理)数据边界 +- 分析型优先:星型模型 + 事实星座(Conformed Dimensions) +- 主数据一致性:维度表按 SCD Type 2 管理(`RowValidFrom/RowValidTo/IsCurrent`) +- 事务可追溯:事实表以 `EventTimeUTC` 作为事件时间分区/水印字段 + +范围说明: + +- 当前 Excel 以“编号/名称”作为主要业务键(例如 `产品编码`、`合同编号`、`工单编号`)。分析层统一引入代理主键 `{Entity}Id`。 +- 多数单据缺少“行明细”粒度(例如销售订单/采购订单仅见单头字段),模型保留单头事实为主,后续如补充明细可平滑扩展。 + +## 术语表 + +| 术语 | 含义 | +|---|---| +| 业务键(Business Key) | 来自源系统的编码/编号/单号等唯一标识,如 `ProductCode`、`ContractNumber` | +| 代理键(Surrogate Key) | 分析层自增/雪花主键,如 `ProductId` | +| SCD Type 2 | 维度历史保留:通过 `RowValidFrom/RowValidTo/IsCurrent` 记录有效期 | +| 退化维度(Degenerate Dimension) | 直接保存在事实表中的单据号、状态等维度属性 | +| EventTimeUTC | 统一事件时间(UTC),作为事实表分区/增量水印字段 | + +## 主题域总览(ISA-95 视角) + +| 主题域 | ISA-95 层级 | 覆盖 Excel | +|---|---|---| +| 主数据(产品/BOM/工艺/资源) | L3/L4 共用 | 产品列表、物料清单、工艺路线、工序、仓库、供应商、客户、设备、质检原因 | +| 生产执行 | Level 3 | 工单、任务、报工、装配工单 | +| 质量 | Level 3 | 质检记录、质检不通过原因 | +| 库存与仓储作业 | Level 3 | 出入库明细、盘点、调拨、其他出入库、报废 | +| 销售与履约 | Level 4 | 销售报价、销售订单、销售出库、销售退货 | +| 采购与供应 | Level 4 | 采购申请、采购订单、采购入库、采购退货 | +| 财务与资金 | Level 4 | 发票、回款、收款/付款、预收/预付、核销、资金流向、资金转账、其他收支、分佣 | +| CRM(市场到合同) | Level 4 | 线索、商机、合同 | + +## 实体清单(维度/事实) + +维度(SCD2): + +- `DimPerson`(人员维度) +- `DimProduct`(产品维度) +- `DimCustomer`(客户维度) +- `DimSupplier`(供应商维度) +- `DimWarehouse`(仓库维度) +- `DimBom`(物料清单维度) +- `DimRouting`(工艺路线维度) +- `DimOperation`(工序维度) +- `DimEquipment`(设备维度) +- `DimQcReason`(质检不通过原因维度) +- `DimContract`(合同维度,可选:合同也可作为事实) + +事实(按 `EventTimeUTC` 分区): + +- `FactInventoryMovement`(出入库流水事实) +- `FactWorkOrder`(工单事实) +- `FactOperationTask`(工序任务事实) +- `FactLaborReport`(报工事实) +- `FactQualityInspection`(质检事实) +- `FactSalesOrder`(销售订单事实) +- `FactSalesShipment`(销售出库事实) +- `FactSalesReturn`(销售退货事实) +- `FactPurchaseRequest`(采购申请事实) +- `FactPurchaseOrder`(采购订单事实) +- `FactPurchaseReceipt`(采购入库事实) +- `FactPurchaseReturn`(采购退货事实) +- `FactInventoryTransfer`(库存调拨事实) +- `FactInventoryCount`(库存盘点事实) +- `FactScrap`(报废事实) +- `FactArReceipt`(应收收款事实) +- `FactApPayment`(应付付款事实) +- `FactInvoice`(开票申请事实) +- `FactWriteOff`(核销事实) +- `FactCashFlow`(资金流水事实) +- `FactCommission`(分佣事实) +- `FactLead`(线索事实) +- `FactOpportunity`(商机事实) +- `FactProductionPlan`(生产计划/装配工单汇总事实,可选) + +## ER 图(事实星座) + +```mermaid +erDiagram + DimProduct ||--o{ FactInventoryMovement : "by_product (关联产品)" + DimWarehouse ||--o{ FactInventoryMovement : "by_warehouse (关联仓库)" + DimBom ||--o{ FactInventoryMovement : "by_bom (关联BOM)" + DimPerson ||--o{ FactInventoryMovement : "operated_by (操作人)" + + DimProduct ||--o{ FactWorkOrder : "produces (生产产品)" + DimSupplier ||--o{ FactWorkOrder : "outsourced_to (委外供应商)" + DimRouting ||--o{ FactWorkOrder : "uses_routing (使用工艺)" + DimPerson ||--o{ FactWorkOrder : "managed_by (生产主管)" + + DimOperation ||--o{ FactOperationTask : "executes (执行工序)" + DimProduct ||--o{ FactOperationTask : "for_product (关联产品)" + DimPerson ||--o{ FactOperationTask : "worker (执行工人)" + + DimProduct ||--o{ FactLaborReport : "reports_on (报工产品)" + DimOperation ||--o{ FactLaborReport : "at_operation (报工工序)" + DimPerson ||--o{ FactLaborReport : "reported_by (报工人员)" + + DimQcReason ||--o{ FactQualityInspection : "fail_reason (不合格原因)" + DimProduct ||--o{ FactQualityInspection : "inspects (质检产品)" + DimPerson ||--o{ FactQualityInspection : "inspected_by (质检员)" + + DimCustomer ||--o{ FactSalesOrder : "buys (购买)" + DimPerson ||--o{ FactSalesOrder : "sold_by (销售员)" + DimCustomer ||--o{ FactSalesShipment : "receives (收货)" + DimPerson ||--o{ FactSalesShipment : "shipped_by (发货员)" + DimCustomer ||--o{ FactSalesReturn : "returns (退货)" + DimPerson ||--o{ FactSalesReturn : "handled_by (处理人)" + + DimSupplier ||--o{ FactPurchaseOrder : "supplies (供应)" + DimPerson ||--o{ FactPurchaseOrder : "purchased_by (采购员)" + DimSupplier ||--o{ FactPurchaseReceipt : "delivers (送货)" + DimPerson ||--o{ FactPurchaseReceipt : "received_by (收货员)" + DimSupplier ||--o{ FactPurchaseReturn : "takes_back (退回)" + + DimContract ||--o{ FactInvoice : "invoiced_for (开票合同)" + DimContract ||--o{ FactArReceipt : "cash_in (收款合同)" + DimContract ||--o{ FactApPayment : "cash_out (付款合同)" + DimContract ||--o{ FactWriteOff : "writeoff (核销合同)" + DimPerson ||--o{ FactContract : "owned_by (合同负责人)" + DimPerson ||--o{ FactLead : "owned_by (线索负责人)" + DimPerson ||--o{ FactOpportunity : "owned_by (商机负责人)" +``` + +## 业务数据流转全景图 + +本流程图展示了从商机线索到最终产品交付的端到端数据流转过程,以及各环节涉及的关键数据实体。 + +```mermaid +flowchart TD + %% 节点样式定义 + classDef process fill:#e1f5fe,stroke:#01579b,stroke-width:2px; + classDef decision fill:#fff9c4,stroke:#fbc02d,stroke-width:2px; + classDef table fill:#f3e5f5,stroke:#7b1fa2,stroke-width:1px,stroke-dasharray: 5 5; + + %% 1. CRM阶段 + subgraph Stage_CRM [CRM与销售阶段] + direction TB + Node_Lead[("线索处理
In: FactLead
Logic: 线索清洗/转化")]:::process + Node_Opp[("商机确认
In: FactLead
Out: FactOpportunity")]:::process + Decision_Win{商机赢单?}:::decision + Node_Contract[("合同签订
In: FactOpportunity
Out: DimContract")]:::process + Node_SO[("销售订单生成
In: DimContract
Out: FactSalesOrder")]:::process + + Table_Lead[("FactLead")]:::table + Table_Opp[("FactOpportunity")]:::table + Table_SO[("FactSalesOrder")]:::table + end + + %% 2. 计划阶段 + subgraph Stage_Plan [计划与排程阶段] + direction TB + Node_MPS[("主生产计划(MPS)
In: FactSalesOrder
Logic: 需求合并/产能平衡
Out: FactProductionPlan")]:::process + Node_MRP[("MRP运算/BOM展开
In: FactProductionPlan, DimBom
Logic: 净需求计算
Out: FactWorkOrder(Planned)")]:::process + Decision_MakeBuy{自制/外购?}:::decision + Node_PR[("采购申请生成
Out: FactPurchaseRequest")]:::process + + Table_Plan[("FactProductionPlan")]:::table + Table_Bom[("DimBom")]:::table + Table_Stock[("FactInventoryMovement
(当前库存)")]:::table + end + + %% 新增:3. 采购与供应阶段 + subgraph Stage_Procure [采购与供应阶段] + direction TB + Node_PO[("采购订单(PO)
In: FactPurchaseRequest
Out: FactPurchaseOrder")]:::process + Node_Receive[("收货与IQC
Logic: 验收/质检
Out: FactQualityInspection")]:::process + Decision_IQC{IQC合格?}:::decision + Node_Return[("采购退货
Out: FactPurchaseReturn")]:::process + Node_Mat_In[("原材料入库
Logic: 批次录入/更新库存
Out: FactPurchaseReceipt
FactInventoryMovement")]:::process + Node_AP[("应付挂账(AP)
Logic: 三单匹配
Out: FactApPayment")]:::process + + Table_PO[("FactPurchaseOrder")]:::table + Table_Receipt[("FactPurchaseReceipt")]:::table + end + + %% 4. 生产执行阶段 (原 Stage_Make) + subgraph Stage_Make [生产执行阶段] + direction TB + Node_WO_Release[("工单下达
In: FactWorkOrder(Planned)
Logic: 物料齐套/锁定资源
Out: FactWorkOrder(Released)")]:::process + Node_Task[("工序任务派工
In: FactWorkOrder, DimRouting
Out: FactOperationTask")]:::process + Node_Labor[("生产报工
In: FactOperationTask
Logic: 投入/产出/工时记录
Out: FactLaborReport")]:::process + + Table_WO[("FactWorkOrder")]:::table + Table_Task[("FactOperationTask")]:::table + Table_Labor[("FactLaborReport")]:::table + end + + %% 5. 质量与入库阶段 (原 Stage_QC) + subgraph Stage_QC [质量与仓储阶段] + direction TB + Node_QC[("成品检验(FQC)
In: FactLaborReport
Logic: 检验标准比对
Out: FactQualityInspection")]:::process + Decision_Pass{质检合格?}:::decision + Node_Scrap[("报废处理
Logic: 记录不良原因
Out: FactScrap")]:::process + Node_FG_In[("成品入库
In: FactWorkOrder(Closed)
Logic: 更新库存余额
Out: FactInventoryMovement(IN)")]:::process + + Table_QC[("FactQualityInspection")]:::table + Table_Inv[("FactInventoryMovement")]:::table + end + + %% 6. 交付阶段 (原 Stage_Deliver) + subgraph Stage_Deliver [交付阶段] + direction TB + Node_Ship[("销售发货
In: FactSalesOrder, FactInventoryMovement
Logic: 拣货/出库扣减
Out: FactSalesShipment")]:::process + Node_End((交付完成)) + + Table_Ship[("FactSalesShipment")]:::table + end + + %% 新增:7. 财务与资金阶段 + subgraph Stage_Finance [财务与资金阶段] + direction TB + %% AR Flow + Node_Invoice[("销售开票
In: FactSalesShipment
Out: FactInvoice")]:::process + Node_ArRec[("销售收款
Out: FactArReceipt")]:::process + Node_ArOff[("应收核销
Logic: 核销发票与收款
Out: FactWriteOff")]:::process + + %% AP Flow + Node_ApPay[("采购付款
Out: FactApPayment")]:::process + Node_ApOff[("应付核销
Logic: 核销应付与付款
Out: FactWriteOff")]:::process + + %% Cash Flow + Node_Cash[("资金流水
Logic: 账户变动记录
Out: FactCashFlow")]:::process + + Table_Inv[("FactInvoice")]:::table + Table_Ar[("FactArReceipt")]:::table + Table_Ap[("FactApPayment")]:::table + Table_Cash[("FactCashFlow")]:::table + end + + %% 关系连线 + Node_Lead --> Node_Opp + Node_Opp --> Decision_Win + Decision_Win -- Yes --> Node_Contract + Node_Contract --> Node_SO + Node_SO --> Node_MPS + + Node_MPS --> Node_MRP + Node_MRP --> Decision_MakeBuy + Decision_MakeBuy -- 外购 --> Node_PR + Decision_MakeBuy -- 自制 --> Node_WO_Release + + %% 采购流程连线 + Node_PR --> Node_PO + Node_PO --> Node_Receive + Node_Receive --> Decision_IQC + Decision_IQC -- No --> Node_Return + Decision_IQC -- Yes --> Node_Mat_In + Node_Mat_In --> Node_AP + Node_Mat_In --> Node_WO_Release + + Node_WO_Release --> Node_Task + Node_Task --> Node_Labor + Node_Labor --> Node_QC + + Node_QC --> Decision_Pass + Decision_Pass -- No --> Node_Scrap + Decision_Pass -- Yes --> Node_FG_In + + Node_FG_In --> Node_Ship + Node_Ship --> Node_End + + %% 财务流程连线 + Node_Ship --> Node_Invoice + Node_Invoice --> Node_ArRec + Node_ArRec --> Node_ArOff + + Node_AP --> Node_ApPay + Node_ApPay --> Node_ApOff + + Node_ArRec --> Node_Cash + Node_ApPay --> Node_Cash + + %% 数据表关联(虚线) + Table_Lead -.-> Node_Lead + Node_Opp -.-> Table_Opp + Node_Contract -.-> Table_SO + Table_SO -.-> Node_MPS + Node_MPS -.-> Table_Plan + Table_Plan -.-> Node_MRP + Table_Bom -.-> Node_MRP + Table_Stock -.-> Node_MRP + + Node_PR -.-> Table_PO + Node_PO -.-> Table_PO + Node_Mat_In -.-> Table_Receipt + Node_Mat_In -.-> Table_Inv + + Node_WO_Release -.-> Table_WO + Node_Task -.-> Table_Task + Node_Labor -.-> Table_Labor + Node_QC -.-> Table_QC + Node_Receive -.-> Table_QC + Node_FG_In -.-> Table_Inv + Node_Ship -.-> Table_Ship + + Node_Invoice -.-> Table_Inv + Node_ArRec -.-> Table_Ar + Node_ApPay -.-> Table_Ap + Node_Cash -.-> Table_Cash +``` + +### 关键业务规则说明 + +1. **商机转订单**: + * 当 `FactOpportunity` 状态确认为“赢单”且 `DimContract` 签订后,系统生成 `FactSalesOrder`。 + * 此时确立销售对象(Customer)、产品(Product)及交付日期(DeliveryDate)。 + +2. **计划运算 (MPS/MRP)**: + * `FactProductionPlan` 汇总销售订单需求,结合 `FactInventoryMovement` 计算出的当前库存快照,进行净需求计算。 + * 利用 `DimBom` 展开物料清单,区分自制件(生成 `FactWorkOrder`)与采购件(生成 `FactPurchaseRequest`)。 + +3. **采购闭环管理**: + * **采购订单 (PO)**:`FactPurchaseOrder` 经审批后生效,明确供应商、价格、交期。 + * **入库验收 (IQC)**:物料到达后必须进行 IQC(`FactQualityInspection`),合格品方可办理入库(`FactPurchaseReceipt`)并增加库存(`FactInventoryMovement`)。 + * **财务对接 (AP)**:系统自动匹配 PO(采购单)、Receipt(入库单)和供应商发票,生成应付账款(`FactApPayment`),确保“三单一致”。 + * **供应商管理**:IQC 合格率与交期准确率回写至 `DimSupplier`,用于季度评估与优选名录维护。 + +4. **生产执行闭环**: + * 工单下达前需校验物料齐套性(依赖采购入库的 `FactInventoryMovement`)。 + * 现场工人通过 `FactLaborReport` 上报实际投入工时与产出数量,该数据是成本核算的核心依据。 + +5. **质量控制 (FQC)**: + * `FactQualityInspection` 记录成品检验结果。 + * 质检合格触发成品入库,不合格则根据原因(`DimQcReason`)触发返工或报废(`FactScrap`)。 + +6. **库存与交付**: + * 所有实物库存变动(入库、出库、报废)统一写入 `FactInventoryMovement`,确保库存台账的一致性。 + * `FactSalesShipment` 记录发货动作,作为收入确认(Revenue Recognition)的前置事件。 + +7. **财务资金流转**: + * **应收 (AR)**:销售发货后生成发票申请(`FactInvoice`),回款后(`FactArReceipt`)进行核销(`FactWriteOff`)。 + * **应付 (AP)**:采购入库确认应付后(`FactApPayment` 中的挂账状态),执行付款(`FactApPayment` 中的实付)并核销。 + * **资金 (Cash)**:所有收付款动作最终汇总至 `FactCashFlow`,提供实时的资金日记账分析。 + +## 表结构详设 + +类型说明(可按目标数据库微调): + +- `bigint`:代理主键/外键 +- `varchar(n)`:业务键、名称、状态等 +- `decimal(18,4)`:数量与金额(金额可按需要改 `decimal(18,2)`) +- `datetime2`:统一时间字段(UTC) + +### DimPerson(人员维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| PersonId | bigint | N | autoincr | 主键 | | + | PersonCode | varchar(64) | N | | 人员编码(业务键) | 来源:用户ID/工号 | + | PersonName | varchar(255) | N | | 姓名 | | + | Department | varchar(100) | Y | | 部门 | | + | Position | varchar(100) | Y | | 职位/岗位 | | + | Phone | varchar(32) | Y | | 电话 | | + | Email | varchar(100) | Y | | 邮箱 | | + | Status | varchar(20) | Y | | 状态 | ACTIVE, INACTIVE | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | +| Birthday | date | Y | | 出生日期 | | +| Employment_day | date | Y | | 入职日期 | | +| Job_description | varchar(255) | Y | | 职务描述 | | + +### DimProduct(产品维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ProductId | bigint | N | autoincr | 主键 | | + | ProductCode | varchar(64) | N | | 产品编码(业务键) | 来源:产品列表.产品编码 | + | ProductName | varchar(255) | N | | 产品名称 | | + | ProductSpec | varchar(255) | Y | | 产品规格 | | + | ProductCategory | varchar(100) | Y | | 产品类别 | | + | ProductType | varchar(100) | Y | | 产品类型 | | + | UomCode | varchar(16) | Y | | 主单位 | kg,pcs,L,m | + | Brand | varchar(100) | Y | | 品牌 | | + | Origin | varchar(100) | Y | | 产地 | | + | TransportCondition | varchar(100) | Y | | 运输条件 | | + | Barcode | varchar(64) | Y | | 条形码 | | + | DrawingNumber | varchar(64) | Y | | 图号 | | + | Material | varchar(100) | Y | | 材料 | | + | SurfaceTreatment | varchar(100) | Y | | 表面处理 | | + | MinStockQty | decimal(18,4) | Y | | 最低库存数量 | | + | SafetyStockQty | decimal(18,4) | Y | | 安全库存数量 | | + | MaxStockQty | decimal(18,4) | Y | | 最高库存数量 | | + | SourceSystem | varchar(50) | Y | | 数据来源 | 来源:数据来源 | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimCustomer(客户维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| CustomerId | bigint | N | autoincr | 主键 | | + | CustomerName | varchar(255) | N | | 客户名称(业务键) | 来源:客户列表.客户名称 | + | CustomerSource | varchar(100) | Y | | 客户来源 | | + | Phone | varchar(32) | Y | | 手机 | | + | Telephone | varchar(32) | Y | | 电话 | | + | Email | varchar(100) | Y | | 邮箱 | | + | CustomerLevel | varchar(50) | Y | | 客户级别 | | + | Industry | varchar(100) | Y | | 客户行业 | | + | Address | varchar(500) | Y | | 详细地址 | | + | IsLocked | bit | Y | | 锁定状态 | 0,1 | + | DealStatus | varchar(50) | Y | | 成交状态 | | + | LastFollowUpTimeUTC | datetime2 | Y | | 最后跟进时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimSupplier(供应商维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| SupplierId | bigint | N | autoincr | 主键 | | + | SupplierCode | varchar(64) | N | | 供应商编码(业务键) | 来源:供应商列表.供应商编码 | + | SupplierName | varchar(255) | N | | 供应商名称 | | + | SupplierCategory | varchar(100) | Y | | 供应商分类 | | + | SupplierLevel | varchar(50) | Y | | 供应商级别 | | + | Address | varchar(500) | Y | | 地址 | | + | DefaultCurrencyCode | varchar(16) | Y | | 默认币别 | CNY,USD,EUR | + | SettlementTerm | varchar(50) | Y | | 结算期限 | | + | ContractExpiryDateUTC | datetime2 | Y | | 合同到期日(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimWarehouse(仓库维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| WarehouseId | bigint | N | autoincr | 主键 | | + | WarehouseCode | varchar(64) | N | | 仓库编码(业务键) | 来源:仓库列表.仓库编码 | + | WarehouseName | varchar(255) | N | | 仓库名称 | | + | WarehouseType | varchar(50) | Y | | 仓库类型 | | + | Status | varchar(20) | Y | | 仓库状态 | ENABLED,DISABLED | + | Address | varchar(500) | Y | | 仓库地址 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimBom(物料清单维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| BomId | bigint | N | autoincr | 主键 | | + | BomNumber | varchar(64) | N | | 清单编号(业务键) | 来源:物料清单.清单编号 | + | BomTopic | varchar(100) | Y | | 清单主题 | 来源:清单主题 | +| IsPrimary | bit | Y | | 主辅清单标识 | 0,1 | +| LevelNumber | int | Y | | 层级 | | + | ProductCode | varchar(64) | Y | | 关联产品编码 | 来源:产品编号 | + | UnitUsageQty | decimal(18,4) | Y | | 单位用量 | | + | UomCode | varchar(16) | Y | | 产品单位 | | + | SupplierName | varchar(255) | Y | | 默认供应商(退化属性) | 来源:供应商 | +| Remark | varchar(500) | Y | | 备注 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimRouting(工艺路线维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| RoutingId | bigint | N | autoincr | 主键 | | + | RoutingNumber | varchar(64) | N | | 工艺路线编号(业务键) | 来源:工艺路线.工艺路线编号 | + | RoutingName | varchar(255) | N | | 工艺路线名称 | | + | OperationListText | varchar(2000) | Y | | 工序/工艺路线列表(原文) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimOperation(工序维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| OperationId | bigint | N | autoincr | 主键 | | + | OperationNumber | varchar(64) | N | | 工序编号(业务键) | 来源:工序.工序编号 | + | OperationName | varchar(255) | N | | 工序名称 | | + | ReportPermission | varchar(50) | Y | | 报工权限 | | + | ReportRatio | decimal(18,6) | Y | | 报工数配比 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimEquipment(设备维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| EquipmentId | bigint | N | autoincr | 主键 | | + | EquipmentNumber | varchar(64) | N | | 设备编号(业务键) | 来源:设备.设备编号 | + | EquipmentName | varchar(255) | N | | 设备名称 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimQcReason(质检不通过原因维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| QcReasonId | bigint | N | autoincr | 主键 | | + | QcReasonNumber | varchar(64) | N | | 不通过原因编号(业务键) | 来源:质检原因.不通过原因编号 | + | QcReasonName | varchar(255) | N | | 不通过原因 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### DimContract(合同维度) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ContractId | bigint | N | autoincr | 主键 | | + | ContractNumber | varchar(64) | N | | 合同编号(业务键) | 来源:合同.合同编号 | + | ContractName | varchar(255) | Y | | 合同名称 | | + | OwnerId | bigint | Y | | 负责人 (外键 → DimPerson) | | + | CustomerName | varchar(255) | Y | | 客户名称(退化) | | + | CustomerId | bigint | Y | | 关联客户(外键 → DimCustomer) | | + | ContractAmount | decimal(18,4) | Y | | 合同金额 | | + | OrderTimeUTC | datetime2 | Y | | 下单时间(UTC) | | +| PaidAmount | decimal(18,4) | Y | | 回款金额 | | +| UnpaidAmount | decimal(18,4) | Y | | 未回款金额 | | +| Stage | varchar(50) | Y | | 当前阶段 | | +| Result | varchar(50) | Y | | 结果 | | + | ContractType | varchar(50) | Y | | 合同类型 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| RowValidFrom | datetime2 | N | | SCD2 生效时间(UTC) | | +| RowValidTo | datetime2 | N | | SCD2 失效时间(UTC) | | +| IsCurrent | bit | N | 1 | 是否当前版本 | 0,1 | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactInventoryMovement(出入库流水事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| InventoryMovementId | bigint | N | autoincr | 主键 | | + | EventTimeUTC | datetime2 | N | | 出入库事件时间(UTC) | 来源:出入库日期/入库时间/出库时间 | + | ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | + | WarehouseId | bigint | Y | | 关联DimWarehouse (外键 → DimWarehouse) | | + | BomId | bigint | Y | | 关联DimBom (外键 → DimBom) | | +| OperatorId | bigint | Y | | 外键 → DimPerson(操作人) | | +|SalesOrderId | bigint | Y | | 关联FactSalesOrder (外键 → FactSalesOrder) | | +|PurchaseOrderId | bigint | Y | | 关联FactPurchaseOrder (外键 → FactPurchaseOrder) | | + | DocNumber | varchar(64) | N | | 出入库单号 | 来源:出入库单号/入库单编号/出库单编号 | + | DocType | varchar(30) | N | | 单据类型 | IN,OUT,TRANSFER,OTHER_IN,OTHER_OUT | + | MovementQty | decimal(18,4) | N | 0 | 出入库数量(入为正,出为负) | | +| UomCode | varchar(16) | Y | | 单位 | | +| UnitPrice | decimal(18,4) | Y | | 单价 | | +| DiscountUnitPrice | decimal(18,4) | Y | | 折后单价 | | +| Amount | decimal(18,4) | Y | | 总价 | | +| DiscountAmount | decimal(18,4) | Y | | 折后总价 | | +| OnhandQtyAfter | decimal(18,4) | Y | | 发生后库存量(源字段) | | +| ResponsiblePerson | varchar(100) | Y | | 负责人 | | +| AuditStatus | varchar(20) | Y | | 审核状态 | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactWorkOrder(工单事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| WorkOrderId | bigint | N | autoincr | 主键 | | + | WorkOrderNumber | varchar(64) | N | | 工单编号(退化维度) | 来源:工单编号 | + | ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | +| SupplierId | bigint | Y | | 外键 → DimSupplier(委外时) | | +| RoutingId | bigint | Y | | 外键 → DimRouting | | +| ProductionManagerId | bigint | Y | | 外键 → DimPerson(生产主管) | | + | PlannedQty | decimal(18,4) | Y | | 计划生产数 | | + | CompletedQty | decimal(18,4) | Y | | 完成数 | | +| OperationGoodQty | decimal(18,4) | Y | | 工序良品数 | | +| OperationBadQty | decimal(18,4) | Y | | 工序不良品数 | | +| QcGoodQty | decimal(18,4) | Y | | 工单质检良品数 | | +| QcBadQty | decimal(18,4) | Y | | 工单质检不良品数 | | + | Status | varchar(30) | Y | | 工单状态 | OPEN,STARTED,CLOSED,SCRAP | + | EventTimeUTC | datetime2 | N | | 工单状态变更/抽取时间(UTC) | | +| SourceDocNumber | varchar(64) | Y | | 单据编号(退化) | 来源:单据编号 | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactOperationTask(工序任务事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| OperationTaskId | bigint | N | autoincr | 主键 | | +| WorkOrderNumber | varchar(64) | N | | 工单编号(退化维度) | 来源:工单编号 | +| OperationId | bigint | Y | | 关联DimOperation (外键 → DimOperation) | | +| ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | +| PlannedStartTimeUTC | datetime2 | Y | | 计划开始时间(UTC) | | +| PlannedEndTimeUTC | datetime2 | Y | | 计划结束时间(UTC) | | +| ActualStartTimeUTC | datetime2 | Y | | 实际开始时间(UTC) | | +| ActualEndTimeUTC | datetime2 | Y | | 实际结束时间(UTC) | | +| PlannedQty | decimal(18,4) | Y | | 计划数 | | +| GoodQty | decimal(18,4) | Y | | 良品数 | | +| BadQty | decimal(18,4) | Y | | 不良品数 | | +| BadReasonText | varchar(500) | Y | | 不良品项(原文) | | +| EventTimeUTC | datetime2 | N | | 任务事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactLaborReport(报工事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| LaborReportId | bigint | N | autoincr | 主键 | | + | WorkOrderNumber | varchar(64) | N | | 工单(退化维度) | 来源:报工列表.工单 | +| TaskName | varchar(255) | Y | | 任务(退化维度) | 来源:报工列表.任务 | + | ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | +| OperationStatus | varchar(30) | Y | | 工序状态 | | + | WorkerName | varchar(100) | Y | | 生产人员 | | + | ReportQty | decimal(18,4) | N | 0 | 报工数 | | + | GoodQty | decimal(18,4) | Y | | 良品数 | | + | BadQty | decimal(18,4) | Y | | 良品数 | | +| DurationMinutes | decimal(18,2) | Y | | 报工时长(分钟) | | +| UomCode | varchar(16) | Y | | 单位 | | +| BadReasonText | varchar(500) | Y | | 不良品项(原文) | | + | EventTimeUTC | datetime2 | N | | 报工事件时间(UTC) | | +| SupplierId | bigint | Y | | 外键 → DimSupplier(委外时) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactQualityInspection(质检事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| QualityInspectionId | bigint | N | autoincr | 主键 | | + | InspectionNumber | varchar(64) | N | | 质检记录编号(退化维度) | 来源:质检记录编号 | +| InspectionBatchNumber | varchar(64) | Y | | 质检批次号 | | + | WorkOrderNumber | varchar(64) | Y | | 工单(退化维度) | | + | ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | +| SupplierId | bigint | Y | | 外键 → DimSupplier | | +| QcReasonId | bigint | Y | | 外键 → DimQcReason(不通过原因) | | + | InspectorId | bigint | Y | | 质检员 (外键 → DimPerson) | | +| QcType | varchar(30) | Y | | 质检类型 | IN_PROCESS,FINAL,INCOMING | + | PassQty | decimal(18,4) | Y | | 通过数 | | + | FailQty | decimal(18,4) | Y | | 不通过数 | | +| SalesOrderNumber | varchar(64) | Y | | 销售订单(退化维度) | | +| CustomerName | varchar(255) | Y | | 客户(退化维度) | | +| ShipQty | decimal(18,4) | Y | | 发货数 | | + | EventTimeUTC | datetime2 | N | | 质检事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactSalesOrder(销售订单事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| SalesOrderId | bigint | N | autoincr | 主键 | | + | SalesOrderNumber | varchar(64) | N | | 订单编号(退化维度) | 来源:销售订单.订单编号 | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | SalesPersonId | bigint | Y | | 关联销售员 (外键 → DimPerson) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化维度) | | + | ContractId | bigint | Y | | 关联合同 (外键 → DimContract) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | + | OrderDateUTC | datetime2 | Y | | 订单单据日期(UTC) | | +| DeliveryDateUTC | datetime2 | Y | | 交货日期(UTC) | | + | DealAmount | decimal(18,4) | Y | | 成交金额 | | +| PaymentStatus | varchar(30) | Y | | 收款状态/付款状态 | | +| TransportMode | varchar(50) | Y | | 运输方式 | | +| Packaging | varchar(100) | Y | | 包材 | | +| CustomsNumber | varchar(64) | Y | | 报关单号 | | +| ProductionDocNumber | varchar(64) | Y | | 生产单据编号 | | +| Stage | varchar(50) | Y | | 当前阶段 | | + | Result | varchar(50) | Y | | 结果 | | + | EventTimeUTC | datetime2 | N | | 订单事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactSalesShipment(销售出库事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| SalesShipmentId | bigint | N | autoincr | 主键 | | + | ShipmentNumber | varchar(64) | N | | 出库单编号(退化维度) | 来源:销售出库单.出库单编号 | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | SalesPersonId | bigint | Y | | 关联销售员 (外键 → DimPerson) | | +| OperatorId | bigint | Y | | 外键 → DimPerson(发货员) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化维度) | | + | ContractId | bigint | Y | | 关联合同 (外键 → DimContract) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | + | DocDateUTC | datetime2 | Y | | 出库单单据日期(UTC) | | +| DeliveryDateUTC | datetime2 | Y | | 交货日期(UTC) | | +| TransportMode | varchar(50) | Y | | 运输方式 | | +| CustomsNumber | varchar(64) | Y | | 报关单号 | | + | Amount | decimal(18,4) | Y | | 成交金额/单据金额 | | + | EventTimeUTC | datetime2 | N | | 出库事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactSalesReturn(销售退货事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| SalesReturnId | bigint | N | autoincr | 主键 | | + | SalesReturnNumber | varchar(64) | N | | 销售退货单编号(退化维度) | | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | SalesPersonId | bigint | Y | | 销售员 (外键 → DimPerson) | | +| OperatorId | bigint | Y | | 外键 → DimPerson(处理人) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化维度) | | +| ReturnReason | varchar(255) | Y | | 退货原因 | | +| IsReship | bit | Y | | 是否退货重发 | 0,1 | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | +| DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | + | Amount | decimal(18,4) | Y | | 单据金额 | | + | EventTimeUTC | datetime2 | N | | 退货事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactPurchaseRequest(采购申请事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| PurchaseRequestId | bigint | N | autoincr | 主键 | | + | PurchaseRequestNumber | varchar(64) | N | | 采购申请单编号(退化维度) | | + | SupplierId | bigint | Y | | 建议供应商 (外键 → DimSupplier) | | + | ApplicantId | bigint | Y | | 申请人 (外键 → DimPerson) | | + | CurrencyCode | varchar(16) | Y | | 币别 | | + | FxRate | decimal(18,6) | Y | | 汇率 | | + | DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | + | DeliveryDateUTC | datetime2 | Y | | 交货日期(UTC) | | + | TotalAmount | decimal(18,4) | Y | | 采购总价 | | + | Status | varchar(30) | Y | | 采购状态 | | + | RelatedOrderNumber | varchar(64) | Y | | 订单编号(退化) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化) | | + | EventTimeUTC | datetime2 | N | | 采购申请事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactPurchaseOrder(采购订单事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| PurchaseOrderId | bigint | N | autoincr | 主键 | | + | PurchaseOrderNumber | varchar(64) | N | | 采购订单编号(退化维度) | | + | SupplierId | bigint | Y | | 关联DimSupplier (外键 → DimSupplier) | | + | BuyerId | bigint | Y | | 关联采购员 (外键 → DimPerson) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | + | DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | +| DeliveryDateUTC | datetime2 | Y | | 交货日期(UTC) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化) | | + | ContractId | bigint | Y | | 关联合同 (外键 → DimContract) | | +| DeliveryNoteNumber | varchar(64) | Y | | 送货单号 | | +| SettlementDateUTC | datetime2 | Y | | 结算日期(UTC) | | +| SettlementTerm | varchar(50) | Y | | 结算期限 | | + | EventTimeUTC | datetime2 | N | | 采购订单事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactPurchaseReceipt(采购入库事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| PurchaseReceiptId | bigint | N | autoincr | 主键 | | + | PurchaseReceiptNumber | varchar(64) | N | | 采购入库单编号(退化维度) | | + | SupplierId | bigint | Y | | 关联DimSupplier (外键 → DimSupplier) | | +| BuyerId | bigint | Y | | 外键 → DimPerson(采购员) | | +| OperatorId | bigint | Y | | 外键 → DimPerson(收货员) | | + | PurchaseOrderNumber | varchar(64) | Y | | 采购订单(退化维度) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | +| DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | +| DeliveryDateUTC | datetime2 | Y | | 交货日期(UTC) | | +| ContractNumber | varchar(64) | Y | | 合同编号(退化) | | + | Amount | decimal(18,4) | Y | | 成交金额 | | +| EstimatedCost | decimal(18,4) | Y | | 预计采购费用 | | +| ReceiptQtyTotal | decimal(18,4) | Y | | 入库总数 | | +| PaidAmount | decimal(18,4) | Y | | 已付款金额 | | +| UnpaidAmount | decimal(18,4) | Y | | 未付款金额 | | +| PaymentStatus | varchar(30) | Y | | 付款状态 | | +| ReturnedQty | decimal(18,4) | Y | | 已退货数 | | +| NotReturnedQty | decimal(18,4) | Y | | 未退货数 | | +| ReturnStatus | varchar(30) | Y | | 退货状态 | | + | EventTimeUTC | datetime2 | N | | 入库事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactPurchaseReturn(采购退货事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| PurchaseReturnId | bigint | N | autoincr | 主键 | | + | PurchaseReturnNumber | varchar(64) | N | | 采购退货单编号(退化维度) | | + | SupplierId | bigint | Y | | 关联DimSupplier (外键 → DimSupplier) | | + | BuyerId | bigint | Y | | 采购员 (外键 → DimPerson) | | + | OperatorId | bigint | Y | | 处理人 (外键 → DimPerson) | | + | CurrencyCode | varchar(16) | Y | | 币别 | | + | FxRate | decimal(18,6) | Y | | 汇率 | | + | DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | + | ReturnReason | varchar(255) | Y | | 退货原因 | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化) | | + | RelatedOrderNumber | varchar(64) | Y | | 订单号(退化) | | + | EventTimeUTC | datetime2 | N | | 退货事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactInventoryTransfer(库存调拨事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| InventoryTransferId | bigint | N | autoincr | 主键 | | + | TransferNumber | varchar(64) | N | | 调拨单编号(退化维度) | | + | OperatorId | bigint | Y | | 操作人 (外键 → DimPerson) | | + | TransferName | varchar(255) | Y | | 调拨名称 | | + | Tag | varchar(100) | Y | | 单据标签 | | + | TransferTimeUTC | datetime2 | Y | | 调拨时间(UTC) | | + | PlateNumber | varchar(32) | Y | | 车牌号 | | + | DeliveryMode | varchar(50) | Y | | 交货方式 | | + | EventTimeUTC | datetime2 | N | | 调拨事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactInventoryCount(库存盘点事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| InventoryCountId | bigint | N | autoincr | 主键 | | + | CountNumber | varchar(64) | N | | 盘点编号(退化维度) | | + | OperatorId | bigint | Y | | 盘点人 (外键 → DimPerson) | | + | WarehouseName | varchar(255) | Y | | 盘点仓库(退化) | | + | CountName | varchar(255) | Y | | 盘点名称 | | + | CountTimeUTC | datetime2 | Y | | 盘点时间(UTC) | | + | EventTimeUTC | datetime2 | N | | 盘点事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactScrap(报废事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ScrapId | bigint | N | autoincr | 主键 | | + | ScrapNumber | varchar(64) | N | | 报废编号(退化维度) | | + | OperatorId | bigint | Y | | 操作人 (外键 → DimPerson) | | + | WarehouseName | varchar(255) | Y | | 仓库(退化) | | + | ScrapTimeUTC | datetime2 | Y | | 报废日期(UTC) | | + | EventTimeUTC | datetime2 | N | | 报废事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactArReceipt(应收收款事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ArReceiptId | bigint | N | autoincr | 主键 | | + | DocNumber | varchar(64) | N | | 单据编号(退化维度) | 来源:收款单/回款/预收/其他收入等 | + | DocType | varchar(30) | N | | 单据类型 | RECEIPT,REFUND,ADVANCE,ADVANCE_REFUND,OTHER_INCOME | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | ContractId | bigint | Y | | 关联DimContract (外键 → DimContract) | | +| DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | + | Amount | decimal(18,4) | Y | | 收款总金额/回款金额/应收金额 | | +| AmountBase | decimal(18,4) | Y | | 本位币金额 | 来源:本位币字段 | +| FeeAmount | decimal(18,4) | Y | | 手续费 | | +| DiscountAmount | decimal(18,4) | Y | | 优惠金额 | | +| WriteOffAmount | decimal(18,4) | Y | | 核销总金额 | | +| WrittenOffAmount | decimal(18,4) | Y | | 已核销金额 | | +| UnwrittenOffAmount | decimal(18,4) | Y | | 未核销金额 | | +| RelatedDocNumber | varchar(64) | Y | | 关联单编号/销售订单编号 | | + | EventTimeUTC | datetime2 | N | | 收款事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactApPayment(应付付款事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ApPaymentId | bigint | N | autoincr | 主键 | | + | DocNumber | varchar(64) | N | | 单据编号(退化维度) | 来源:付款单/预付款/其他支出等 | + | DocType | varchar(30) | N | | 单据类型 | PAYMENT,REFUND,ADVANCE,ADVANCE_REFUND,OTHER_EXPENSE | + | SupplierId | bigint | Y | | 关联DimSupplier (外键 → DimSupplier) | | + | ContractId | bigint | Y | | 关联DimContract (外键 → DimContract) | | +| DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | +| CurrencyCode | varchar(16) | Y | | 币别 | | +| FxRate | decimal(18,6) | Y | | 汇率 | | + | Amount | decimal(18,4) | Y | | 付款总金额/应付金额 | | +| AmountBase | decimal(18,4) | Y | | 本位币金额 | | +| FeeAmount | decimal(18,4) | Y | | 手续费 | | +| DiscountAmount | decimal(18,4) | Y | | 优惠金额 | | +| WriteOffAmount | decimal(18,4) | Y | | 核销总金额 | | +| WrittenOffAmount | decimal(18,4) | Y | | 已核销金额 | | +| UnwrittenOffAmount | decimal(18,4) | Y | | 未核销金额 | | +| RelatedDocNumber | varchar(64) | Y | | 关联单编号/采购订单编号 | | + | EventTimeUTC | datetime2 | N | | 付款事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactInvoice(开票申请事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| InvoiceId | bigint | N | autoincr | 主键 | | + | InvoiceRequestNumber | varchar(64) | N | | 发票申请编号(退化维度) | 来源:发票申请编号 | + | ContractId | bigint | Y | | 关联DimContract (外键 → DimContract) | | + | ContractNumber | varchar(64) | Y | | 合同编号(退化维度) | | +| HandlerId | bigint | Y | | 外键 → DimPerson(经办人) | | +| CustomerId | bigint | Y | | 外键 → DimCustomer | | + | InvoiceAmount | decimal(18,4) | Y | | 开票金额 | | +| ContractAmount | decimal(18,4) | Y | | 合同金额 | | + | InvoiceDateUTC | datetime2 | Y | | 开票日期(UTC) | | + | ActualInvoiceDateUTC | datetime2 | Y | | 开票日期(UTC) | | +| InvoiceType | varchar(50) | Y | | 开票类型 | | +| Stage | varchar(50) | Y | | 当前阶段 | | +| Result | varchar(50) | Y | | 结果 | | + | EventTimeUTC | datetime2 | N | | 开票事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactWriteOff(核销事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| WriteOffId | bigint | N | autoincr | 主键 | | + | WriteOffNumber | varchar(64) | N | | 核销单编号(退化维度) | 来源:核销单编号 | + | DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | + | ContractId | bigint | Y | | 关联DimContract (外键 → DimContract) | | + | HandlerId | bigint | Y | | 经办人 (外键 → DimPerson) | | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | SupplierId | bigint | Y | | 关联DimSupplier (外键 → DimSupplier) | | + | WriteOffType | varchar(30) | Y | | 核销类型 | AR,AP | + | CurrencyCode | varchar(16) | Y | | 币别 | | + | FxRate | decimal(18,6) | Y | | 汇率 | | + | DiscountAmount | decimal(18,4) | Y | | 优惠金额 | | + | WriteOffAmount | decimal(18,4) | Y | | 核销总金额 | | + | EventTimeUTC | datetime2 | N | | 核销事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactCashFlow(资金流水事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| CashFlowId | bigint | N | autoincr | 主键 | | + | DocNumber | varchar(64) | Y | | 单据编号(退化维度) | 来源:资金流向.单据编号/转账单编号 | + | DocType | varchar(30) | N | | 单据类型 | CASHFLOW,TRANSFER | + | AccountName | varchar(255) | Y | | 账户名称 | | + | DocDateUTC | datetime2 | Y | | 单据日期(UTC) | | + | BusinessType | varchar(100) | Y | | 业务类型 | | + | IncomeAmount | decimal(18,4) | Y | | 收入 | | + | ExpenseAmount | decimal(18,4) | Y | | 支出 | | + | BalanceAmount | decimal(18,4) | Y | | 余额 | | + | Counterparty | varchar(255) | Y | | 往来单位 | | + | Remark | varchar(500) | Y | | 单据备注 | | + | EventTimeUTC | datetime2 | N | | 资金事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactCommission(分佣事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| CommissionId | bigint | N | autoincr | 主键 | | + | CommissionPerson | varchar(100) | N | | 分佣人 | | + | Department | varchar(100) | Y | | 部门 | | + | CommissionRatePct | decimal(9,4) | Y | | 提成比例(%) | | + | Coefficient | decimal(18,6) | Y | | 系数 | | + | ReceivableCommission | decimal(18,4) | Y | | 应收佣金 | | + | ReceivedCommission | decimal(18,4) | Y | | 实收佣金 | | + | ContractId | bigint | Y | | 关联DimContract (外键 → DimContract) | | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | ProductName | varchar(255) | Y | | 产品名称(退化) | | + | OpportunityName | varchar(255) | Y | | 商机名称(退化) | | + | ContractAmount | decimal(18,4) | Y | | 合同金额 | | + | DealTimeUTC | datetime2 | Y | | 成交时间(UTC) | | + | IsInvoiced | bit | Y | | 是否开票 | 0,1 | + | EventTimeUTC | datetime2 | N | | 分佣事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactLead(线索事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| LeadId | bigint | N | autoincr | 主键 | | + | LeadName | varchar(255) | N | | 线索名称 | | + | OwnerId | bigint | Y | | 负责人 (外键 → DimPerson) | | + | LeadSource | varchar(100) | Y | | 线索来源 | | +| Phone | varchar(32) | Y | | 手机 | | +| Telephone | varchar(32) | Y | | 电话 | | +| Email | varchar(100) | Y | | 邮箱 | | +| Address | varchar(500) | Y | | 地址 | | +| Industry | varchar(100) | Y | | 客户行业 | | +| CustomerLevel | varchar(50) | Y | | 客户级别 | | +| NextContactTimeUTC | datetime2 | Y | | 下次联系时间(UTC) | | +| FollowUpStatus | varchar(50) | Y | | 跟进状态 | | +| IsConverted | bit | Y | | 是否已转化 | 0,1 | +| Stage | varchar(50) | Y | | 当前阶段 | | +| Result | varchar(50) | Y | | 结果 | | + | EventTimeUTC | datetime2 | N | | 线索事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactOpportunity(商机事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| OpportunityId | bigint | N | autoincr | 主键 | | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | OpportunityAmount | decimal(18,4) | Y | | 商机金额 | | + | ExpectedDealDateUTC | datetime2 | Y | | 预计成交日期(UTC) | | +| NextContactTimeUTC | datetime2 | Y | | 下次联系时间(UTC) | | +| StatusGroup | varchar(50) | Y | | 商机状态组 | | +| Stage | varchar(50) | Y | | 当前阶段 | | + | Result | varchar(50) | Y | | 结果 | | + | EventTimeUTC | datetime2 | N | | 商机事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +### FactProductionPlan(生产计划_装配工单汇总事实) +| 字段 | 类型 | 空 | 缺省 | 描述 | 枚举/单位 | +|---|---|---|---|---|---| +| ProductionPlanId | bigint | N | autoincr | 主键 | | + | AssemblyWorkOrderNumber | varchar(64) | N | | 装配工单编号(退化维度) | 来源:装配工单编号 | + | WorkOrderCount | int | Y | | 工单数 | | + | FinishedCount | int | Y | | 已结束数 | | + | PlannedQty | decimal(18,4) | Y | | 计划数 | | + | CompletedQty | decimal(18,4) | Y | | 完工数 | | + | PlanStatus | varchar(50) | Y | | 生产计划状态 | | + | ProgressText | varchar(100) | Y | | 工单生成/用料生成/单据进度(原文) | | + | CustomerName | varchar(255) | Y | | 客户(退化) | | + | CustomerId | bigint | Y | | 关联DimCustomer (外键 → DimCustomer) | | + | ProductId | bigint | Y | | 关联DimProduct (外键 → DimProduct) | | + | SalesOrderId | bigint | Y | | 关联FactSalesOrder (外键 → FactSalesOrder) | | + | EventTimeUTC | datetime2 | N | | 计划事件时间(UTC) | | +| SourceSystem | varchar(50) | Y | | 数据来源 | | +| LastUpdatedUTC | datetime2 | N | sysutcdatetime | 行级更新时间 | | + +## KPI 映射(示例) + +| KPI | 口径 | 表/字段 | +|---|---|---| +| 报工良率 | `sum(GoodQty) / nullif(sum(ReportQty),0)` | `FactLaborReport.GoodQty/ReportQty` | +| 质检良率 | `sum(PassQty) / nullif(sum(PassQty+FailQty),0)` | `FactQualityInspection.PassQty/FailQty` | +| 采购未付款 | `sum(UnpaidAmount)` | `FactPurchaseReceipt.UnpaidAmount` | +| AR 未核销 | `sum(UnwrittenOffAmount)` | `FactArReceipt.UnwrittenOffAmount` | +| AP 未核销 | `sum(UnwrittenOffAmount)` | `FactApPayment.UnwrittenOffAmount` | + + +## 数据字典 + +以下枚举值仅供参考,实际实施时应根据业务系统配置进行调整。 + +### 1. 通用类 (Common) + +| 字典代码 | 字典名称 | 枚举值 (Code: Name) | 适用字段 | +|---|---|---|---| +| **CurrencyCode** | 币种 | CNY: 人民币
USD: 美元
EUR: 欧元
JPY: 日元
HKD: 港币 | `FactSalesOrder.CurrencyCode`
`FactPurchaseOrder.CurrencyCode`
`FactArReceipt.CurrencyCode`
... | +| **UomCode** | 计量单位 | pcs: 个/件
kg: 千克
m: 米
L: 升
box: 箱
set: 套 | `DimProduct.UomCode`
`DimBom.UomCode`
`FactInventoryMovement.UomCode` | +| **Boolean** | 布尔标识 | 0: 否 (No/False)
1: 是 (Yes/True) | `IsCurrent`, `IsLocked`, `IsPrimary`, `IsReship`, `IsConverted`, `IsInvoiced` | + +### 2. 人员与组织 (Person & Org) + +| 字典代码 | 字典名称 | 枚举值 | 适用字段 | +|---|---|---|---| +| **PersonStatus** | 人员状态 | ACTIVE: 在职
INACTIVE: 离职
LEAVE: 休假 | `DimPerson.Status` | +| **Department** | 部门 | SALES: 销售部
MFG: 生产部
PUR: 采购部
WH: 仓储部
FIN: 财务部
QC: 质检部 | `DimPerson.Department` | +| **SupplierLevel** | 供应商等级 | STRATEGIC: 战略供应商
PREFERRED: 优选供应商
APPROVED: 合格供应商
PROBATION: 考察供应商
EXIT: 淘汰供应商 | `DimSupplier.SupplierLevel` | +| **CustomerLevel** | 客户等级 | KA: 重点客户
VIP: 重要客户
NORMAL: 普通客户
POTENTIAL: 潜在客户 | `DimCustomer.CustomerLevel`
`FactLead.CustomerLevel` | +| **Industry** | 行业 | MFG: 制造
RETAIL: 零售
IT: 互联网
FIN: 金融
EDU: 教育 | `DimCustomer.Industry`
`FactLead.Industry` | + +### 3. 生产与库存 (Production & Inventory) + +| 字典代码 | 字典名称 | 枚举值 | 适用字段 | +|---|---|---|---| +| **WorkOrderStatus** | 工单状态 | PLANNED: 计划中
RELEASED: 已下达
STARTED: 生产中
PAUSED: 暂停
COMPLETED: 已完工
CLOSED: 已结案
SCRAP: 报废 | `FactWorkOrder.Status` | +| **MovementType** | 出入库类型 | IN_PURCHASE: 采购入库
IN_FG: 完工入库
IN_RETURN: 销售退货入库
IN_OTHER: 其他入库
OUT_SALES: 销售出库
OUT_MATERIAL: 生产领料
OUT_RETURN: 采购退货出库
OUT_SCRAP: 报废出库
TRANSFER: 调拨 | `FactInventoryMovement.DocType` | +| **WarehouseType** | 仓库类型 | RAW: 原材料仓
FG: 成品仓
WIP: 线边仓/半成品仓
SCRAP: 废品仓
VMI: 供应商库存仓 | `DimWarehouse.WarehouseType` | +| **QcType** | 质检类型 | IQC: 来料检验
IPQC: 制程检验
FQC: 终检
OQC: 出货检验 | `FactQualityInspection.QcType` | +| **ProductType** | 产品类型 | FINISHED: 成品
SEMI: 半成品
RAW: 原材料
SERVICE: 服务 | `DimProduct.ProductType` | +| **TransportCondition** | 运输条件 | NORMAL: 常温
COLD: 冷链
FRAGILE: 易碎
HAZARDOUS: 危险品 | `DimProduct.TransportCondition` | +| **PlanStatus** | 计划状态 | DRAFT: 草稿
CONFIRMED: 已确认
EXECUTING: 执行中
COMPLETED: 已完成 | `FactProductionPlan.PlanStatus` | + +### 4. 销售与采购 (Sales & Purchase) + +| 字典代码 | 字典名称 | 枚举值 | 适用字段 | +|---|---|---|---| +| **LeadSource** | 线索来源 | WEB: 官网
REFERRAL: 推荐
EXHIBITION: 展会
COLD_CALL: 陌拜
OTHER: 其他 | `FactLead.LeadSource` | +| **SalesStage** | 销售阶段 | NEW: 新建
QUOTED: 已报价
NEGOTIATING: 谈判中
WON: 赢单
LOST: 输单 | `FactOpportunity.Stage`
`FactLead.Stage` | +| **OppStatusGroup** | 商机状态组 | OPEN: 开启
WON: 赢单
LOST: 输单 | `FactOpportunity.StatusGroup` | +| **PurchaseStatus** | 采购状态 | DRAFT: 草稿
APPROVED: 已审批
SENT: 已发送
PARTIAL_RECEIVED: 部分收货
RECEIVED: 全部收货
CLOSED: 关闭 | `FactPurchaseRequest.Status` | +| **PaymentStatus** | 支付状态 | UNPAID: 未付款
PARTIAL: 部分付款
PAID: 已付款
OVERDUE: 逾期 | `FactSalesOrder.PaymentStatus`
`FactPurchaseReceipt.PaymentStatus` | +| **TransportMode** | 运输方式 | LAND: 陆运
SEA: 海运
AIR: 空运
RAIL: 铁运
EXPRESS: 快递 | `FactSalesOrder.TransportMode`
`FactSalesShipment.TransportMode` | + +### 5. 财务 (Finance) + +| 字典代码 | 字典名称 | 枚举值 | 适用字段 | +|---|---|---|---| +| **FinDocType** | 财务单据类型 | RECEIPT: 收款单
PAYMENT: 付款单
INVOICE: 发票
REFUND: 退款
ADVANCE: 预收/预付
WRITEOFF: 核销 | `FactArReceipt.DocType`
`FactApPayment.DocType` | +| **WriteOffType** | 核销类型 | AR: 应收核销
AP: 应付核销 | `FactWriteOff.WriteOffType` | +| **InvoiceType** | 发票类型 | VAT_SPECIAL: 增值税专票
VAT_NORMAL: 增值税普票
ELECTRONIC: 电子发票 | `FactInvoice.InvoiceType` | + + +## 变更记录 + +| 版本 | 日期 | 作者 | 变更描述 | 脚本影响 | +|---|---|---|---|---| +| v1.0.0 | 2025-12-25 | GPT-5.2 | 首次输出:维度SCD2 + 事实星座 + ER图 + 字段清单 | 未生成 | +| v1.1.0 | 2025-12-28 | Trae | 新增 DimPerson(人员维度)并关联销售、采购、生产、审批等事实表 | 待生成 | +| v1.2.0 | 2025-12-29 | Trae | 新增「业务数据流转全景图」,包含商机-订单-计划-生产-交付全链路 Mermaid 流程图 | 无 | +| v1.3.0 | 2025-12-29 | Trae | 升级全景图,新增外部采购闭环(PO管理、入库验收IQC、三单匹配AP、供应商管理) | 无 | +| v1.4.0 | 2025-12-29 | Trae | 升级全景图,新增财务与资金阶段(开票Invoice、收付款AP/AR、核销WriteOff、资金CashFlow) | 无 | +| v1.5.0 | 2025-12-30 | Trae | 新增「数据字典」章节,规范化通用类、人员组织、生产库存、销售采购及财务类枚举值 | 无 | diff --git a/lzwcai_mcpskills_analyzeOrder/pyproject.toml b/lzwcai_mcpskills_analyzeOrder/pyproject.toml new file mode 100644 index 0000000..0f9a2b3 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "lzwcai-mcpskills-analyzeOrder" +version = "0.1.12" +description = "MCP server for executing business SQL queries with dynamic tool generation" +readme = "README.md" +requires-python = ">=3.13" +license = {text = "MIT"} +authors = [ + {name = "lzwcai", email = "your-email@example.com"}, +] +keywords = ["mcp", "sql", "executor", "server"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.13", +] +dependencies = [ + "httpx>=0.28.1", + "mcp[cli]>=1.10.1", + "pypinyin>=0.53.0", +] + +[project.scripts] +lzwcai-mcpskills-analyzeOrder = "lzwcai_mcpskills_analyzeOrder.main:main" + +[tool.hatch.build.targets.wheel] +packages = ["lzwcai_mcpskills_analyzeOrder"] + +[tool.hatch.build.targets.wheel.force-include] +"lzwcai_mcpskills_analyzeOrder/businessQueries.json" = "lzwcai_mcpskills_analyzeOrder/businessQueries.json" diff --git a/lzwcai_mcpskills_analyzeOrder/一页式决策简报.sql b/lzwcai_mcpskills_analyzeOrder/一页式决策简报.sql new file mode 100644 index 0000000..156d3f6 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/一页式决策简报.sql @@ -0,0 +1,317 @@ +-- ===================================================== +-- 一页式决策简报SQL +-- One-Page Decision Brief +-- 数据库: PostgreSQL +-- ===================================================== + +-- ===================================================== +-- 主查询:一页式决策简报 +-- ===================================================== +WITH +sales_summary AS ( + SELECT + COUNT(*) AS total_orders, + SUM(deal_amount) AS total_sales_amount, + AVG(deal_amount) AS avg_order_amount, + SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_orders, + SUM(CASE WHEN payment_status = 'PARTIAL' THEN 1 ELSE 0 END) AS partial_orders, + SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_orders, + SUM(CASE WHEN payment_status = 'PAID' THEN deal_amount ELSE 0 END) AS paid_amount, + SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) AS unpaid_amount + FROM fact_sales_order +), + +production_summary AS ( + SELECT + COUNT(*) AS total_work_orders, + SUM(planned_qty) AS total_planned_qty, + SUM(completed_qty) AS total_completed_qty, + SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, + SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, + SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders + FROM fact_work_order +), + +ar_summary AS ( + SELECT + COUNT(*) AS receipt_count, + SUM(amount) AS total_receipt_amount, + AVG(amount) AS avg_receipt_amount + FROM fact_ar_receipt +), + +ap_summary AS ( + SELECT + COUNT(*) AS payment_count, + SUM(amount) AS total_payment_amount, + AVG(amount) AS avg_payment_amount + FROM fact_ap_payment +), + +invoice_summary AS ( + SELECT + COUNT(*) AS invoice_count, + SUM(invoice_amount) AS total_invoice_amount, + AVG(invoice_amount) AS avg_invoice_amount + FROM fact_invoice +), + +return_summary AS ( + SELECT + COUNT(*) AS return_count, + SUM(amount) AS total_return_amount, + AVG(amount) AS avg_return_amount + FROM fact_sales_return +), + +shipment_summary AS ( + SELECT + COUNT(*) AS shipment_count, + SUM(amount) AS total_shipment_amount, + AVG(amount) AS avg_shipment_amount + FROM fact_sales_shipment +), + +purchase_summary AS ( + SELECT COUNT(*) AS purchase_order_count + FROM fact_purchase_order +), + +quality_summary AS ( + SELECT + COUNT(*) AS inspection_count, + SUM(pass_qty) AS total_pass_qty, + SUM(fail_qty) AS total_fail_qty + FROM fact_quality_inspection +), + +labor_summary AS ( + SELECT + COUNT(DISTINCT worker_name) AS worker_count, + SUM(duration_minutes) AS total_work_minutes, + SUM(report_qty) AS total_output_qty + FROM fact_labor_report +), + +scrap_summary AS ( + SELECT COUNT(*) AS scrap_count + FROM fact_scrap +) + +SELECT + 'Decision Brief' AS report_title, + CURRENT_DATE AS report_date, + + -- 销售板块 + ss.total_orders AS sales_order_count, + ROUND(ss.total_sales_amount, 2) AS total_sales_amount, + ROUND(ss.avg_order_amount, 2) AS avg_order_amount, + ss.paid_orders AS paid_order_count, + ss.partial_orders AS partial_paid_count, + ss.unpaid_orders AS unpaid_order_count, + ROUND(ss.paid_orders * 100.0 / NULLIF(ss.total_orders, 0), 1) AS payment_completion_rate, + ROUND(ss.unpaid_amount, 2) AS receivable_amount, + + -- 生产板块 + ps.total_work_orders AS work_order_count, + ps.closed_orders AS completed_work_orders, + ps.started_orders AS in_progress_work_orders, + ps.open_orders AS pending_work_orders, + ROUND(ps.total_planned_qty, 0) AS planned_qty, + ROUND(ps.total_completed_qty, 0) AS completed_qty, + ROUND(ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0), 1) AS production_completion_rate, + + -- 人效板块 + ls.worker_count AS active_worker_count, + ROUND(ls.total_work_minutes / 60.0, 1) AS total_work_hours, + ROUND(ls.total_output_qty, 0) AS total_output, + ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 1) AS output_per_worker, + ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, + + -- 质量板块 + qs.inspection_count AS qc_batch_count, + ROUND(qs.total_pass_qty, 0) AS pass_qty, + ROUND(qs.total_fail_qty, 0) AS fail_qty, + ROUND(qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS pass_rate, + ROUND(qs.total_fail_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0), 2) AS defect_rate, + scr.scrap_count AS scrap_record_count, + + -- 财务板块 + ar.receipt_count AS ar_receipt_count, + ROUND(ar.total_receipt_amount, 2) AS total_ar_amount, + ap.payment_count AS ap_payment_count, + ROUND(ap.total_payment_amount, 2) AS total_ap_amount, + ROUND(ar.total_receipt_amount - ap.total_payment_amount, 2) AS net_cash_flow, + inv.invoice_count AS invoice_count, + ROUND(inv.total_invoice_amount, 2) AS total_invoice_amount, + + -- 物流板块 + sh.shipment_count AS shipment_count, + ROUND(sh.total_shipment_amount, 2) AS total_shipment_amount, + pur.purchase_order_count AS purchase_order_count, + + -- 售后板块 + ret.return_count AS return_count, + ROUND(ret.total_return_amount, 2) AS total_return_amount, + ROUND(ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0), 2) AS return_rate, + + -- 综合健康度评估 + CASE + WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 95 + AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 80 + AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 5 + THEN 'EXCELLENT' + WHEN (qs.total_pass_qty * 100.0 / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0)) >= 90 + AND (ps.total_completed_qty * 100.0 / NULLIF(ps.total_planned_qty, 0)) >= 60 + AND (ret.total_return_amount * 100.0 / NULLIF(ss.total_sales_amount, 0)) < 10 + THEN 'GOOD' + ELSE 'WARNING' + END AS health_status + +FROM sales_summary ss +CROSS JOIN production_summary ps +CROSS JOIN ar_summary ar +CROSS JOIN ap_summary ap +CROSS JOIN invoice_summary inv +CROSS JOIN return_summary ret +CROSS JOIN shipment_summary sh +CROSS JOIN purchase_summary pur +CROSS JOIN quality_summary qs +CROSS JOIN labor_summary ls +CROSS JOIN scrap_summary scr; + + +-- ===================================================== +-- 补充查询1:本月 vs 上月对比分析 +-- ===================================================== +WITH +current_month AS ( + SELECT + 'current_month' AS period, + COUNT(*) AS order_count, + SUM(deal_amount) AS sales_amount + FROM fact_sales_order + WHERE DATE_TRUNC('month', order_date_utc::timestamp) = DATE_TRUNC('month', CURRENT_DATE) +), +last_month AS ( + SELECT + 'last_month' AS period, + COUNT(*) AS order_count, + SUM(deal_amount) AS sales_amount + FROM fact_sales_order + WHERE DATE_TRUNC('month', order_date_utc::timestamp) = DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1 month') +) +SELECT + period, + order_count, + ROUND(sales_amount, 2) AS sales_amount +FROM current_month +UNION ALL +SELECT * FROM last_month; + + +-- ===================================================== +-- 补充查询2:客户贡献度TOP10 +-- ===================================================== +SELECT + c.customer_name, + COUNT(so.sales_order_id) AS order_count, + ROUND(SUM(so.deal_amount), 2) AS total_order_amount, + ROUND(SUM(so.deal_amount) * 100.0 / (SELECT SUM(deal_amount) FROM fact_sales_order), 2) AS contribution_rate, + SUM(CASE WHEN so.payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_order_count, + SUM(CASE WHEN so.payment_status = 'UNPAID' THEN so.deal_amount ELSE 0 END) AS receivable_amount +FROM fact_sales_order so +INNER JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = 't' +GROUP BY c.customer_name +ORDER BY total_order_amount DESC +LIMIT 10; + + +-- ===================================================== +-- 补充查询3:产品类别业绩分析 +-- ===================================================== +SELECT + p.product_category, + COUNT(DISTINCT wo.work_order_id) AS work_order_count, + ROUND(SUM(wo.planned_qty), 0) AS planned_qty, + ROUND(SUM(wo.completed_qty), 0) AS completed_qty, + ROUND(SUM(wo.completed_qty) * 100.0 / NULLIF(SUM(wo.planned_qty), 0), 1) AS completion_rate, + COUNT(DISTINCT lr.worker_name) AS worker_count, + ROUND(SUM(lr.duration_minutes) / 60.0, 1) AS total_work_hours +FROM dim_product p +LEFT JOIN fact_work_order wo ON p.product_id = wo.product_id +LEFT JOIN fact_labor_report lr ON p.product_id = lr.product_id +WHERE p.is_current = 't' +GROUP BY p.product_category +ORDER BY completed_qty DESC; + + +-- ===================================================== +-- 补充查询4:关键预警指标 +-- ===================================================== +SELECT + 'warning_metrics' AS category, + 'unpaid_order_amount' AS metric_name, + ROUND(SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END), 2) AS current_value, + 50000 AS threshold, + CASE + WHEN SUM(CASE WHEN payment_status = 'UNPAID' THEN deal_amount ELSE 0 END) > 50000 + THEN 'EXCEEDED' ELSE 'NORMAL' + END AS status +FROM fact_sales_order + +UNION ALL + +SELECT + 'warning_metrics', + 'defect_rate_pct', + ROUND(SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty) + SUM(fail_qty), 0), 2), + 5, + CASE + WHEN SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty) + SUM(fail_qty), 0) > 5 + THEN 'EXCEEDED' ELSE 'NORMAL' + END +FROM fact_quality_inspection + +UNION ALL + +SELECT + 'warning_metrics', + 'production_completion_rate', + ROUND(SUM(completed_qty) * 100.0 / NULLIF(SUM(planned_qty), 0), 2), + 70, + CASE + WHEN SUM(completed_qty) * 100.0 / NULLIF(SUM(planned_qty), 0) < 70 + THEN 'LOW' ELSE 'NORMAL' + END +FROM fact_work_order + +UNION ALL + +SELECT + 'warning_metrics', + 'return_rate_pct', + ROUND((SELECT SUM(amount) FROM fact_sales_return) * 100.0 / + NULLIF((SELECT SUM(deal_amount) FROM fact_sales_order), 0), 2), + 5, + CASE + WHEN (SELECT SUM(amount) FROM fact_sales_return) * 100.0 / + NULLIF((SELECT SUM(deal_amount) FROM fact_sales_order), 0) > 5 + THEN 'EXCEEDED' ELSE 'NORMAL' + END; + + +-- ===================================================== +-- 补充查询5:月度趋势汇总 +-- ===================================================== +SELECT + TO_CHAR(DATE_TRUNC('month', order_date_utc::timestamp), 'YYYY-MM') AS month, + COUNT(*) AS order_count, + ROUND(SUM(deal_amount), 2) AS sales_amount, + ROUND(AVG(deal_amount), 2) AS avg_order_amount, + SUM(CASE WHEN payment_status = 'PAID' THEN 1 ELSE 0 END) AS paid_count, + SUM(CASE WHEN payment_status = 'UNPAID' THEN 1 ELSE 0 END) AS unpaid_count +FROM fact_sales_order +GROUP BY DATE_TRUNC('month', order_date_utc::timestamp) +ORDER BY month DESC +LIMIT 12; diff --git a/lzwcai_mcpskills_analyzeOrder/人效产值损耗三维模型仪表盘.sql b/lzwcai_mcpskills_analyzeOrder/人效产值损耗三维模型仪表盘.sql new file mode 100644 index 0000000..b6f98b9 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/人效产值损耗三维模型仪表盘.sql @@ -0,0 +1,193 @@ +-- ===================================================== +-- 人效-产值-损耗三维模型仪表盘SQL +-- Efficiency-Output-Loss 3D Model Dashboard +-- 数据库: PostgreSQL +-- 维度: 产品类别(化工/机械/电子)作为部门维度 +-- ===================================================== + +-- 1. 部门级综合仪表盘(主查询) +WITH +labor_stats AS ( + SELECT + p.product_category AS department, + COUNT(DISTINCT lr.worker_name) AS worker_count, + SUM(lr.duration_minutes) AS total_work_minutes, + SUM(lr.report_qty) AS total_output_qty, + COUNT(DISTINCT lr.work_order_number) AS work_order_count + FROM fact_labor_report lr + INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' + GROUP BY p.product_category +), + +work_order_stats AS ( + SELECT + p.product_category AS department, + COUNT(*) AS total_work_orders, + SUM(wo.planned_qty) AS total_planned_qty, + SUM(wo.completed_qty) AS total_completed_qty, + SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, + SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, + SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders + FROM fact_work_order wo + INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' + GROUP BY p.product_category +), + +quality_stats AS ( + SELECT + p.product_category AS department, + SUM(qi.pass_qty) AS total_pass_qty, + SUM(qi.fail_qty) AS total_fail_qty, + COUNT(*) AS inspection_count + FROM fact_quality_inspection qi + INNER JOIN dim_product p ON qi.product_id = p.product_id AND p.is_current = 't' + GROUP BY p.product_category +), + +sales_stats AS ( + SELECT + AVG(deal_amount) AS avg_order_amount, + SUM(deal_amount) AS total_sales_amount, + COUNT(*) AS order_count + FROM fact_sales_order +), + +scrap_stats AS ( + SELECT COUNT(*) AS total_scrap_count + FROM fact_scrap +) + +SELECT + ls.department, + + -- 人效维度 + ls.worker_count, + ROUND(ls.total_work_minutes / 60.0, 2) AS total_work_hours, + ls.total_output_qty, + ROUND(ls.total_output_qty / NULLIF(ls.worker_count, 0), 2) AS output_per_worker, + ROUND(ls.total_output_qty / NULLIF(ls.total_work_minutes / 60.0, 0), 2) AS output_per_hour, + ROUND( + ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0), + 2 + ) AS efficiency_index, + + -- 产值维度 + ws.total_planned_qty AS planned_qty, + ws.total_completed_qty AS completed_qty, + ROUND(ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS plan_completion_rate, + ROUND(ws.total_completed_qty * ss.avg_order_amount / 100, 2) AS estimated_output_value, + ROUND(ws.total_completed_qty * ss.avg_order_amount / 100 / NULLIF(ls.worker_count, 0), 2) AS output_value_per_worker, + + -- 损耗维度 + qs.total_pass_qty AS qc_pass_qty, + qs.total_fail_qty AS qc_fail_qty, + ROUND(qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100, 2) AS defect_rate, + ROUND((ws.total_planned_qty - ws.total_completed_qty) / NULLIF(ws.total_planned_qty, 0) * 100, 2) AS production_loss_rate, + + -- 综合评分 + ROUND( + (ls.total_output_qty / NULLIF(ls.worker_count, 0) / NULLIF(ls.total_work_minutes / 60.0 / ls.worker_count, 0)) * 0.4 + + (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) * 0.35 + + (qs.total_pass_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) * 0.25, + 2 + ) AS performance_score, + + -- 预警等级 + CASE + WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 10 + OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 50 + THEN 'RED' + WHEN (qs.total_fail_qty / NULLIF(qs.total_pass_qty + qs.total_fail_qty, 0) * 100) >= 5 + OR (ws.total_completed_qty / NULLIF(ws.total_planned_qty, 0) * 100) < 70 + THEN 'YELLOW' + ELSE 'GREEN' + END AS warning_level + +FROM labor_stats ls +LEFT JOIN work_order_stats ws ON ls.department = ws.department +LEFT JOIN quality_stats qs ON ls.department = qs.department +CROSS JOIN sales_stats ss +CROSS JOIN scrap_stats scr +ORDER BY performance_score DESC; + + +-- ===================================================== +-- 2. 人员级明细报表 +-- ===================================================== +SELECT + lr.worker_name, + p.product_category AS department, + COUNT(DISTINCT lr.work_order_number) AS work_order_count, + SUM(lr.duration_minutes) AS total_work_minutes, + ROUND(SUM(lr.duration_minutes) / 60.0, 2) AS total_work_hours, + SUM(lr.report_qty) AS total_output, + ROUND(SUM(lr.report_qty) / NULLIF(SUM(lr.duration_minutes) / 60.0, 0), 2) AS output_per_hour, + RANK() OVER (PARTITION BY p.product_category ORDER BY SUM(lr.report_qty) DESC) AS dept_output_rank +FROM fact_labor_report lr +INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' +GROUP BY lr.worker_name, p.product_category +ORDER BY p.product_category, total_output DESC; + + +-- ===================================================== +-- 3. 月度趋势分析 +-- ===================================================== +SELECT + TO_CHAR(DATE_TRUNC('month', lr.event_time_utc::timestamp), 'YYYY-MM') AS month, + p.product_category AS department, + COUNT(DISTINCT lr.worker_name) AS active_worker_count, + SUM(lr.duration_minutes) AS total_work_minutes, + SUM(lr.report_qty) AS total_output, + ROUND(SUM(lr.report_qty) / NULLIF(COUNT(DISTINCT lr.worker_name), 0), 2) AS output_per_worker, + ROUND(SUM(lr.report_qty) / NULLIF(SUM(lr.duration_minutes) / 60.0, 0), 2) AS output_per_hour +FROM fact_labor_report lr +INNER JOIN dim_product p ON lr.product_id = p.product_id AND p.is_current = 't' +GROUP BY DATE_TRUNC('month', lr.event_time_utc::timestamp), p.product_category +ORDER BY month DESC, p.product_category; + + +-- ===================================================== +-- 4. 产品级损耗分析 +-- ===================================================== +SELECT + p.product_category AS department, + p.product_name, + p.product_code, + COALESCE(SUM(qi.pass_qty), 0) AS pass_qty, + COALESCE(SUM(qi.fail_qty), 0) AS fail_qty, + ROUND( + COALESCE(SUM(qi.fail_qty), 0) / + NULLIF(COALESCE(SUM(qi.pass_qty), 0) + COALESCE(SUM(qi.fail_qty), 0), 0) * 100, + 2 + ) AS defect_rate, + CASE + WHEN COALESCE(SUM(qi.fail_qty), 0) / + NULLIF(COALESCE(SUM(qi.pass_qty), 0) + COALESCE(SUM(qi.fail_qty), 0), 0) * 100 >= 10 + THEN 'HIGH' + WHEN COALESCE(SUM(qi.fail_qty), 0) / + NULLIF(COALESCE(SUM(qi.pass_qty), 0) + COALESCE(SUM(qi.fail_qty), 0), 0) * 100 >= 5 + THEN 'MEDIUM' + ELSE 'LOW' + END AS loss_level +FROM dim_product p +LEFT JOIN fact_quality_inspection qi ON p.product_id = qi.product_id +WHERE p.is_current = 't' +GROUP BY p.product_category, p.product_name, p.product_code +ORDER BY defect_rate DESC NULLS LAST; + + +-- ===================================================== +-- 5. 工单完成率分析 +-- ===================================================== +SELECT + p.product_category AS department, + wo.status, + COUNT(*) AS order_count, + SUM(wo.planned_qty) AS total_planned, + SUM(wo.completed_qty) AS total_completed, + ROUND(SUM(wo.completed_qty) / NULLIF(SUM(wo.planned_qty), 0) * 100, 2) AS completion_rate, + ROUND(AVG(wo.completed_qty / NULLIF(wo.planned_qty, 0) * 100), 2) AS avg_completion_rate +FROM fact_work_order wo +INNER JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' +GROUP BY p.product_category, wo.status +ORDER BY p.product_category, wo.status; diff --git a/lzwcai_mcpskills_analyzeOrder/供应链风险预警.sql b/lzwcai_mcpskills_analyzeOrder/供应链风险预警.sql new file mode 100644 index 0000000..857c7ee --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/供应链风险预警.sql @@ -0,0 +1,416 @@ +-- ===================================================== +-- 供应链风险预警SQL +-- Supply Chain Risk Warning +-- 数据库: PostgreSQL +-- ===================================================== + +-- ===================================================== +-- 1. 供应商历史交期表现分析 +-- ===================================================== +WITH supplier_delivery AS ( + SELECT + po.supplier_id, + COUNT(*) AS order_count, + COUNT(pr.purchase_receipt_id) AS receipt_count, + AVG( + CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL + THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) + ELSE NULL END + ) AS avg_delivery_days, + MAX( + CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL + THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) + ELSE NULL END + ) AS max_delivery_days, + STDDEV( + CASE WHEN pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL + THEN EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp) + ELSE NULL END + ) AS stddev_delivery_days + FROM fact_purchase_order po + LEFT JOIN fact_purchase_receipt pr ON po.supplier_id = pr.supplier_id + GROUP BY po.supplier_id +), + +supplier_quality AS ( + SELECT + pr.supplier_id, + COUNT(pr.purchase_receipt_id) AS total_receipts, + SUM(pr.receipt_qty_total) AS total_qty, + SUM(pr.amount) AS total_amount + FROM fact_purchase_receipt pr + GROUP BY pr.supplier_id +), + +supplier_returns AS ( + SELECT + pret.supplier_id, + COUNT(*) AS return_count, + SUM(CASE WHEN pret.return_reason = '损坏' THEN 1 ELSE 0 END) AS damage_count + FROM fact_purchase_return pret + GROUP BY pret.supplier_id +), + +supplier_quality_rate AS ( + SELECT + sq.supplier_id, + sq.total_receipts, + sq.total_qty, + sq.total_amount, + COALESCE(sr.return_count, 0) AS return_count, + COALESCE(sr.damage_count, 0) AS damage_count, + CASE WHEN sq.total_receipts > 0 + THEN (sq.total_receipts - COALESCE(sr.return_count, 0)) * 100.0 / sq.total_receipts + ELSE 100 END AS quality_rate + FROM supplier_quality sq + LEFT JOIN supplier_returns sr ON sq.supplier_id = sr.supplier_id +), + +supplier_risk AS ( + SELECT + s.supplier_id, + s.supplier_name, + s.supplier_category, + COALESCE(sd.order_count, 0) AS order_count, + COALESCE(sd.receipt_count, 0) AS receipt_count, + ROUND(COALESCE(sd.avg_delivery_days, 0), 1) AS avg_delivery_days, + ROUND(COALESCE(sd.max_delivery_days, 0), 1) AS max_delivery_days, + ROUND(COALESCE(sd.stddev_delivery_days, 0), 1) AS delivery_volatility, + COALESCE(sqr.total_receipts, 0) AS total_receipts, + COALESCE(sqr.return_count, 0) AS return_count, + ROUND(COALESCE(sqr.quality_rate, 100), 1) AS quality_rate, + CASE + WHEN COALESCE(sd.avg_delivery_days, 0) > 60 THEN 40 + WHEN COALESCE(sd.avg_delivery_days, 0) > 45 THEN 30 + WHEN COALESCE(sd.avg_delivery_days, 0) > 30 THEN 20 + ELSE 10 + END + + CASE + WHEN COALESCE(sd.stddev_delivery_days, 0) > 20 THEN 30 + WHEN COALESCE(sd.stddev_delivery_days, 0) > 10 THEN 20 + ELSE 10 + END AS delivery_risk_score, + CASE + WHEN COALESCE(sqr.quality_rate, 100) < 80 THEN 50 + WHEN COALESCE(sqr.quality_rate, 100) < 90 THEN 30 + WHEN COALESCE(sqr.quality_rate, 100) < 95 THEN 15 + ELSE 5 + END AS quality_risk_score + FROM dim_supplier s + LEFT JOIN supplier_delivery sd ON s.supplier_id = sd.supplier_id + LEFT JOIN supplier_quality_rate sqr ON s.supplier_id = sqr.supplier_id + WHERE s.is_current = 't' +), + +supplier_risk_level AS ( + SELECT + *, + delivery_risk_score + quality_risk_score AS total_risk_score, + CASE + WHEN delivery_risk_score + quality_risk_score >= 80 THEN 'HIGH' + WHEN delivery_risk_score + quality_risk_score >= 50 THEN 'MEDIUM' + ELSE 'LOW' + END AS risk_level, + CASE + WHEN delivery_risk_score >= 50 AND quality_risk_score >= 30 THEN 'DELIVERY_AND_QUALITY' + WHEN delivery_risk_score >= 50 THEN 'DELIVERY_ISSUE' + WHEN quality_risk_score >= 30 THEN 'QUALITY_ISSUE' + ELSE 'NORMAL' + END AS risk_pattern + FROM supplier_risk +) + +SELECT + supplier_name, + supplier_category, + order_count, + receipt_count, + avg_delivery_days, + max_delivery_days, + delivery_volatility, + total_receipts, + return_count, + quality_rate, + delivery_risk_score, + quality_risk_score, + total_risk_score, + risk_level, + risk_pattern +FROM supplier_risk_level +ORDER BY total_risk_score DESC, supplier_name; + + +-- ===================================================== +-- 补充查询1:高风险订单预警清单 +-- ===================================================== +WITH supplier_risk_info AS ( + SELECT + s.supplier_id, + s.supplier_name, + s.supplier_category, + COALESCE( + (SELECT AVG(EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po2.doc_date_utc::timestamp)) + FROM fact_purchase_order po2 + LEFT JOIN fact_purchase_receipt pr ON po2.supplier_id = pr.supplier_id + WHERE po2.supplier_id = s.supplier_id + AND pr.doc_date_utc IS NOT NULL), 0 + ) AS avg_delivery_days, + COALESCE( + (SELECT COUNT(*) FROM fact_purchase_return pret WHERE pret.supplier_id = s.supplier_id), 0 + ) AS return_count, + COALESCE( + (SELECT COUNT(*) FROM fact_purchase_receipt pr WHERE pr.supplier_id = s.supplier_id), 0 + ) AS receipt_count + FROM dim_supplier s + WHERE s.is_current = 't' +), +order_risk AS ( + SELECT + po.purchase_order_number, + po.doc_date_utc::date AS order_date, + sri.supplier_name, + sri.supplier_category, + ROUND(sri.avg_delivery_days, 1) AS supplier_avg_days, + sri.return_count, + sri.receipt_count, + CASE WHEN sri.receipt_count > 0 + THEN ROUND((sri.receipt_count - sri.return_count) * 100.0 / sri.receipt_count, 1) + ELSE 100 END AS quality_rate, + EXTRACT(DAY FROM CURRENT_TIMESTAMP - po.doc_date_utc::timestamp) AS days_since_order, + CASE + WHEN sri.avg_delivery_days > 45 AND sri.return_count > 0 THEN 'HIGH' + WHEN sri.avg_delivery_days > 45 OR sri.return_count > 0 THEN 'MEDIUM' + ELSE 'LOW' + END AS risk_level + FROM fact_purchase_order po + JOIN supplier_risk_info sri ON po.supplier_id = sri.supplier_id +) +SELECT + purchase_order_number, + order_date, + supplier_name, + supplier_category, + supplier_avg_days, + quality_rate, + days_since_order, + risk_level, + CASE + WHEN risk_level = 'HIGH' THEN 'IMMEDIATE_FOLLOWUP' + WHEN risk_level = 'MEDIUM' THEN 'MONITOR' + ELSE 'NORMAL' + END AS action_required +FROM order_risk +WHERE risk_level IN ('HIGH', 'MEDIUM') +ORDER BY + CASE risk_level WHEN 'HIGH' THEN 1 WHEN 'MEDIUM' THEN 2 ELSE 3 END, + days_since_order DESC; + + +-- ===================================================== +-- 补充查询2:供应商类别风险分布 +-- ===================================================== +WITH supplier_stats AS ( + SELECT + s.supplier_category, + COUNT(DISTINCT s.supplier_id) AS supplier_count, + COUNT(DISTINCT po.purchase_order_id) AS order_count, + COUNT(DISTINCT pr.purchase_receipt_id) AS receipt_count, + COUNT(DISTINCT pret.purchase_return_id) AS return_count, + SUM(pr.amount) AS total_amount + FROM dim_supplier s + LEFT JOIN fact_purchase_order po ON s.supplier_id = po.supplier_id + LEFT JOIN fact_purchase_receipt pr ON s.supplier_id = pr.supplier_id + LEFT JOIN fact_purchase_return pret ON s.supplier_id = pret.supplier_id + WHERE s.is_current = 't' + GROUP BY s.supplier_category +) +SELECT + supplier_category, + supplier_count, + order_count, + receipt_count, + return_count, + CASE WHEN receipt_count > 0 + THEN ROUND((receipt_count - return_count) * 100.0 / receipt_count, 1) + ELSE 100 END AS quality_rate, + ROUND(COALESCE(total_amount, 0), 2) AS purchase_amount, + CASE + WHEN receipt_count > 0 AND return_count * 100.0 / receipt_count > 10 THEN 'HIGH' + WHEN receipt_count > 0 AND return_count * 100.0 / receipt_count > 5 THEN 'MEDIUM' + ELSE 'LOW' + END AS category_risk_level +FROM supplier_stats +ORDER BY return_count DESC; + + +-- ===================================================== +-- 补充查询3:近期交期异常趋势 +-- ===================================================== +WITH monthly_delivery AS ( + SELECT + DATE_TRUNC('month', pr.doc_date_utc::timestamp)::date AS month_start, + COUNT(*) AS receipt_count, + AVG(EXTRACT(DAY FROM pr.doc_date_utc::timestamp - po.doc_date_utc::timestamp)) AS avg_delivery_days + FROM fact_purchase_receipt pr + JOIN fact_purchase_order po ON pr.supplier_id = po.supplier_id + WHERE pr.doc_date_utc IS NOT NULL AND po.doc_date_utc IS NOT NULL + GROUP BY DATE_TRUNC('month', pr.doc_date_utc::timestamp) +), +monthly_returns AS ( + SELECT + DATE_TRUNC('month', pret.doc_date_utc::timestamp)::date AS month_start, + COUNT(*) AS return_count + FROM fact_purchase_return pret + GROUP BY DATE_TRUNC('month', pret.doc_date_utc::timestamp) +), +monthly_combined AS ( + SELECT + md.month_start, + md.receipt_count, + ROUND(md.avg_delivery_days, 1) AS avg_delivery_days, + COALESCE(mr.return_count, 0) AS return_count + FROM monthly_delivery md + LEFT JOIN monthly_returns mr ON md.month_start = mr.month_start +), +with_trend AS ( + SELECT + *, + LAG(avg_delivery_days, 1) OVER (ORDER BY month_start) AS prev_avg_days, + LAG(return_count, 1) OVER (ORDER BY month_start) AS prev_return_count + FROM monthly_combined +) +SELECT + month_start, + receipt_count, + avg_delivery_days, + return_count, + CASE WHEN receipt_count > 0 + THEN ROUND(return_count * 100.0 / receipt_count, 1) + ELSE 0 END AS return_rate, + CASE + WHEN prev_avg_days IS NULL THEN 'NONE' + WHEN avg_delivery_days > prev_avg_days * 1.1 THEN 'INCREASING' + WHEN avg_delivery_days < prev_avg_days * 0.9 THEN 'DECREASING' + ELSE 'STABLE' + END AS delivery_trend, + CASE + WHEN prev_return_count IS NULL THEN 'NONE' + WHEN return_count > prev_return_count THEN 'INCREASING' + WHEN return_count < prev_return_count THEN 'DECREASING' + ELSE 'STABLE' + END AS return_trend +FROM with_trend +ORDER BY month_start DESC; + + +-- ===================================================== +-- 补充查询4:风险预警汇总看板 +-- ===================================================== +WITH risk_summary AS ( + SELECT + s.supplier_id, + s.supplier_name, + COALESCE( + (SELECT COUNT(*) FROM fact_purchase_return pret WHERE pret.supplier_id = s.supplier_id), 0 + ) AS return_count, + COALESCE( + (SELECT COUNT(*) FROM fact_purchase_receipt pr WHERE pr.supplier_id = s.supplier_id), 0 + ) AS receipt_count + FROM dim_supplier s + WHERE s.is_current = 't' +), +risk_counts AS ( + SELECT + SUM(CASE WHEN receipt_count > 0 AND return_count * 100.0 / receipt_count > 10 THEN 1 ELSE 0 END) AS high_risk_suppliers, + SUM(CASE WHEN receipt_count > 0 AND return_count * 100.0 / receipt_count BETWEEN 5 AND 10 THEN 1 ELSE 0 END) AS medium_risk_suppliers, + SUM(CASE WHEN receipt_count = 0 OR return_count * 100.0 / receipt_count < 5 THEN 1 ELSE 0 END) AS low_risk_suppliers, + COUNT(*) AS total_suppliers + FROM risk_summary +), +order_stats AS ( + SELECT + COUNT(*) AS pending_orders, + COUNT(CASE WHEN EXTRACT(DAY FROM CURRENT_TIMESTAMP - doc_date_utc::timestamp) > 30 THEN 1 END) AS overdue_orders + FROM fact_purchase_order +), +return_stats AS ( + SELECT + COUNT(*) AS total_returns, + COUNT(CASE WHEN doc_date_utc::timestamp >= CURRENT_DATE - INTERVAL '30 days' THEN 1 END) AS recent_returns + FROM fact_purchase_return +) +SELECT + 'high_risk_suppliers' AS metric_name, + rc.high_risk_suppliers::text AS metric_value, + CASE WHEN rc.high_risk_suppliers > 0 THEN 'ATTENTION_NEEDED' ELSE 'NORMAL' END AS status +FROM risk_counts rc +UNION ALL +SELECT 'medium_risk_suppliers', rc.medium_risk_suppliers::text, + CASE WHEN rc.medium_risk_suppliers > 2 THEN 'MONITOR' ELSE 'NORMAL' END +FROM risk_counts rc +UNION ALL +SELECT 'low_risk_suppliers', rc.low_risk_suppliers::text, 'NORMAL' +FROM risk_counts rc +UNION ALL +SELECT 'pending_orders', os.pending_orders::text, + CASE WHEN os.pending_orders > 20 THEN 'BACKLOG' ELSE 'NORMAL' END +FROM order_stats os +UNION ALL +SELECT 'overdue_orders_30d', os.overdue_orders::text, + CASE WHEN os.overdue_orders > 5 THEN 'DELIVERY_WARNING' ELSE 'NORMAL' END +FROM order_stats os +UNION ALL +SELECT 'recent_returns_30d', rs.recent_returns::text, + CASE WHEN rs.recent_returns > 3 THEN 'QUALITY_WARNING' ELSE 'NORMAL' END +FROM return_stats rs; + + +-- ===================================================== +-- 补充查询5:供应商风险排行榜 +-- ===================================================== +WITH supplier_metrics AS ( + SELECT + s.supplier_id, + s.supplier_name, + s.supplier_category, + COUNT(DISTINCT po.purchase_order_id) AS order_count, + COUNT(DISTINCT pr.purchase_receipt_id) AS receipt_count, + COUNT(DISTINCT pret.purchase_return_id) AS return_count, + SUM(pr.amount) AS total_amount + FROM dim_supplier s + LEFT JOIN fact_purchase_order po ON s.supplier_id = po.supplier_id + LEFT JOIN fact_purchase_receipt pr ON s.supplier_id = pr.supplier_id + LEFT JOIN fact_purchase_return pret ON s.supplier_id = pret.supplier_id + WHERE s.is_current = 't' + GROUP BY s.supplier_id, s.supplier_name, s.supplier_category +), +ranked_suppliers AS ( + SELECT + *, + CASE WHEN receipt_count > 0 + THEN ROUND(return_count * 100.0 / receipt_count, 1) + ELSE 0 END AS return_rate, + ROW_NUMBER() OVER (ORDER BY + CASE WHEN receipt_count > 0 THEN return_count * 1.0 / receipt_count ELSE 0 END DESC, + return_count DESC + ) AS risk_rank + FROM supplier_metrics +) +SELECT + risk_rank, + supplier_name, + supplier_category, + order_count, + receipt_count, + return_count, + return_rate, + ROUND(COALESCE(total_amount, 0), 2) AS purchase_amount, + CASE + WHEN return_rate > 10 THEN 'HIGH_RISK' + WHEN return_rate > 5 THEN 'MEDIUM_RISK' + WHEN return_count > 0 THEN 'LOW_RISK' + ELSE 'EXCELLENT' + END AS risk_assessment +FROM ranked_suppliers +ORDER BY risk_rank +LIMIT 20; diff --git a/lzwcai_mcpskills_analyzeOrder/工单执行进度与异常节点.sql b/lzwcai_mcpskills_analyzeOrder/工单执行进度与异常节点.sql new file mode 100644 index 0000000..f7d3770 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/工单执行进度与异常节点.sql @@ -0,0 +1,409 @@ +-- ===================================================== +-- 工单执行进度与异常节点SQL +-- 数据库: PostgreSQL +-- 实时拉取工单数据,动态映射订单各环节状态 +-- ===================================================== + +-- ===================================================== +-- 1. 工单执行进度主视图 +-- ===================================================== +WITH work_order_base AS ( + SELECT + wo.work_order_id, + wo.work_order_number, + wo.product_id, + wo.status, + wo.planned_qty, + wo.completed_qty, + wo.event_time_utc::timestamp AS start_time, + wo.last_updated_utc::timestamp AS last_update, + wo.source_system + FROM fact_work_order wo +), + +product_info AS ( + SELECT + product_id, + product_name, + product_category + FROM dim_product + WHERE is_current = 't' +), + +labor_summary AS ( + SELECT + work_order_number, + COUNT(DISTINCT worker_name) AS worker_count, + SUM(report_qty) AS total_report_qty, + SUM(duration_minutes) AS total_minutes, + MAX(event_time_utc::timestamp) AS last_report_time + FROM fact_labor_report + GROUP BY work_order_number +), + +quality_summary AS ( + SELECT + work_order_number, + SUM(pass_qty) AS pass_qty, + SUM(fail_qty) AS fail_qty + FROM fact_quality_inspection + GROUP BY work_order_number +), + +-- ===================================================== +-- 2. 工单进度计算与状态映射 +-- ===================================================== +work_order_progress AS ( + SELECT + wb.work_order_id, + wb.work_order_number, + p.product_name, + p.product_category, + wb.status AS raw_status, + + -- 状态映射 + CASE wb.status + WHEN 'OPEN' THEN '待生产' + WHEN 'STARTED' THEN '生产中' + WHEN 'CLOSED' THEN '已完成' + ELSE '未知' + END AS status_name, + + wb.planned_qty, + wb.completed_qty, + + -- 完成进度 + CASE WHEN wb.planned_qty > 0 + THEN ROUND(wb.completed_qty * 100.0 / wb.planned_qty, 1) + ELSE 0 END AS completion_rate, + + -- 剩余数量 + GREATEST(wb.planned_qty - wb.completed_qty, 0) AS remaining_qty, + + wb.start_time, + wb.last_update, + + -- 已用时间(小时) + ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wb.start_time)) / 3600, 1) AS elapsed_hours, + + -- 报工信息 + COALESCE(ls.worker_count, 0) AS worker_count, + COALESCE(ls.total_report_qty, 0) AS total_report_qty, + COALESCE(ls.total_minutes, 0) AS total_work_minutes, + ls.last_report_time, + + -- 质检信息 + COALESCE(qs.pass_qty, 0) AS qc_pass_qty, + COALESCE(qs.fail_qty, 0) AS qc_fail_qty + + FROM work_order_base wb + LEFT JOIN product_info p ON wb.product_id = p.product_id + LEFT JOIN labor_summary ls ON wb.work_order_number = ls.work_order_number + LEFT JOIN quality_summary qs ON wb.work_order_number = qs.work_order_number +), + +-- ===================================================== +-- 3. 异常节点检测 +-- ===================================================== +anomaly_detection AS ( + SELECT + *, + + -- 进度异常:进行中但完成率过低 + CASE + WHEN raw_status = 'STARTED' AND elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' + WHEN raw_status = 'STARTED' AND elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' + ELSE NULL + END AS progress_anomaly, + + -- 质量异常:废品率过高 + CASE + WHEN qc_pass_qty + qc_fail_qty > 0 + AND qc_fail_qty * 100.0 / (qc_pass_qty + qc_fail_qty) > 10 THEN '质量异常' + ELSE NULL + END AS quality_anomaly, + + -- 报工异常:长时间无报工 + CASE + WHEN raw_status = 'STARTED' + AND last_report_time IS NOT NULL + AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' + WHEN raw_status = 'STARTED' + AND last_report_time IS NULL + AND elapsed_hours > 24 THEN '无报工记录' + ELSE NULL + END AS labor_anomaly, + + -- 效率异常:人效过低 + CASE + WHEN total_work_minutes > 0 + AND total_report_qty / (total_work_minutes / 60.0) < 5 THEN '效率偏低' + ELSE NULL + END AS efficiency_anomaly + + FROM work_order_progress +) + +-- ===================================================== +-- 输出:工单执行进度明细 +-- ===================================================== +SELECT + work_order_number AS "工单号", + product_name AS "产品名称", + product_category AS "产品类别", + status_name AS "状态", + planned_qty AS "计划数量", + completed_qty AS "完成数量", + remaining_qty AS "剩余数量", + completion_rate AS "完成率(%)", + worker_count AS "参与人数", + ROUND(total_work_minutes / 60.0, 1) AS "累计工时(小时)", + elapsed_hours AS "已用时间(小时)", + + -- 异常标记 + COALESCE(progress_anomaly, '') || + CASE WHEN progress_anomaly IS NOT NULL AND quality_anomaly IS NOT NULL THEN ',' ELSE '' END || + COALESCE(quality_anomaly, '') || + CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL) AND labor_anomaly IS NOT NULL THEN ',' ELSE '' END || + COALESCE(labor_anomaly, '') || + CASE WHEN (progress_anomaly IS NOT NULL OR quality_anomaly IS NOT NULL OR labor_anomaly IS NOT NULL) AND efficiency_anomaly IS NOT NULL THEN ',' ELSE '' END || + COALESCE(efficiency_anomaly, '') AS "异常标记", + + -- 风险等级 + CASE + WHEN progress_anomaly = '进度严重滞后' OR quality_anomaly IS NOT NULL THEN '高' + WHEN progress_anomaly = '进度滞后' OR labor_anomaly IS NOT NULL THEN '中' + WHEN efficiency_anomaly IS NOT NULL THEN '低' + ELSE '-' + END AS "风险等级" + +FROM anomaly_detection +ORDER BY + CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END, + CASE WHEN progress_anomaly IS NOT NULL THEN 0 ELSE 1 END, + completion_rate ASC; + + +-- ===================================================== +-- 补充查询1:工单状态分布汇总 +-- ===================================================== +WITH status_summary AS ( + SELECT + CASE status + WHEN 'OPEN' THEN '待生产' + WHEN 'STARTED' THEN '生产中' + WHEN 'CLOSED' THEN '已完成' + ELSE '未知' + END AS status_name, + status AS raw_status, + COUNT(*) AS order_count, + SUM(planned_qty) AS total_planned, + SUM(completed_qty) AS total_completed + FROM fact_work_order + GROUP BY status +) +SELECT + status_name AS "状态", + order_count AS "工单数", + ROUND(order_count * 100.0 / SUM(order_count) OVER (), 1) AS "占比(%)", + ROUND(total_planned, 0) AS "计划总量", + ROUND(total_completed, 0) AS "完成总量", + CASE WHEN total_planned > 0 + THEN ROUND(total_completed * 100.0 / total_planned, 1) + ELSE 0 END AS "完成率(%)" +FROM status_summary +ORDER BY + CASE raw_status WHEN 'STARTED' THEN 1 WHEN 'OPEN' THEN 2 ELSE 3 END; + + +-- ===================================================== +-- 补充查询2:异常工单预警清单 +-- ===================================================== +WITH work_order_anomaly AS ( + SELECT + wo.work_order_number, + p.product_name, + wo.status, + wo.planned_qty, + wo.completed_qty, + CASE WHEN wo.planned_qty > 0 + THEN ROUND(wo.completed_qty * 100.0 / wo.planned_qty, 1) + ELSE 0 END AS completion_rate, + ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wo.event_time_utc::timestamp)) / 3600, 1) AS elapsed_hours, + (SELECT MAX(lr.event_time_utc::timestamp) + FROM fact_labor_report lr + WHERE lr.work_order_number = wo.work_order_number) AS last_report_time + FROM fact_work_order wo + LEFT JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' + WHERE wo.status = 'STARTED' +) +SELECT + work_order_number AS "工单号", + product_name AS "产品", + ROUND(planned_qty, 0) AS "计划数量", + ROUND(completed_qty, 0) AS "完成数量", + completion_rate AS "完成率(%)", + elapsed_hours AS "已用时间(小时)", + CASE + WHEN elapsed_hours > 48 AND completion_rate < 20 THEN '进度严重滞后' + WHEN elapsed_hours > 24 AND completion_rate < 30 THEN '进度滞后' + WHEN last_report_time IS NULL AND elapsed_hours > 24 THEN '无报工记录' + WHEN last_report_time IS NOT NULL + AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '报工停滞' + ELSE '正常' + END AS "异常类型", + CASE + WHEN elapsed_hours > 48 AND completion_rate < 20 THEN '立即跟进,排查生产瓶颈' + WHEN elapsed_hours > 24 AND completion_rate < 30 THEN '关注进度,协调资源' + WHEN last_report_time IS NULL AND elapsed_hours > 24 THEN '确认工单是否已开工' + WHEN last_report_time IS NOT NULL + AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24 THEN '跟进报工情况' + ELSE '-' + END AS "处理建议" +FROM work_order_anomaly +WHERE elapsed_hours > 24 AND completion_rate < 50 + OR (last_report_time IS NULL AND elapsed_hours > 24) + OR (last_report_time IS NOT NULL + AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - last_report_time)) / 3600 > 24) +ORDER BY + CASE + WHEN elapsed_hours > 48 AND completion_rate < 20 THEN 1 + WHEN elapsed_hours > 24 AND completion_rate < 30 THEN 2 + ELSE 3 + END, + completion_rate ASC; + + +-- ===================================================== +-- 补充查询3:产品类别执行进度汇总 +-- ===================================================== +SELECT + p.product_category AS "产品类别", + COUNT(*) AS "工单数", + SUM(CASE WHEN wo.status = 'OPEN' THEN 1 ELSE 0 END) AS "待生产", + SUM(CASE WHEN wo.status = 'STARTED' THEN 1 ELSE 0 END) AS "生产中", + SUM(CASE WHEN wo.status = 'CLOSED' THEN 1 ELSE 0 END) AS "已完成", + ROUND(SUM(wo.planned_qty), 0) AS "计划总量", + ROUND(SUM(wo.completed_qty), 0) AS "完成总量", + CASE WHEN SUM(wo.planned_qty) > 0 + THEN ROUND(SUM(wo.completed_qty) * 100.0 / SUM(wo.planned_qty), 1) + ELSE 0 END AS "整体完成率(%)" +FROM fact_work_order wo +LEFT JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' +GROUP BY p.product_category +ORDER BY "工单数" DESC; + + +-- ===================================================== +-- 补充查询4:工单执行时间线 +-- ===================================================== +WITH timeline AS ( + SELECT + wo.work_order_number, + p.product_name, + wo.status, + wo.event_time_utc::timestamp AS start_time, + wo.last_updated_utc::timestamp AS last_update, + CASE WHEN wo.status = 'CLOSED' + THEN ROUND(EXTRACT(EPOCH FROM (wo.last_updated_utc::timestamp - wo.event_time_utc::timestamp)) / 3600, 1) + ELSE ROUND(EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wo.event_time_utc::timestamp)) / 3600, 1) + END AS duration_hours, + wo.planned_qty, + wo.completed_qty + FROM fact_work_order wo + LEFT JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = 't' +) +SELECT + work_order_number AS "工单号", + product_name AS "产品", + CASE status + WHEN 'OPEN' THEN '待生产' + WHEN 'STARTED' THEN '生产中' + WHEN 'CLOSED' THEN '已完成' + END AS "状态", + TO_CHAR(start_time, 'YYYY-MM-DD HH24:MI') AS "开始时间", + TO_CHAR(last_update, 'YYYY-MM-DD HH24:MI') AS "最后更新", + duration_hours AS "持续时间(小时)", + ROUND(planned_qty, 0) AS "计划数量", + ROUND(completed_qty, 0) AS "完成数量", + CASE WHEN planned_qty > 0 + THEN ROUND(completed_qty * 100.0 / planned_qty, 1) + ELSE 0 END AS "完成率(%)" +FROM timeline +ORDER BY start_time DESC +LIMIT 50; + + +-- ===================================================== +-- 补充查询5:实时生产看板汇总 +-- ===================================================== +WITH current_stats AS ( + SELECT + COUNT(*) AS total_orders, + SUM(CASE WHEN status = 'OPEN' THEN 1 ELSE 0 END) AS open_orders, + SUM(CASE WHEN status = 'STARTED' THEN 1 ELSE 0 END) AS started_orders, + SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_orders, + SUM(planned_qty) AS total_planned, + SUM(completed_qty) AS total_completed + FROM fact_work_order +), +anomaly_stats AS ( + SELECT + COUNT(*) AS anomaly_count + FROM fact_work_order wo + WHERE wo.status = 'STARTED' + AND EXTRACT(EPOCH FROM (CURRENT_TIMESTAMP - wo.event_time_utc::timestamp)) / 3600 > 24 + AND wo.completed_qty * 100.0 / NULLIF(wo.planned_qty, 0) < 30 +), +today_stats AS ( + SELECT + COUNT(*) AS today_completed + FROM fact_work_order + WHERE status = 'CLOSED' + AND last_updated_utc::date = CURRENT_DATE +) +SELECT + '总工单数' AS "指标", + cs.total_orders::text AS "数值", + '-' AS "状态" +FROM current_stats cs +UNION ALL +SELECT + '待生产', + cs.open_orders::text, + CASE WHEN cs.open_orders > 20 THEN '积压' ELSE '正常' END +FROM current_stats cs +UNION ALL +SELECT + '生产中', + cs.started_orders::text, + '进行中' +FROM current_stats cs +UNION ALL +SELECT + '已完成', + cs.closed_orders::text, + '正常' +FROM current_stats cs +UNION ALL +SELECT + '整体完成率', + ROUND(cs.total_completed * 100.0 / NULLIF(cs.total_planned, 0), 1)::text || '%', + CASE + WHEN cs.total_completed * 100.0 / NULLIF(cs.total_planned, 0) >= 80 THEN '良好' + WHEN cs.total_completed * 100.0 / NULLIF(cs.total_planned, 0) >= 50 THEN '正常' + ELSE '偏低' + END +FROM current_stats cs +UNION ALL +SELECT + '异常工单数', + ans.anomaly_count::text, + CASE WHEN ans.anomaly_count > 5 THEN '需关注' ELSE '正常' END +FROM anomaly_stats ans +UNION ALL +SELECT + '今日完成', + ts.today_completed::text, + '-' +FROM today_stats ts; diff --git a/lzwcai_mcpskills_analyzeOrder/指标趋势分析与拐点预警.sql b/lzwcai_mcpskills_analyzeOrder/指标趋势分析与拐点预警.sql new file mode 100644 index 0000000..45f978d --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/指标趋势分析与拐点预警.sql @@ -0,0 +1,426 @@ +-- ===================================================== +-- 指标趋势分析与拐点预警SQL +-- Metric Trend Analysis and Turning Point Warning +-- 数据库: PostgreSQL +-- ===================================================== + +-- ===================================================== +-- 1. 日度指标基础数据 +-- ===================================================== +WITH daily_metrics AS ( + SELECT + DATE(lr.event_time_utc::timestamp) AS metric_date, + COUNT(DISTINCT lr.worker_name) AS worker_count, + SUM(lr.duration_minutes) / 60.0 AS total_hours, + SUM(lr.report_qty) AS total_output, + CASE WHEN SUM(lr.duration_minutes) > 0 + THEN SUM(lr.report_qty) / (SUM(lr.duration_minutes) / 60.0) + ELSE 0 END AS hourly_efficiency + FROM fact_labor_report lr + GROUP BY DATE(lr.event_time_utc::timestamp) +), + +daily_quality AS ( + SELECT + DATE(qi.event_time_utc::timestamp) AS metric_date, + SUM(qi.pass_qty) AS pass_qty, + SUM(qi.fail_qty) AS fail_qty, + CASE WHEN SUM(qi.pass_qty) + SUM(qi.fail_qty) > 0 + THEN SUM(qi.fail_qty) * 100.0 / (SUM(qi.pass_qty) + SUM(qi.fail_qty)) + ELSE 0 END AS defect_rate + FROM fact_quality_inspection qi + GROUP BY DATE(qi.event_time_utc::timestamp) +), + +daily_production AS ( + SELECT + DATE(wo.event_time_utc::timestamp) AS metric_date, + SUM(wo.planned_qty) AS planned_qty, + SUM(wo.completed_qty) AS completed_qty, + CASE WHEN SUM(wo.planned_qty) > 0 + THEN SUM(wo.completed_qty) * 100.0 / SUM(wo.planned_qty) + ELSE 0 END AS completion_rate + FROM fact_work_order wo + GROUP BY DATE(wo.event_time_utc::timestamp) +), + +combined_daily AS ( + SELECT + COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) AS metric_date, + COALESCE(dm.worker_count, 0) AS worker_count, + COALESCE(dm.total_hours, 0) AS total_hours, + COALESCE(dm.total_output, 0) AS total_output, + COALESCE(dm.hourly_efficiency, 0) AS hourly_efficiency, + COALESCE(dq.defect_rate, 0) AS defect_rate, + COALESCE(dp.completion_rate, 0) AS completion_rate + FROM daily_metrics dm + FULL OUTER JOIN daily_quality dq ON dm.metric_date = dq.metric_date + FULL OUTER JOIN daily_production dp ON dm.metric_date = dp.metric_date + WHERE COALESCE(dm.metric_date, dq.metric_date, dp.metric_date) IS NOT NULL +), + +numbered_data AS ( + SELECT + *, + ROW_NUMBER() OVER (ORDER BY metric_date) AS day_seq + FROM combined_daily +), + +-- ===================================================== +-- 2. 移动平均计算 (7日移动平均) +-- ===================================================== +moving_avg_step1 AS ( + SELECT + metric_date, + day_seq, + worker_count, + total_output, + hourly_efficiency, + defect_rate, + completion_rate, + AVG(hourly_efficiency) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_efficiency, + AVG(total_output) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_output, + AVG(defect_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_defect_rate, + AVG(completion_rate) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7_completion_rate, + AVG(day_seq) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS avg_x + FROM numbered_data +), + +moving_avg AS ( + SELECT + *, + LAG(ma7_efficiency, 1) OVER (ORDER BY metric_date) AS prev_ma7_efficiency, + LAG(ma7_output, 1) OVER (ORDER BY metric_date) AS prev_ma7_output, + LAG(ma7_defect_rate, 1) OVER (ORDER BY metric_date) AS prev_ma7_defect_rate + FROM moving_avg_step1 +), + +-- ===================================================== +-- 3. 简化的趋势斜率计算 +-- ===================================================== +slope_calc AS ( + SELECT + *, + (ma7_efficiency - LAG(ma7_efficiency, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_efficiency, + (ma7_output - LAG(ma7_output, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_output, + (ma7_defect_rate - LAG(ma7_defect_rate, 3) OVER (ORDER BY metric_date)) / 3.0 AS slope_defect + FROM moving_avg +), + +-- ===================================================== +-- 4. 趋势判断与异常检测 +-- ===================================================== +trend_analysis AS ( + SELECT + metric_date, + hourly_efficiency, + total_output, + defect_rate, + completion_rate, + ROUND(ma7_efficiency, 2) AS ma7_efficiency, + ROUND(ma7_output, 2) AS ma7_output, + ROUND(ma7_defect_rate, 2) AS ma7_defect_rate, + ROUND(COALESCE(slope_efficiency, 0), 4) AS slope_efficiency, + ROUND(COALESCE(slope_output, 0), 4) AS slope_output, + ROUND(COALESCE(slope_defect, 0), 4) AS slope_defect, + prev_ma7_efficiency, + prev_ma7_output, + prev_ma7_defect_rate, + + CASE + WHEN COALESCE(slope_efficiency, 0) > 0.3 THEN 'RISING' + WHEN COALESCE(slope_efficiency, 0) < -0.3 THEN 'FALLING' + ELSE 'STABLE' + END AS efficiency_trend, + + CASE + WHEN COALESCE(slope_output, 0) > 3 THEN 'RISING' + WHEN COALESCE(slope_output, 0) < -3 THEN 'FALLING' + ELSE 'STABLE' + END AS output_trend, + + CASE + WHEN COALESCE(slope_defect, 0) > 0.3 THEN 'RISING' + WHEN COALESCE(slope_defect, 0) < -0.3 THEN 'FALLING' + ELSE 'STABLE' + END AS defect_trend, + + CASE + WHEN ma7_efficiency > 0 AND ABS(hourly_efficiency - ma7_efficiency) > ma7_efficiency * 0.3 THEN 'ANOMALY' + ELSE 'NORMAL' + END AS efficiency_status, + + CASE + WHEN ma7_output > 0 AND ABS(total_output - ma7_output) > ma7_output * 0.3 THEN 'ANOMALY' + ELSE 'NORMAL' + END AS output_status, + + CASE + WHEN defect_rate > ma7_defect_rate * 1.5 AND defect_rate > 5 THEN 'ANOMALY' + ELSE 'NORMAL' + END AS defect_status + + FROM slope_calc +) + +-- ===================================================== +-- 输出:日度趋势分析明细 +-- ===================================================== +SELECT + metric_date, + ROUND(hourly_efficiency, 2) AS hourly_output, + ma7_efficiency AS efficiency_ma7, + slope_efficiency, + efficiency_trend, + efficiency_status, + CASE + WHEN prev_ma7_efficiency IS NOT NULL + AND ma7_efficiency > prev_ma7_efficiency AND slope_efficiency < 0 THEN 'TURNING_POINT' + WHEN prev_ma7_efficiency IS NOT NULL + AND ma7_efficiency < prev_ma7_efficiency AND slope_efficiency > 0 THEN 'TURNING_POINT' + ELSE 'NONE' + END AS efficiency_turning_point, + ROUND(total_output, 0) AS daily_output, + ma7_output AS output_ma7, + slope_output, + output_trend, + output_status, + CASE + WHEN prev_ma7_output IS NOT NULL + AND ma7_output > prev_ma7_output AND slope_output < 0 THEN 'TURNING_POINT' + WHEN prev_ma7_output IS NOT NULL + AND ma7_output < prev_ma7_output AND slope_output > 0 THEN 'TURNING_POINT' + ELSE 'NONE' + END AS output_turning_point, + ROUND(defect_rate, 2) AS defect_rate, + ma7_defect_rate AS defect_rate_ma7, + slope_defect, + defect_trend, + defect_status, + CASE + WHEN prev_ma7_defect_rate IS NOT NULL + AND ma7_defect_rate > prev_ma7_defect_rate AND slope_defect < 0 THEN 'TURNING_POINT' + WHEN prev_ma7_defect_rate IS NOT NULL + AND ma7_defect_rate < prev_ma7_defect_rate AND slope_defect > 0 THEN 'TURNING_POINT' + ELSE 'NONE' + END AS defect_turning_point +FROM trend_analysis +ORDER BY metric_date DESC; + + +-- ===================================================== +-- 补充查询1:周度趋势汇总 +-- ===================================================== +WITH weekly_metrics AS ( + SELECT + DATE_TRUNC('week', lr.event_time_utc::timestamp)::date AS week_start, + COUNT(DISTINCT lr.worker_name) AS worker_count, + SUM(lr.duration_minutes) / 60.0 AS total_hours, + SUM(lr.report_qty) AS total_output, + CASE WHEN SUM(lr.duration_minutes) > 0 + THEN SUM(lr.report_qty) / (SUM(lr.duration_minutes) / 60.0) + ELSE 0 END AS hourly_efficiency + FROM fact_labor_report lr + GROUP BY DATE_TRUNC('week', lr.event_time_utc::timestamp) +), +weekly_quality AS ( + SELECT + DATE_TRUNC('week', qi.event_time_utc::timestamp)::date AS week_start, + SUM(qi.fail_qty) * 100.0 / NULLIF(SUM(qi.pass_qty) + SUM(qi.fail_qty), 0) AS defect_rate + FROM fact_quality_inspection qi + GROUP BY DATE_TRUNC('week', qi.event_time_utc::timestamp) +), +weekly_combined AS ( + SELECT + wm.week_start, + wm.worker_count, + wm.total_hours, + wm.total_output, + wm.hourly_efficiency, + COALESCE(wq.defect_rate, 0) AS defect_rate + FROM weekly_metrics wm + LEFT JOIN weekly_quality wq ON wm.week_start = wq.week_start +), +weekly_with_lag AS ( + SELECT + *, + LAG(hourly_efficiency, 1) OVER (ORDER BY week_start) AS prev_efficiency, + LAG(total_output, 1) OVER (ORDER BY week_start) AS prev_output, + LAG(defect_rate, 1) OVER (ORDER BY week_start) AS prev_defect_rate + FROM weekly_combined +) +SELECT + week_start, + worker_count, + ROUND(total_hours, 1) AS total_hours, + ROUND(total_output, 0) AS total_output, + ROUND(hourly_efficiency, 2) AS hourly_output, + ROUND(defect_rate, 2) AS defect_rate, + CASE + WHEN prev_efficiency IS NULL THEN 'NONE' + WHEN hourly_efficiency > prev_efficiency * 1.1 THEN 'RISING' + WHEN hourly_efficiency < prev_efficiency * 0.9 THEN 'FALLING' + ELSE 'STABLE' + END AS efficiency_trend, + CASE + WHEN prev_output IS NULL THEN 'NONE' + WHEN total_output > prev_output * 1.1 THEN 'RISING' + WHEN total_output < prev_output * 0.9 THEN 'FALLING' + ELSE 'STABLE' + END AS output_trend, + CASE + WHEN prev_defect_rate IS NULL THEN 'NONE' + WHEN defect_rate > prev_defect_rate * 1.2 THEN 'RISING' + WHEN defect_rate < prev_defect_rate * 0.8 THEN 'FALLING' + ELSE 'STABLE' + END AS defect_trend, + ROUND((hourly_efficiency - COALESCE(prev_efficiency, hourly_efficiency)) / NULLIF(prev_efficiency, 0) * 100, 1) AS efficiency_wow_pct +FROM weekly_with_lag +ORDER BY week_start DESC; + + +-- ===================================================== +-- 补充查询2:指标趋势汇总报告 +-- ===================================================== +WITH +recent_data AS ( + SELECT + DATE(lr.event_time_utc::timestamp) AS metric_date, + SUM(lr.report_qty) / NULLIF(SUM(lr.duration_minutes) / 60.0, 0) AS hourly_efficiency, + SUM(lr.report_qty) AS total_output + FROM fact_labor_report lr + WHERE lr.event_time_utc::timestamp >= CURRENT_DATE - INTERVAL '14 days' + GROUP BY DATE(lr.event_time_utc::timestamp) +), +recent_quality AS ( + SELECT + DATE(qi.event_time_utc::timestamp) AS metric_date, + SUM(qi.fail_qty) * 100.0 / NULLIF(SUM(qi.pass_qty) + SUM(qi.fail_qty), 0) AS defect_rate + FROM fact_quality_inspection qi + WHERE qi.event_time_utc::timestamp >= CURRENT_DATE - INTERVAL '14 days' + GROUP BY DATE(qi.event_time_utc::timestamp) +), +period_stats AS ( + SELECT + AVG(CASE WHEN rd.metric_date >= CURRENT_DATE - INTERVAL '7 days' THEN rd.hourly_efficiency END) AS avg_eff_7d, + AVG(CASE WHEN rd.metric_date >= CURRENT_DATE - INTERVAL '7 days' THEN rd.total_output END) AS avg_output_7d, + AVG(CASE WHEN rd.metric_date < CURRENT_DATE - INTERVAL '7 days' THEN rd.hourly_efficiency END) AS avg_eff_prev7d, + AVG(CASE WHEN rd.metric_date < CURRENT_DATE - INTERVAL '7 days' THEN rd.total_output END) AS avg_output_prev7d + FROM recent_data rd +), +quality_stats AS ( + SELECT + AVG(CASE WHEN rq.metric_date >= CURRENT_DATE - INTERVAL '7 days' THEN rq.defect_rate END) AS avg_defect_7d, + AVG(CASE WHEN rq.metric_date < CURRENT_DATE - INTERVAL '7 days' THEN rq.defect_rate END) AS avg_defect_prev7d + FROM recent_quality rq +) +SELECT + 'efficiency_per_hour' AS metric_name, + ROUND(ps.avg_eff_7d, 2) AS last_7d_avg, + ROUND(ps.avg_eff_prev7d, 2) AS prev_7d_avg, + ROUND((ps.avg_eff_7d - ps.avg_eff_prev7d) / NULLIF(ps.avg_eff_prev7d, 0) * 100, 1) AS change_rate_pct, + CASE + WHEN ps.avg_eff_7d > ps.avg_eff_prev7d * 1.05 THEN 'RISING' + WHEN ps.avg_eff_7d < ps.avg_eff_prev7d * 0.95 THEN 'FALLING' + ELSE 'STABLE' + END AS trend, + CASE + WHEN ABS(ps.avg_eff_7d - ps.avg_eff_prev7d) / NULLIF(ps.avg_eff_prev7d, 0) > 0.2 THEN 'ANOMALY' + ELSE 'NORMAL' + END AS warning +FROM period_stats ps + +UNION ALL + +SELECT + 'daily_output', + ROUND(ps.avg_output_7d, 0), + ROUND(ps.avg_output_prev7d, 0), + ROUND((ps.avg_output_7d - ps.avg_output_prev7d) / NULLIF(ps.avg_output_prev7d, 0) * 100, 1), + CASE + WHEN ps.avg_output_7d > ps.avg_output_prev7d * 1.05 THEN 'RISING' + WHEN ps.avg_output_7d < ps.avg_output_prev7d * 0.95 THEN 'FALLING' + ELSE 'STABLE' + END, + CASE + WHEN ABS(ps.avg_output_7d - ps.avg_output_prev7d) / NULLIF(ps.avg_output_prev7d, 0) > 0.2 THEN 'ANOMALY' + ELSE 'NORMAL' + END +FROM period_stats ps + +UNION ALL + +SELECT + 'defect_rate_pct', + ROUND(qs.avg_defect_7d, 2), + ROUND(qs.avg_defect_prev7d, 2), + ROUND((qs.avg_defect_7d - qs.avg_defect_prev7d) / NULLIF(qs.avg_defect_prev7d, 0) * 100, 1), + CASE + WHEN qs.avg_defect_7d > qs.avg_defect_prev7d * 1.1 THEN 'RISING' + WHEN qs.avg_defect_7d < qs.avg_defect_prev7d * 0.9 THEN 'FALLING' + ELSE 'STABLE' + END, + CASE + WHEN qs.avg_defect_7d > 8 THEN 'THRESHOLD_EXCEEDED' + WHEN qs.avg_defect_7d > qs.avg_defect_prev7d * 1.3 THEN 'ANOMALY_RISING' + ELSE 'NORMAL' + END +FROM quality_stats qs; + + +-- ===================================================== +-- 补充查询3:拐点预警汇总 +-- ===================================================== +WITH daily_eff AS ( + SELECT + DATE(lr.event_time_utc::timestamp) AS metric_date, + SUM(lr.report_qty) / NULLIF(SUM(lr.duration_minutes) / 60.0, 0) AS hourly_efficiency + FROM fact_labor_report lr + GROUP BY DATE(lr.event_time_utc::timestamp) +), +with_ma_step1 AS ( + SELECT + metric_date, + hourly_efficiency, + AVG(hourly_efficiency) OVER (ORDER BY metric_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS ma7 + FROM daily_eff +), +with_ma AS ( + SELECT + metric_date, + hourly_efficiency, + ma7, + LAG(ma7, 1) OVER (ORDER BY metric_date) AS prev_ma7, + LAG(ma7, 2) OVER (ORDER BY metric_date) AS prev2_ma7 + FROM with_ma_step1 +), +turning_points AS ( + SELECT + metric_date, + hourly_efficiency, + ma7, + prev_ma7, + prev2_ma7, + CASE + WHEN prev2_ma7 IS NOT NULL + AND prev_ma7 < prev2_ma7 AND ma7 > prev_ma7 THEN 'UPWARD' + WHEN prev2_ma7 IS NOT NULL + AND prev_ma7 > prev2_ma7 AND ma7 < prev_ma7 THEN 'DOWNWARD' + ELSE NULL + END AS turning_type + FROM with_ma +) +SELECT + metric_date, + ROUND(hourly_efficiency, 2) AS daily_efficiency, + ROUND(ma7, 2) AS ma7_line, + turning_type, + CASE + WHEN turning_type = 'UPWARD' THEN 'MAINTAIN_CURRENT_MEASURES' + WHEN turning_type = 'DOWNWARD' THEN 'INVESTIGATE_AND_IMPROVE' + ELSE 'NONE' + END AS recommendation +FROM turning_points +WHERE turning_type IS NOT NULL +ORDER BY metric_date DESC +LIMIT 10; diff --git a/lzwcai_mcpskills_analyzeOrder/订单延迟预警分析.sql b/lzwcai_mcpskills_analyzeOrder/订单延迟预警分析.sql new file mode 100644 index 0000000..77fc5b5 --- /dev/null +++ b/lzwcai_mcpskills_analyzeOrder/订单延迟预警分析.sql @@ -0,0 +1,154 @@ +-- 订单延迟预警分析(最终优化版) +-- Order Delay Warning Analysis +WITH +-- 1. 历史生产周期统计(全局平均,仅统计已完成工单) +production_cycle_stats AS ( + SELECT + COALESCE( + AVG( + GREATEST(0, EXTRACT(DAY FROM last_updated_utc - event_time_utc)) + ), + 0 + ) AS avg_production_days + FROM fact_work_order + WHERE status = 'CLOSED' + AND last_updated_utc >= event_time_utc +), + +-- 2. 物流延误统计(按客户维度) +logistics_delay_stats AS ( + SELECT + customer_id, + AVG( + GREATEST(0, EXTRACT(DAY FROM event_time_utc - doc_date_utc)) + ) AS avg_logistics_delay_days, + SUM( + CASE WHEN EXTRACT(DAY FROM event_time_utc - doc_date_utc) > 3 + THEN 1 ELSE 0 END + ) AS delay_count + FROM fact_sales_shipment + WHERE doc_date_utc IS NOT NULL + AND event_time_utc IS NOT NULL + GROUP BY customer_id +), + +-- 3. 质量问题统计(全局平均) +quality_issue_stats AS ( + SELECT + COALESCE( + ROUND( + SUM(fail_qty) * 100.0 / NULLIF(SUM(pass_qty + fail_qty), 0), + 2 + ), + 0 + ) AS defect_rate_pct + FROM fact_quality_inspection + WHERE pass_qty IS NOT NULL + AND fail_qty IS NOT NULL +), + +-- 4. 报废率(全局) +scrap_stats AS ( + SELECT + COALESCE( + (SELECT COUNT(*) FROM fact_scrap) * 100.0 / + NULLIF((SELECT COUNT(*) FROM fact_work_order WHERE status = 'CLOSED'), 0), + 0 + ) AS scrap_rate_pct +), + +-- 5. 当前生产滞后风险(全局) +active_work_order_risk AS ( + SELECT + COUNT(*) AS active_wo_count, + COALESCE( + SUM( + CASE + WHEN planned_qty > 0 + AND (completed_qty / planned_qty) < 0.3 + AND EXTRACT(DAY FROM NOW() - event_time_utc) > 7 + THEN 1 + ELSE 0 + END + ), + 0 + ) AS lagging_wo_count + FROM fact_work_order + WHERE status IN ('OPEN', 'STARTED') +), + +-- 6. 合并全局指标为单行 +global_metrics AS ( + SELECT + pcs.avg_production_days, + qis.defect_rate_pct, + ss.scrap_rate_pct, + awr.active_wo_count, + awr.lagging_wo_count + FROM production_cycle_stats pcs, + quality_issue_stats qis, + scrap_stats ss, + active_work_order_risk awr +) + +-- 主查询 +SELECT + so.sales_order_number AS order_number, + c.customer_name AS customer_name, + so.order_date_utc::DATE AS order_date, + so.deal_amount AS order_amount, + so.payment_status AS payment_status, + + -- 风险指标 + ROUND(gm.avg_production_days::NUMERIC, 1) AS avg_production_days, + ROUND(COALESCE(lds.avg_logistics_delay_days, 0)::NUMERIC, 1) AS avg_logistics_delay_days, + COALESCE(lds.delay_count, 0)::INT AS historical_delay_count, + ROUND(gm.defect_rate_pct::NUMERIC, 2) AS defect_rate_pct, + ROUND(gm.scrap_rate_pct::NUMERIC, 2) AS scrap_rate_pct, + gm.active_wo_count::INT AS active_work_order_count, + gm.lagging_wo_count::INT AS lagging_work_order_count, + + -- 延迟概率计算 + ROUND( + LEAST(100, GREATEST(0, + LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + + LEAST(25, gm.defect_rate_pct * 2.5) + + LEAST(20, gm.lagging_wo_count * 10) + ))::NUMERIC, 1 + ) AS delay_probability_pct, + + -- 预警等级 + CASE + WHEN ( + LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + + LEAST(25, gm.defect_rate_pct * 2.5) + + LEAST(20, gm.lagging_wo_count * 10) + ) >= 60 THEN 'RED' + WHEN ( + LEAST(25, GREATEST(0, gm.avg_production_days - 10) * 2.5) + + LEAST(30, COALESCE(lds.avg_logistics_delay_days, 0) * 6) + + LEAST(25, gm.defect_rate_pct * 2.5) + + LEAST(20, gm.lagging_wo_count * 10) + ) >= 30 THEN 'YELLOW' + ELSE 'GREEN' + END AS warning_level, + + -- 主要风险因素 + CASE + WHEN gm.lagging_wo_count >= 2 THEN 'PRODUCTION_SEVERELY_DELAYED' + WHEN COALESCE(lds.avg_logistics_delay_days, 0) > 5 THEN 'HIGH_LOGISTICS_DELAY_RISK' + WHEN gm.avg_production_days > 15 THEN 'LONG_PRODUCTION_CYCLE' + WHEN gm.defect_rate_pct > 10 THEN 'QUALITY_ISSUES' + ELSE 'NORMAL' + END AS primary_risk_factor + +FROM fact_sales_order so +LEFT JOIN dim_customer c + ON so.customer_id = c.customer_id + AND c.is_current = 't' +CROSS JOIN global_metrics gm +LEFT JOIN logistics_delay_stats lds + ON so.customer_id = lds.customer_id +ORDER BY delay_probability_pct DESC, so.order_date_utc DESC; diff --git a/lzwcai_mcpskills_analyzeWorkOrder/README.md b/lzwcai_mcpskills_analyzeWorkOrder/README.md index dd1d1dc..e4bc0ac 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/README.md +++ b/lzwcai_mcpskills_analyzeWorkOrder/README.md @@ -1,4 +1,4 @@ -# lzwcai-mcpskills-analyzeWorkOrder +# lzwcai-mcpskills-analyzeOrder 一个基于 MCP (Model Context Protocol) 的 SQL 查询执行服务器,支持从 JSON 配置文件动态生成查询工具。 @@ -14,7 +14,7 @@ ### 使用 pip 安装 ```bash -pip install lzwcai-mcpskills-analyzeWorkOrder +pip install lzwcai-mcpskills-analyzeOrder ``` ### 从源码安装 @@ -28,7 +28,7 @@ pip install -e . ### 使用 uv 安装(推荐) ```bash -uv pip install lzwcai-mcpskills-analyzeWorkOrder +uv pip install lzwcai-mcpskills-analyzeOrder ``` ## 使用方法 @@ -38,7 +38,7 @@ uv pip install lzwcai-mcpskills-analyzeWorkOrder 安装后,可以直接通过命令启动: ```bash -lzwcai-mcpskills-analyzeWorkOrder +lzwcai-mcpskills-analyzeOrder ``` ### 作为 Python 模块运行 @@ -55,7 +55,7 @@ python -m lzwcai_mcp_sqlexecutor.main { "mcpServers": { "lzwcai-sqlexecutor": { - "command": "lzwcai-mcpskills-analyzeWorkOrder" + "command": "lzwcai-mcpskills-analyzeOrder" } } } diff --git a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/__init__.py b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/__init__.py index 4798f49..3e52bf0 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/__init__.py +++ b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/__init__.py @@ -1,5 +1,5 @@ """ -lzwcai-mcpskills-analyzeWorkOrder - MCP server for executing business SQL queries +lzwcai-mcpskills-analyzeOrder - MCP server for executing business SQL queries """ __version__ = "0.1.2" diff --git a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json index 2b30e05..a180e7e 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json +++ b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json @@ -1,37 +1,4 @@ [ - { - "id": "2006300000000000000", - "businessName": "QueryList", - "businessDescription": "查询所有工单列表,返回fact_work_order表的全部数据", - "datasourceId": "19", - "sqlTemplate": "SELECT * FROM fact_work_order", - "parameters": {} - }, - { - "id": "2006300000000000004", - "businessName": "WorkOrderDetail", - "businessDescription": "根据工单编号查询工单详情,包括工单基本信息、产品信息、委外供应商、工艺路线等", - "datasourceId": "19", - "sqlTemplate": "SELECT wo.work_order_id, wo.work_order_number, wo.status, wo.planned_qty, wo.completed_qty, wo.operation_good_qty, wo.operation_bad_qty, wo.qc_good_qty, wo.qc_bad_qty, wo.source_doc_number, wo.event_time_utc, p.product_code, p.product_name, p.product_spec, s.supplier_name, r.routing_name FROM fact_work_order wo LEFT JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = true LEFT JOIN dim_supplier s ON wo.supplier_id = s.supplier_id AND s.is_current = true LEFT JOIN dim_routing r ON wo.routing_id = r.routing_id AND r.is_current = true WHERE wo.work_order_number = '{workOrderNumber}'", - "parameters": { - "workOrderNumber": { - "type": "string", - "description": "工单编号", - "required": true, - "examples": [ - "WO1311343859" - ] - } - } - }, - { - "id": "2006300000000000005", - "businessName": "WorkOrderProgressDashboard", - "businessDescription": "工单执行进度与异常节点看板,展示工单完工进度、工序良率、质检良率、异常标识等关键监控指标", - "datasourceId": "19", - "sqlTemplate": "WITH work_order_progress AS (SELECT wo.work_order_number, wo.status AS work_order_status, wo.planned_qty, wo.completed_qty, wo.operation_good_qty, wo.operation_bad_qty, wo.qc_good_qty, wo.qc_bad_qty, wo.source_doc_number AS sales_order_number, wo.event_time_utc, p.product_code, p.product_name, CASE WHEN wo.planned_qty > 0 THEN ROUND(wo.completed_qty * 100.0 / wo.planned_qty, 2) ELSE 0 END AS completion_pct, CASE WHEN (wo.operation_good_qty + wo.operation_bad_qty) > 0 THEN ROUND(wo.operation_good_qty * 100.0 / (wo.operation_good_qty + wo.operation_bad_qty), 2) ELSE NULL END AS operation_yield_pct, CASE WHEN (wo.qc_good_qty + wo.qc_bad_qty) > 0 THEN ROUND(wo.qc_good_qty * 100.0 / (wo.qc_good_qty + wo.qc_bad_qty), 2) ELSE NULL END AS qc_yield_pct FROM fact_work_order wo LEFT JOIN dim_product p ON wo.product_id = p.product_id AND p.is_current = true), task_summary AS (SELECT work_order_number, COUNT(*) AS total_tasks, SUM(CASE WHEN actual_end_time_utc IS NOT NULL THEN 1 ELSE 0 END) AS completed_tasks, SUM(CASE WHEN actual_start_time_utc IS NOT NULL AND actual_end_time_utc IS NULL THEN 1 ELSE 0 END) AS in_progress_tasks, SUM(CASE WHEN actual_start_time_utc IS NULL THEN 1 ELSE 0 END) AS pending_tasks, SUM(bad_qty) AS total_bad_qty FROM fact_operation_task GROUP BY work_order_number), labor_summary AS (SELECT work_order_number, SUM(report_qty) AS total_report_qty, SUM(good_qty) AS total_good_qty, SUM(bad_qty) AS total_bad_qty, SUM(duration_minutes) AS total_work_minutes FROM fact_labor_report GROUP BY work_order_number), qc_summary AS (SELECT work_order_number, COUNT(*) AS qc_record_count, SUM(pass_qty) AS total_pass_qty, SUM(fail_qty) AS total_fail_qty FROM fact_quality_inspection WHERE work_order_number IS NOT NULL GROUP BY work_order_number) SELECT wp.work_order_number, wp.product_code, wp.product_name, wp.sales_order_number, wp.work_order_status, wp.planned_qty, wp.completed_qty, wp.completion_pct, COALESCE(ts.total_tasks, 0) AS total_tasks, COALESCE(ts.completed_tasks, 0) AS completed_tasks, COALESCE(ts.in_progress_tasks, 0) AS in_progress_tasks, COALESCE(ts.pending_tasks, 0) AS pending_tasks, COALESCE(ls.total_report_qty, 0) AS total_report_qty, COALESCE(ls.total_work_minutes, 0) AS total_work_minutes, wp.operation_yield_pct, wp.qc_yield_pct, COALESCE(qc.total_pass_qty, 0) AS qc_pass_qty, COALESCE(qc.total_fail_qty, 0) AS qc_fail_qty, CASE WHEN wp.completion_pct < 50 AND wp.work_order_status = 'STARTED' THEN 'PROGRESS_DELAY' WHEN wp.operation_yield_pct < 90 THEN 'OPERATION_YIELD_ABNORMAL' WHEN wp.qc_yield_pct < 95 THEN 'QC_YIELD_ABNORMAL' WHEN ts.total_bad_qty > 0 THEN 'HAS_DEFECTS' ELSE 'NORMAL' END AS abnormal_flag, wp.event_time_utc AS last_update_time FROM work_order_progress wp LEFT JOIN task_summary ts ON wp.work_order_number = ts.work_order_number LEFT JOIN labor_summary ls ON wp.work_order_number = ls.work_order_number LEFT JOIN qc_summary qc ON wp.work_order_number = qc.work_order_number ORDER BY CASE wp.work_order_status WHEN 'STARTED' THEN 1 WHEN 'RELEASED' THEN 2 WHEN 'PLANNED' THEN 3 ELSE 4 END, wp.event_time_utc DESC", - "parameters": {} - }, { "id": "2006300000000000006", "businessName": "SalesOrderList", @@ -64,13 +31,5 @@ "datasourceId": "19", "sqlTemplate": "WITH global_production AS (SELECT COUNT(*) AS total_wo_count, AVG(CASE WHEN planned_qty > 0 THEN completed_qty / planned_qty ELSE 0 END) AS avg_completion_rate, SUM(CASE WHEN status IN ('OPEN', 'STARTED') THEN 1 ELSE 0 END) AS pending_wo_count, SUM(CASE WHEN status = 'CLOSED' THEN 1 ELSE 0 END) AS closed_wo_count FROM fact_work_order), global_quality AS (SELECT COUNT(*) AS total_inspection_count, SUM(COALESCE(pass_qty, 0)) AS total_pass_qty, SUM(COALESCE(fail_qty, 0)) AS total_fail_qty, CASE WHEN SUM(COALESCE(pass_qty, 0) + COALESCE(fail_qty, 0)) > 0 THEN SUM(COALESCE(pass_qty, 0))::FLOAT / SUM(COALESCE(pass_qty, 0) + COALESCE(fail_qty, 0)) ELSE 1 END AS qc_pass_rate FROM fact_quality_inspection), global_operation AS (SELECT COUNT(*) AS total_task_count, SUM(COALESCE(good_qty, 0)) AS total_good_qty, SUM(COALESCE(bad_qty, 0)) AS total_bad_qty, CASE WHEN SUM(COALESCE(good_qty, 0) + COALESCE(bad_qty, 0)) > 0 THEN SUM(COALESCE(bad_qty, 0))::FLOAT / SUM(COALESCE(good_qty, 0) + COALESCE(bad_qty, 0)) ELSE 0 END AS operation_defect_rate FROM fact_operation_task), customer_shipment AS (SELECT customer_id, COUNT(*) AS shipment_count, SUM(COALESCE(amount, 0)) AS total_shipment_amount FROM fact_sales_shipment GROUP BY customer_id), customer_return AS (SELECT customer_id, COUNT(*) AS return_count, SUM(COALESCE(amount, 0)) AS total_return_amount FROM fact_sales_return GROUP BY customer_id), order_risk AS (SELECT so.sales_order_id, so.sales_order_number, c.customer_name, so.order_date_utc, so.deal_amount, so.payment_status, gp.avg_completion_rate AS production_completion_rate, gp.pending_wo_count, gp.total_wo_count AS work_order_count, gq.qc_pass_rate, gq.total_fail_qty, go.operation_defect_rate, COALESCE(cs.shipment_count, 0) AS shipment_count, COALESCE(cr.return_count, 0) AS return_count, CASE WHEN COALESCE(cs.shipment_count, 0) > 0 THEN COALESCE(cr.return_count, 0)::FLOAT / cs.shipment_count ELSE 0 END AS return_rate FROM fact_sales_order so LEFT JOIN dim_customer c ON so.customer_id = c.customer_id AND c.is_current = true CROSS JOIN global_production gp CROSS JOIN global_quality gq CROSS JOIN global_operation go LEFT JOIN customer_shipment cs ON so.customer_id = cs.customer_id LEFT JOIN customer_return cr ON so.customer_id = cr.customer_id) SELECT sales_order_id, sales_order_number, customer_name, order_date_utc, deal_amount, payment_status, work_order_count, ROUND(production_completion_rate::NUMERIC, 2) AS production_completion_rate, pending_wo_count, ROUND(qc_pass_rate::NUMERIC, 2) AS qc_pass_rate, ROUND(operation_defect_rate::NUMERIC, 4) AS operation_defect_rate, return_count, ROUND(return_rate::NUMERIC, 4) AS return_rate, ROUND((CASE WHEN production_completion_rate < 0.3 THEN 0.30 WHEN production_completion_rate < 0.5 THEN 0.20 WHEN production_completion_rate < 0.8 THEN 0.10 ELSE 0 END + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 WHEN qc_pass_rate < 0.9 THEN 0.15 WHEN qc_pass_rate < 0.95 THEN 0.08 ELSE 0 END + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 WHEN operation_defect_rate > 0.05 THEN 0.12 WHEN operation_defect_rate > 0.02 THEN 0.05 ELSE 0 END + CASE WHEN return_rate > 0.1 THEN 0.15 WHEN return_rate > 0.05 THEN 0.08 WHEN return_rate > 0.02 THEN 0.03 ELSE 0 END + CASE WHEN payment_status = 'UNPAID' THEN 0.10 WHEN payment_status = 'PARTIAL' THEN 0.05 ELSE 0 END)::NUMERIC, 2) AS delay_probability, CASE WHEN (CASE WHEN production_completion_rate < 0.3 THEN 0.30 WHEN production_completion_rate < 0.5 THEN 0.20 WHEN production_completion_rate < 0.8 THEN 0.10 ELSE 0 END + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 WHEN qc_pass_rate < 0.9 THEN 0.15 WHEN qc_pass_rate < 0.95 THEN 0.08 ELSE 0 END + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 WHEN operation_defect_rate > 0.05 THEN 0.12 WHEN operation_defect_rate > 0.02 THEN 0.05 ELSE 0 END + CASE WHEN return_rate > 0.1 THEN 0.15 WHEN return_rate > 0.05 THEN 0.08 WHEN return_rate > 0.02 THEN 0.03 ELSE 0 END + CASE WHEN payment_status = 'UNPAID' THEN 0.10 WHEN payment_status = 'PARTIAL' THEN 0.05 ELSE 0 END) >= 0.50 THEN 'RED' WHEN (CASE WHEN production_completion_rate < 0.3 THEN 0.30 WHEN production_completion_rate < 0.5 THEN 0.20 WHEN production_completion_rate < 0.8 THEN 0.10 ELSE 0 END + CASE WHEN qc_pass_rate < 0.8 THEN 0.25 WHEN qc_pass_rate < 0.9 THEN 0.15 WHEN qc_pass_rate < 0.95 THEN 0.08 ELSE 0 END + CASE WHEN operation_defect_rate > 0.1 THEN 0.20 WHEN operation_defect_rate > 0.05 THEN 0.12 WHEN operation_defect_rate > 0.02 THEN 0.05 ELSE 0 END + CASE WHEN return_rate > 0.1 THEN 0.15 WHEN return_rate > 0.05 THEN 0.08 WHEN return_rate > 0.02 THEN 0.03 ELSE 0 END + CASE WHEN payment_status = 'UNPAID' THEN 0.10 WHEN payment_status = 'PARTIAL' THEN 0.05 ELSE 0 END) >= 0.25 THEN 'YELLOW' ELSE 'GREEN' END AS risk_level, CONCAT_WS(' | ', CASE WHEN production_completion_rate < 0.5 THEN '生产进度滞后' END, CASE WHEN qc_pass_rate < 0.9 THEN '质检通过率低' END, CASE WHEN operation_defect_rate > 0.05 THEN '工序不良率高' END, CASE WHEN return_rate > 0.05 THEN '历史退货率高' END, CASE WHEN payment_status = 'UNPAID' THEN '未付款' END) AS risk_reasons FROM order_risk ORDER BY delay_probability DESC, deal_amount DESC", "parameters": {} - }, - { - "id": "2006300000000000009", - "businessName": "DepartmentEfficiencyDashboard", - "businessDescription": "部门人效产值损耗三维仪表盘:关联订单量×工时×人员数×成本,构建人效—产值—损耗三维模型,按部门汇总展示", - "datasourceId": "19", - "sqlTemplate": "WITH order_summary AS (SELECT COUNT(DISTINCT so.sales_order_id) AS total_order_count, SUM(COALESCE(so.deal_amount, 0)) AS total_order_amount FROM fact_sales_order so), labor_by_dept AS (SELECT p.department, COUNT(DISTINCT lr.worker_name) AS worker_count, SUM(COALESCE(lr.duration_minutes, 0)) AS total_work_minutes, SUM(COALESCE(lr.report_qty, 0)) AS total_report_qty, SUM(COALESCE(lr.good_qty, 0)) AS total_good_qty, SUM(COALESCE(lr.bad_qty, 0)) AS total_bad_qty FROM fact_labor_report lr LEFT JOIN dim_person p ON lr.worker_name = p.person_name AND p.is_current = true GROUP BY p.department), work_order_output AS (SELECT p.department, SUM(COALESCE(wo.completed_qty, 0)) AS completed_qty, SUM(COALESCE(wo.operation_bad_qty, 0)) AS operation_bad_qty, SUM(COALESCE(wo.qc_bad_qty, 0)) AS qc_bad_qty, COUNT(DISTINCT wo.work_order_id) AS work_order_count FROM fact_work_order wo LEFT JOIN dim_person p ON wo.production_manager_id = p.person_id AND p.is_current = true GROUP BY p.department), scrap_by_dept AS (SELECT p.department, COUNT(*) AS scrap_count FROM fact_scrap s LEFT JOIN dim_person p ON s.operator_id = p.person_id AND p.is_current = true GROUP BY p.department), qc_by_dept AS (SELECT p.department, SUM(COALESCE(qi.pass_qty, 0)) AS qc_pass_qty, SUM(COALESCE(qi.fail_qty, 0)) AS qc_fail_qty FROM fact_quality_inspection qi LEFT JOIN dim_person p ON qi.inspector_id = p.person_id AND p.is_current = true GROUP BY p.department) SELECT COALESCE(ld.department, '未分配') AS department, os.total_order_count, os.total_order_amount, COALESCE(ld.worker_count, 0) AS worker_count, COALESCE(ld.total_work_minutes, 0) AS total_work_minutes, ROUND(COALESCE(ld.total_work_minutes, 0) / 60.0, 2) AS total_work_hours, COALESCE(ld.total_report_qty, 0) AS total_report_qty, COALESCE(ld.total_good_qty, 0) AS total_good_qty, COALESCE(ld.total_bad_qty, 0) AS labor_bad_qty, COALESCE(wo.completed_qty, 0) AS completed_qty, COALESCE(wo.work_order_count, 0) AS work_order_count, COALESCE(wo.operation_bad_qty, 0) AS operation_bad_qty, COALESCE(wo.qc_bad_qty, 0) AS qc_bad_qty, COALESCE(sc.scrap_count, 0) AS scrap_count, COALESCE(qc.qc_pass_qty, 0) AS qc_pass_qty, COALESCE(qc.qc_fail_qty, 0) AS qc_fail_qty, CASE WHEN COALESCE(ld.worker_count, 0) > 0 THEN ROUND(COALESCE(ld.total_report_qty, 0)::NUMERIC / ld.worker_count, 2) ELSE 0 END AS output_per_worker, CASE WHEN COALESCE(ld.total_work_minutes, 0) > 0 THEN ROUND(COALESCE(ld.total_report_qty, 0)::NUMERIC * 60 / ld.total_work_minutes, 2) ELSE 0 END AS output_per_hour, CASE WHEN COALESCE(ld.worker_count, 0) > 0 THEN ROUND(os.total_order_amount::NUMERIC / ld.worker_count, 2) ELSE 0 END AS order_value_per_worker, CASE WHEN (COALESCE(ld.total_good_qty, 0) + COALESCE(ld.total_bad_qty, 0)) > 0 THEN ROUND(COALESCE(ld.total_good_qty, 0)::NUMERIC * 100 / (ld.total_good_qty + ld.total_bad_qty), 2) ELSE 100 END AS labor_yield_pct, CASE WHEN (COALESCE(qc.qc_pass_qty, 0) + COALESCE(qc.qc_fail_qty, 0)) > 0 THEN ROUND(COALESCE(qc.qc_pass_qty, 0)::NUMERIC * 100 / (qc.qc_pass_qty + qc.qc_fail_qty), 2) ELSE 100 END AS qc_yield_pct, COALESCE(ld.total_bad_qty, 0) + COALESCE(wo.operation_bad_qty, 0) + COALESCE(wo.qc_bad_qty, 0) + COALESCE(qc.qc_fail_qty, 0) AS total_loss_qty, CASE WHEN COALESCE(ld.worker_count, 0) > 0 AND COALESCE(ld.total_work_minutes, 0) > 0 AND (COALESCE(ld.total_good_qty, 0) + COALESCE(ld.total_bad_qty, 0)) > 0 THEN CASE WHEN (COALESCE(ld.total_report_qty, 0)::NUMERIC / ld.worker_count) >= 100 AND (COALESCE(ld.total_report_qty, 0)::NUMERIC * 60 / ld.total_work_minutes) >= 10 AND (COALESCE(ld.total_good_qty, 0)::NUMERIC * 100 / (ld.total_good_qty + ld.total_bad_qty)) >= 95 THEN 'EXCELLENT' WHEN (COALESCE(ld.total_report_qty, 0)::NUMERIC / ld.worker_count) >= 50 AND (COALESCE(ld.total_report_qty, 0)::NUMERIC * 60 / ld.total_work_minutes) >= 5 AND (COALESCE(ld.total_good_qty, 0)::NUMERIC * 100 / (ld.total_good_qty + ld.total_bad_qty)) >= 90 THEN 'GOOD' ELSE 'NEEDS_IMPROVEMENT' END ELSE 'NO_DATA' END AS efficiency_rating FROM labor_by_dept ld CROSS JOIN order_summary os LEFT JOIN work_order_output wo ON ld.department = wo.department LEFT JOIN scrap_by_dept sc ON ld.department = sc.department LEFT JOIN qc_by_dept qc ON ld.department = qc.department ORDER BY total_report_qty DESC", - "parameters": {} } ] \ No newline at end of file diff --git a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/main.py b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/main.py index 0607ec1..07f4694 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/main.py +++ b/lzwcai_mcpskills_analyzeWorkOrder/lzwcai_mcpskills_analyzeWorkOrder/main.py @@ -94,7 +94,7 @@ def generate_tool_schema_from_query(query: dict) -> types.Tool: # 创建 MCP 服务器实例 -server = Server("lzwcai-mcpskills-analyzeWorkOrder") +server = Server("lzwcai-mcpskills-analyzeOrder") # 缓存查询配置,避免重复加载 _queries_cache = None @@ -311,7 +311,7 @@ async def async_main(): """MCP 服务器异步主函数""" try: mcp_logger.info("=" * 60) - mcp_logger.info("正在启动 MCP 服务器: lzwcai-mcpskills-analyzeWorkOrder") + mcp_logger.info("正在启动 MCP 服务器: lzwcai-mcpskills-analyzeOrder") mcp_logger.info("版本: 0.1.0") mcp_logger.info("=" * 60) @@ -332,7 +332,7 @@ async def async_main(): read_stream, write_stream, InitializationOptions( - server_name="lzwcai-mcpskills-analyzeWorkOrder", + server_name="lzwcai-mcpskills-analyzeOrder", server_version="0.1.0", capabilities=server.get_capabilities( notification_options=NotificationOptions(), diff --git a/lzwcai_mcpskills_analyzeWorkOrder/main.py b/lzwcai_mcpskills_analyzeWorkOrder/main.py index 5b16dc8..015f7d0 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/main.py +++ b/lzwcai_mcpskills_analyzeWorkOrder/main.py @@ -1,5 +1,5 @@ """ -Entry point for lzwcai-mcpskills-analyzeWorkOrder +Entry point for lzwcai-mcpskills-analyzeOrder Runs the MCP server for SQL query execution """ import os @@ -9,5 +9,5 @@ os.environ["datasourceId"] = "19" os.environ["backendBaseUrl"] = "http://192.168.11.24:8088" if __name__ == "__main__": # Import and run the actual MCP server - from lzwcai_mcpskills_analyzeWorkOrder.main import main + from lzwcai_mcpskills_analyzeOrder.main import main main() diff --git a/lzwcai_mcpskills_analyzeWorkOrder/pyproject.toml b/lzwcai_mcpskills_analyzeWorkOrder/pyproject.toml index 06bad03..0f9a2b3 100644 --- a/lzwcai_mcpskills_analyzeWorkOrder/pyproject.toml +++ b/lzwcai_mcpskills_analyzeWorkOrder/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "lzwcai-mcpskills-analyzeWorkOrder" +name = "lzwcai-mcpskills-analyzeOrder" version = "0.1.12" description = "MCP server for executing business SQL queries with dynamic tool generation" readme = "README.md" @@ -26,10 +26,10 @@ dependencies = [ ] [project.scripts] -lzwcai-mcpskills-analyzeWorkOrder = "lzwcai_mcpskills_analyzeWorkOrder.main:main" +lzwcai-mcpskills-analyzeOrder = "lzwcai_mcpskills_analyzeOrder.main:main" [tool.hatch.build.targets.wheel] -packages = ["lzwcai_mcpskills_analyzeWorkOrder"] +packages = ["lzwcai_mcpskills_analyzeOrder"] [tool.hatch.build.targets.wheel.force-include] -"lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json" = "lzwcai_mcpskills_analyzeWorkOrder/businessQueries.json" +"lzwcai_mcpskills_analyzeOrder/businessQueries.json" = "lzwcai_mcpskills_analyzeOrder/businessQueries.json" diff --git a/server.log b/server.log new file mode 100644 index 0000000..a6cda93 --- /dev/null +++ b/server.log @@ -0,0 +1,6 @@ +{"level":30,"time":1767795873541,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"config>{\"host\":\"192.168.11.24\",\"user\":\"postgres\",\"password\":\"******\",\"database\":\"manufacturing_data_model_v1_0_0\",\"port\":5432}"} +{"level":30,"time":1767795873541,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"MySQL MCP server running on stdio"} +{"level":50,"time":1767796119331,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"List tables failed","sql":"SHOW TABLES","error":"connect ETIMEDOUT"} +{"level":50,"time":1767797249666,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"Describe table failed","sql":"DESCRIBE ??","params":["fact_work_order"],"error":"connect ETIMEDOUT"} +{"level":50,"time":1767797265187,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"Describe table failed","sql":"DESCRIBE ??","params":["fact_sales_order"],"error":"connect ETIMEDOUT"} +{"level":50,"time":1767797277193,"pid":31816,"hostname":"MICROSO-UUDM3QK","msg":"Describe table failed","sql":"DESCRIBE ??","params":["fact_sales_shipment"],"error":"connect ETIMEDOUT"} diff --git a/sql/dim_bom.json b/sql/dim_bom.json new file mode 100644 index 0000000..fbcc20f --- /dev/null +++ b/sql/dim_bom.json @@ -0,0 +1,342 @@ +[ + { + "bom_id": 1, + "bom_number": "BOM67148266", + "bom_topic": "BOM Topic 0", + "is_primary": "f", + "level_number": 1, + "product_code": "4904724113571", + "unit_usage_qty": 6.77, + "uom_code": "pcs", + "supplier_name": null, + "remark": "谢谢有限运行大小希望什么女人.", + "source_system": null, + "row_valid_from": "3/12/2025 04:38:26.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 2, + "bom_number": "BOM41843358", + "bom_topic": "BOM Topic 1", + "is_primary": "f", + "level_number": 3, + "product_code": "7404817071704", + "unit_usage_qty": 3.15, + "uom_code": "pcs", + "supplier_name": null, + "remark": "联系时候首页功能到了人民包括方面.", + "source_system": null, + "row_valid_from": "18/12/2025 13:59:24.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 3, + "bom_number": "BOM98209951", + "bom_topic": "BOM Topic 2", + "is_primary": "f", + "level_number": 2, + "product_code": "2371469356556", + "unit_usage_qty": 5.85, + "uom_code": "pcs", + "supplier_name": null, + "remark": "一种感觉只是都是程序上海.", + "source_system": null, + "row_valid_from": "19/12/2025 21:41:57.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 4, + "bom_number": "BOM54567090", + "bom_topic": "BOM Topic 3", + "is_primary": "t", + "level_number": 2, + "product_code": "7246071817298", + "unit_usage_qty": 8.79, + "uom_code": "pcs", + "supplier_name": null, + "remark": "市场会员或者是一可是.", + "source_system": null, + "row_valid_from": "11/12/2025 15:22:25.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 5, + "bom_number": "BOM15469037", + "bom_topic": "BOM Topic 4", + "is_primary": "f", + "level_number": 1, + "product_code": "7756777017088", + "unit_usage_qty": 6.14, + "uom_code": "pcs", + "supplier_name": null, + "remark": "说明电脑工作但是语言组织.", + "source_system": null, + "row_valid_from": "8/12/2025 09:21:49.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 6, + "bom_number": "BOM38789955", + "bom_topic": "BOM Topic 5", + "is_primary": "f", + "level_number": 2, + "product_code": "2173642523324", + "unit_usage_qty": 4.84, + "uom_code": "pcs", + "supplier_name": null, + "remark": "次数安全产品的话空间其他.", + "source_system": null, + "row_valid_from": "18/12/2025 01:14:37.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 7, + "bom_number": "BOM44892173", + "bom_topic": "BOM Topic 6", + "is_primary": "f", + "level_number": 2, + "product_code": "9233722353722", + "unit_usage_qty": 1.57, + "uom_code": "pcs", + "supplier_name": null, + "remark": "功能学校产品应用大小原因然后.", + "source_system": null, + "row_valid_from": "21/12/2025 09:40:17.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 8, + "bom_number": "BOM57810577", + "bom_topic": "BOM Topic 7", + "is_primary": "t", + "level_number": 3, + "product_code": "2849807988474", + "unit_usage_qty": 8.68, + "uom_code": "pcs", + "supplier_name": null, + "remark": "评论全国他们全部我的那些.", + "source_system": null, + "row_valid_from": "24/12/2025 15:29:21.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 9, + "bom_number": "BOM85135415", + "bom_topic": "BOM Topic 8", + "is_primary": "f", + "level_number": 1, + "product_code": "4018893752094", + "unit_usage_qty": 5.04, + "uom_code": "pcs", + "supplier_name": null, + "remark": "企业根据学习事情公司情况.", + "source_system": null, + "row_valid_from": "25/12/2025 04:09:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 10, + "bom_number": "BOM58635315", + "bom_topic": "BOM Topic 9", + "is_primary": "f", + "level_number": 1, + "product_code": "3787077152814", + "unit_usage_qty": 7.67, + "uom_code": "pcs", + "supplier_name": null, + "remark": "这种作为中国来自特别记者方面.", + "source_system": null, + "row_valid_from": "5/12/2025 22:01:43.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 11, + "bom_number": "BOM32942034", + "bom_topic": "BOM Topic 10", + "is_primary": "t", + "level_number": 1, + "product_code": "5034750643502", + "unit_usage_qty": 4.85, + "uom_code": "pcs", + "supplier_name": null, + "remark": "起来增加拥有威望.", + "source_system": null, + "row_valid_from": "15/12/2025 00:41:03.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 12, + "bom_number": "BOM67116698", + "bom_topic": "BOM Topic 11", + "is_primary": "f", + "level_number": 1, + "product_code": "2935355176842", + "unit_usage_qty": 9.43, + "uom_code": "pcs", + "supplier_name": null, + "remark": "当然解决觉得次数过程汽车.", + "source_system": null, + "row_valid_from": "12/12/2025 13:59:04.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 13, + "bom_number": "BOM57413843", + "bom_topic": "BOM Topic 12", + "is_primary": "t", + "level_number": 1, + "product_code": "3334503439324", + "unit_usage_qty": 9.5, + "uom_code": "pcs", + "supplier_name": null, + "remark": "功能应该情况市场有关是一查看.", + "source_system": null, + "row_valid_from": "6/12/2025 11:45:45.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 14, + "bom_number": "BOM57164230", + "bom_topic": "BOM Topic 13", + "is_primary": "t", + "level_number": 1, + "product_code": "3717251229322", + "unit_usage_qty": 2.43, + "uom_code": "pcs", + "supplier_name": null, + "remark": "中国方式电脑情况使用以及那些积分.", + "source_system": null, + "row_valid_from": "30/11/2025 05:27:42.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 15, + "bom_number": "BOM93108369", + "bom_topic": "BOM Topic 14", + "is_primary": "f", + "level_number": 3, + "product_code": "5567459110483", + "unit_usage_qty": 3.52, + "uom_code": "pcs", + "supplier_name": null, + "remark": "直接企业发展一点.", + "source_system": null, + "row_valid_from": "2/12/2025 08:37:40.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 16, + "bom_number": "BOM11354551", + "bom_topic": "BOM Topic 15", + "is_primary": "f", + "level_number": 1, + "product_code": "4219806010724", + "unit_usage_qty": 5.7, + "uom_code": "pcs", + "supplier_name": null, + "remark": "法律使用同时工作名称应该.", + "source_system": null, + "row_valid_from": "8/12/2025 15:00:03.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 17, + "bom_number": "BOM81835936", + "bom_topic": "BOM Topic 16", + "is_primary": "f", + "level_number": 1, + "product_code": "6664882480851", + "unit_usage_qty": 1.75, + "uom_code": "pcs", + "supplier_name": null, + "remark": "而且音乐大学是否本站国内.", + "source_system": null, + "row_valid_from": "1/12/2025 19:09:50.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 18, + "bom_number": "BOM50885655", + "bom_topic": "BOM Topic 17", + "is_primary": "t", + "level_number": 2, + "product_code": "8442282024091", + "unit_usage_qty": 5.72, + "uom_code": "pcs", + "supplier_name": null, + "remark": "设备设备政府到了时间.", + "source_system": null, + "row_valid_from": "7/12/2025 14:54:51.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 19, + "bom_number": "BOM33362097", + "bom_topic": "BOM Topic 18", + "is_primary": "f", + "level_number": 2, + "product_code": "9499708203973", + "unit_usage_qty": 9.05, + "uom_code": "pcs", + "supplier_name": null, + "remark": "不同然后当前或者其实城市.", + "source_system": null, + "row_valid_from": "13/12/2025 17:05:21.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "bom_id": 20, + "bom_number": "BOM26137367", + "bom_topic": "BOM Topic 19", + "is_primary": "t", + "level_number": 3, + "product_code": "6791611168077", + "unit_usage_qty": 5.75, + "uom_code": "pcs", + "supplier_name": null, + "remark": "方面数据那么免费.", + "source_system": null, + "row_valid_from": "25/12/2025 05:34:17.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_contract.json b/sql/dim_contract.json new file mode 100644 index 0000000..30a151f --- /dev/null +++ b/sql/dim_contract.json @@ -0,0 +1,542 @@ +[ + { + "contract_id": 3, + "contract_number": "CTR81660784", + "contract_name": "更多联系加入或者.合同", + "customer_name": null, + "contract_amount": 684365.31, + "order_time_utc": "18/12/2025 00:04:21.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "27/11/2025 18:52:59.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 4, + "contract_number": "CTR44307806", + "contract_name": "的话美国.合同", + "customer_name": null, + "contract_amount": 97780.58, + "order_time_utc": "6/12/2025 20:41:45.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "23/12/2025 14:55:12.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 5, + "contract_number": "CTR58345859", + "contract_name": "国际组织.合同", + "customer_name": null, + "contract_amount": 252590.8, + "order_time_utc": "22/12/2025 19:13:20.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "4/12/2025 05:51:48.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 6, + "contract_number": "CTR17278314", + "contract_name": "名称为了发布.合同", + "customer_name": null, + "contract_amount": 707451.78, + "order_time_utc": "11/12/2025 06:31:45.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "21/12/2025 08:48:42.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 7, + "contract_number": "CTR98700043", + "contract_name": "支持经营资源.合同", + "customer_name": null, + "contract_amount": 969842.7, + "order_time_utc": "4/12/2025 09:11:28.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "5/12/2025 16:14:59.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 8, + "contract_number": "CTR22254085", + "contract_name": "的话任何.合同", + "customer_name": null, + "contract_amount": 904551.51, + "order_time_utc": "2/12/2025 01:32:08.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "21/12/2025 05:03:27.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 9, + "contract_number": "CTR7590087", + "contract_name": "只有然后一个.合同", + "customer_name": null, + "contract_amount": 35986.23, + "order_time_utc": "24/12/2025 01:57:14.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "10/12/2025 06:43:42.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 10, + "contract_number": "CTR5777267", + "contract_name": "原因位置一些.合同", + "customer_name": null, + "contract_amount": 529490.38, + "order_time_utc": "27/11/2025 13:49:57.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "27/11/2025 02:14:05.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 11, + "contract_number": "CTR67862033", + "contract_name": "孩子用户.合同", + "customer_name": null, + "contract_amount": 530066.09, + "order_time_utc": "18/12/2025 06:58:22.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "13/12/2025 21:13:10.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 12, + "contract_number": "CTR60857461", + "contract_name": "可是.合同", + "customer_name": null, + "contract_amount": 415796.85, + "order_time_utc": "4/12/2025 04:38:37.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "30/11/2025 23:47:38.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 13, + "contract_number": "CTR80556762", + "contract_name": "对于包括.合同", + "customer_name": null, + "contract_amount": 731515.19, + "order_time_utc": "14/12/2025 14:00:18.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "7/12/2025 14:48:40.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 14, + "contract_number": "CTR98887875", + "contract_name": "社区数据.合同", + "customer_name": null, + "contract_amount": 622814.77, + "order_time_utc": "6/12/2025 10:52:49.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "14/12/2025 13:06:31.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 15, + "contract_number": "CTR6024758", + "contract_name": "空间一切.合同", + "customer_name": null, + "contract_amount": 724038.19, + "order_time_utc": "4/12/2025 03:02:50.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "9/12/2025 02:28:13.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 16, + "contract_number": "CTR25809063", + "contract_name": "资源以后.合同", + "customer_name": null, + "contract_amount": 536320.63, + "order_time_utc": "7/12/2025 11:53:48.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "27/11/2025 06:18:16.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "contract_id": 17, + "contract_number": "CTR96148770", + "contract_name": "业务继续上海.合同", + "customer_name": null, + "contract_amount": 694490.64, + "order_time_utc": "8/12/2025 08:18:33.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "8/12/2025 08:52:05.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 18, + "contract_number": "CTR13885019", + "contract_name": "然后信息学校那么.合同", + "customer_name": null, + "contract_amount": 982606.97, + "order_time_utc": "22/12/2025 04:50:54.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "17/12/2025 22:04:41.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 19, + "contract_number": "CTR37965955", + "contract_name": "朋友能够工具.合同", + "customer_name": null, + "contract_amount": 130765.57, + "order_time_utc": "16/12/2025 09:49:04.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "12/12/2025 23:28:13.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 20, + "contract_number": "CTR98917999", + "contract_name": "不会成功.合同", + "customer_name": null, + "contract_amount": 870232.96, + "order_time_utc": "12/12/2025 01:29:33.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "9/12/2025 14:02:34.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 21, + "contract_number": "CTR28931818", + "contract_name": "查看其实用户.合同", + "customer_name": null, + "contract_amount": 482313.74, + "order_time_utc": "5/12/2025 05:53:42.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "20/12/2025 22:05:19.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 22, + "contract_number": "CTR31758458", + "contract_name": "为了情况公司以下.合同", + "customer_name": null, + "contract_amount": 974632.67, + "order_time_utc": "13/12/2025 16:19:05.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "13/12/2025 11:08:38.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 23, + "contract_number": "CTR5209037", + "contract_name": "发展中文结果没有.合同", + "customer_name": null, + "contract_amount": 159419.49, + "order_time_utc": "15/12/2025 19:30:03.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "21/12/2025 16:46:58.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 24, + "contract_number": "CTR8945482", + "contract_name": "经济.合同", + "customer_name": null, + "contract_amount": 420611.41, + "order_time_utc": "23/12/2025 12:06:27.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "10/12/2025 05:38:43.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 25, + "contract_number": "CTR83820527", + "contract_name": "文章其他一起.合同", + "customer_name": null, + "contract_amount": 253462.37, + "order_time_utc": "15/12/2025 23:04:26.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "2/12/2025 05:18:41.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 26, + "contract_number": "CTR61523978", + "contract_name": "上海注意孩子.合同", + "customer_name": null, + "contract_amount": 121050.22, + "order_time_utc": "2/12/2025 14:15:52.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "1/12/2025 07:34:11.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 27, + "contract_number": "CTR65179592", + "contract_name": "以上由于非常增加.合同", + "customer_name": null, + "contract_amount": 42397.07, + "order_time_utc": "21/12/2025 10:58:39.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "8/12/2025 08:44:14.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 28, + "contract_number": "CTR97766433", + "contract_name": "注意只要.合同", + "customer_name": null, + "contract_amount": 755586.05, + "order_time_utc": "30/11/2025 01:04:06.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "23/12/2025 21:57:28.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 29, + "contract_number": "CTR29842586", + "contract_name": "电子科技.合同", + "customer_name": null, + "contract_amount": 953952.46, + "order_time_utc": "3/12/2025 02:58:31.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "6/12/2025 12:59:10.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 30, + "contract_number": "CTR86826586", + "contract_name": "首页有些完成.合同", + "customer_name": null, + "contract_amount": 790563.49, + "order_time_utc": "5/12/2025 22:28:07.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "12/12/2025 03:57:44.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 31, + "contract_number": "CTR82104791", + "contract_name": "电脑文件日期的话.合同", + "customer_name": null, + "contract_amount": 33884.69, + "order_time_utc": "22/12/2025 10:05:14.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "13/12/2025 08:17:54.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "contract_id": 2, + "contract_number": "CTR43151130", + "contract_name": "教育觉得.合同", + "customer_name": "华泰通安科技有限公司", + "contract_amount": 532915.76, + "order_time_utc": "4/12/2025 10:57:23.-1f+00", + "paid_amount": null, + "unpaid_amount": null, + "stage": null, + "result": null, + "contract_type": null, + "source_system": null, + "row_valid_from": "30/11/2025 10:50:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_customer.json b/sql/dim_customer.json new file mode 100644 index 0000000..23a4f48 --- /dev/null +++ b/sql/dim_customer.json @@ -0,0 +1,382 @@ +[ + { + "customer_id": 2, + "customer_name": "华泰通安科技有限公司", + "customer_source": "线下", + "phone": "13583837573", + "telephone": null, + "email": "guiying96@example.net", + "customer_level": null, + "industry": null, + "address": "湖南省阜新县牧野福州路A座 948012", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "19/12/2025 03:38:06.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 3, + "customer_name": "海创网络有限公司", + "customer_source": "线下", + "phone": "18957536746", + "telephone": null, + "email": "zzhang@example.com", + "customer_level": null, + "industry": null, + "address": "海南省莉市海陵彭路l座 290465", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "30/11/2025 18:29:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 4, + "customer_name": "菊风公司信息有限公司", + "customer_source": "线下", + "phone": "13504075265", + "telephone": null, + "email": "xia54@example.com", + "customer_level": null, + "industry": null, + "address": "辽宁省邯郸市淄川兴城路p座 565507", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "20/12/2025 06:40:06.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 5, + "customer_name": "盟新科技有限公司", + "customer_source": "线下", + "phone": "15814141145", + "telephone": null, + "email": "momin@example.com", + "customer_level": null, + "industry": null, + "address": "四川省太原市崇文乌鲁木齐街c座 701509", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "17/12/2025 08:45:29.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 6, + "customer_name": "四通传媒有限公司", + "customer_source": "线下", + "phone": "13715663646", + "telephone": null, + "email": "taosun@example.com", + "customer_level": null, + "industry": null, + "address": "贵州省桂荣市魏都尹路N座 263707", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "20/12/2025 17:27:20.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 7, + "customer_name": "飞海科技传媒有限公司", + "customer_source": "线下", + "phone": "13938217533", + "telephone": null, + "email": "jingzou@example.com", + "customer_level": null, + "industry": null, + "address": "河南省台北市大兴张街O座 373438", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "5/12/2025 01:40:19.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 8, + "customer_name": "易动力科技有限公司", + "customer_source": "线上", + "phone": "13872486621", + "telephone": null, + "email": "oqian@example.com", + "customer_level": null, + "industry": null, + "address": "河南省阜新市合川卢路o座 600090", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "11/12/2025 11:41:23.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 9, + "customer_name": "MBP软件网络有限公司", + "customer_source": "线上", + "phone": "15684801530", + "telephone": null, + "email": "qiufang@example.net", + "customer_level": null, + "industry": null, + "address": "福建省澳门市城东陈路K座 792594", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "29/11/2025 22:23:16.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 10, + "customer_name": "鑫博腾飞信息有限公司", + "customer_source": "线上", + "phone": "18503391590", + "telephone": null, + "email": "lixia@example.org", + "customer_level": null, + "industry": null, + "address": "广东省六安县长寿丁街f座 479607", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "11/12/2025 15:03:47.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 11, + "customer_name": "同兴万点传媒有限公司", + "customer_source": "推荐", + "phone": "15005909274", + "telephone": null, + "email": "ming77@example.net", + "customer_level": null, + "industry": null, + "address": "上海市畅县黄浦潮州路Z座 168305", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "27/11/2025 06:37:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "customer_id": 12, + "customer_name": "浦华众城信息有限公司", + "customer_source": "推荐", + "phone": "13436637029", + "telephone": null, + "email": "qiaofang@example.com", + "customer_level": null, + "industry": null, + "address": "澳门特别行政区梧州市大兴潮州街H座 920472", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "23/12/2025 17:30:53.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 13, + "customer_name": "华成育卓信息有限公司", + "customer_source": "线上", + "phone": "18668177887", + "telephone": null, + "email": "guotao@example.com", + "customer_level": null, + "industry": null, + "address": "山西省玉梅市怀柔胡路a座 437143", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "21/12/2025 00:30:52.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 14, + "customer_name": "双敏电子网络有限公司", + "customer_source": "线上", + "phone": "13556032093", + "telephone": null, + "email": "mingong@example.com", + "customer_level": null, + "industry": null, + "address": "山西省阜新县滨城何路o座 127755", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "8/12/2025 01:41:03.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 15, + "customer_name": "华成育卓网络有限公司", + "customer_source": "线上", + "phone": "18853534189", + "telephone": null, + "email": "qtan@example.org", + "customer_level": null, + "industry": null, + "address": "云南省林市淄川陈街m座 800035", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "30/11/2025 07:30:18.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 16, + "customer_name": "信诚致远网络有限公司", + "customer_source": "线上", + "phone": "18851352720", + "telephone": null, + "email": "dren@example.net", + "customer_level": null, + "industry": null, + "address": "山东省广州市璧山赵路U座 774845", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "18/12/2025 05:06:12.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 17, + "customer_name": "毕博诚传媒有限公司", + "customer_source": "线下", + "phone": "18865747212", + "telephone": null, + "email": "pinggao@example.com", + "customer_level": null, + "industry": null, + "address": "河北省北镇市魏都哈尔滨路N座 310652", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "11/12/2025 18:21:02.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 18, + "customer_name": "合联电子科技有限公司", + "customer_source": "推荐", + "phone": "13526318565", + "telephone": null, + "email": "guiyingwei@example.org", + "customer_level": null, + "industry": null, + "address": "内蒙古自治区静县普陀南京街W座 344461", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "23/12/2025 00:02:08.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 19, + "customer_name": "诺依曼软件科技有限公司", + "customer_source": "线下", + "phone": "13356911559", + "telephone": null, + "email": "minxue@example.net", + "customer_level": null, + "industry": null, + "address": "新疆维吾尔自治区阜新市东城邯郸街O座 159144", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "2/12/2025 05:55:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 20, + "customer_name": "襄樊地球村科技有限公司", + "customer_source": "推荐", + "phone": "18249985760", + "telephone": null, + "email": "jhan@example.net", + "customer_level": null, + "industry": null, + "address": "重庆市昆明市高港张路U座 962119", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "3/12/2025 01:41:25.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "customer_id": 21, + "customer_name": "新宇龙信息传媒有限公司", + "customer_source": "线下", + "phone": "15988906811", + "telephone": null, + "email": "mochao@example.com", + "customer_level": null, + "industry": null, + "address": "海南省玉珍市永川袁街r座 604856", + "is_locked": null, + "deal_status": null, + "last_follow_up_time_utc": null, + "source_system": null, + "row_valid_from": "22/12/2025 18:33:48.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_equipment.json b/sql/dim_equipment.json new file mode 100644 index 0000000..68e6d22 --- /dev/null +++ b/sql/dim_equipment.json @@ -0,0 +1,102 @@ +[ + { + "equipment_id": 1, + "equipment_number": "EQ4092", + "equipment_name": "设备 0", + "source_system": null, + "row_valid_from": "13/12/2025 11:51:05.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 2, + "equipment_number": "EQ2399", + "equipment_name": "设备 1", + "source_system": null, + "row_valid_from": "26/11/2025 19:49:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 3, + "equipment_number": "EQ4938", + "equipment_name": "设备 2", + "source_system": null, + "row_valid_from": "24/12/2025 01:48:18.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 4, + "equipment_number": "EQ2339", + "equipment_name": "设备 3", + "source_system": null, + "row_valid_from": "12/12/2025 05:56:50.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 5, + "equipment_number": "EQ9168", + "equipment_name": "设备 4", + "source_system": null, + "row_valid_from": "18/12/2025 03:40:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 6, + "equipment_number": "EQ79", + "equipment_name": "设备 5", + "source_system": null, + "row_valid_from": "13/12/2025 11:39:15.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 7, + "equipment_number": "EQ7709", + "equipment_name": "设备 6", + "source_system": null, + "row_valid_from": "25/12/2025 05:33:52.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 8, + "equipment_number": "EQ267", + "equipment_name": "设备 7", + "source_system": null, + "row_valid_from": "19/12/2025 10:48:53.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 9, + "equipment_number": "EQ8412", + "equipment_name": "设备 8", + "source_system": null, + "row_valid_from": "17/12/2025 23:27:19.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "equipment_id": 10, + "equipment_number": "EQ6494", + "equipment_name": "设备 9", + "source_system": null, + "row_valid_from": "16/12/2025 06:33:13.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_operation.json b/sql/dim_operation.json new file mode 100644 index 0000000..eed78a6 --- /dev/null +++ b/sql/dim_operation.json @@ -0,0 +1,122 @@ +[ + { + "operation_id": 1, + "operation_number": "OP0", + "operation_name": "组装", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "12/12/2025 21:08:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 2, + "operation_number": "OP10", + "operation_name": "测试", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "12/12/2025 18:31:51.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 3, + "operation_number": "OP20", + "operation_name": "测试", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "6/12/2025 22:57:16.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 4, + "operation_number": "OP30", + "operation_name": "焊接", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "28/11/2025 18:46:36.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 5, + "operation_number": "OP40", + "operation_name": "切割", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "22/12/2025 05:31:31.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 6, + "operation_number": "OP50", + "operation_name": "组装", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "28/11/2025 21:37:44.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 7, + "operation_number": "OP60", + "operation_name": "切割", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "11/12/2025 17:31:04.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 8, + "operation_number": "OP70", + "operation_name": "焊接", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "21/12/2025 15:06:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 9, + "operation_number": "OP80", + "operation_name": "测试", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "1/12/2025 06:01:40.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "operation_id": 10, + "operation_number": "OP90", + "operation_name": "包装", + "report_permission": "ALL", + "report_ratio": 1.0, + "source_system": null, + "row_valid_from": "16/12/2025 15:42:26.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_person.json b/sql/dim_person.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/sql/dim_person.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sql/dim_product.json b/sql/dim_product.json new file mode 100644 index 0000000..615170f --- /dev/null +++ b/sql/dim_product.json @@ -0,0 +1,962 @@ +[ + { + "product_id": 2, + "product_code": "7659126892780", + "product_name": "怎么产品", + "product_spec": "92x16mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 34.0, + "safety_stock_qty": null, + "max_stock_qty": 945.0, + "source_system": null, + "row_valid_from": "23/12/2025 02:44:20.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 3, + "product_code": "8039953217571", + "product_name": "这样产品", + "product_spec": "90x74mm", + "product_category": "化工", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 44.0, + "safety_stock_qty": null, + "max_stock_qty": 911.0, + "source_system": null, + "row_valid_from": "10/12/2025 11:41:20.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 4, + "product_code": "3638245508677", + "product_name": "能够产品", + "product_spec": "94x49mm", + "product_category": "化工", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 10.0, + "safety_stock_qty": null, + "max_stock_qty": 525.0, + "source_system": null, + "row_valid_from": "16/12/2025 17:47:25.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 5, + "product_code": "7532736476482", + "product_name": "地方产品", + "product_spec": "98x96mm", + "product_category": "化工", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 20.0, + "safety_stock_qty": null, + "max_stock_qty": 672.0, + "source_system": null, + "row_valid_from": "21/12/2025 13:06:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 6, + "product_code": "9870194561288", + "product_name": "或者产品", + "product_spec": "52x44mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 13.0, + "safety_stock_qty": null, + "max_stock_qty": 928.0, + "source_system": null, + "row_valid_from": "24/12/2025 23:41:10.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 7, + "product_code": "5958126470076", + "product_name": "类型产品", + "product_spec": "35x63mm", + "product_category": "机械", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 47.0, + "safety_stock_qty": null, + "max_stock_qty": 540.0, + "source_system": null, + "row_valid_from": "29/11/2025 12:30:43.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 8, + "product_code": "6000417247214", + "product_name": "选择产品", + "product_spec": "17x41mm", + "product_category": "化工", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 11.0, + "safety_stock_qty": null, + "max_stock_qty": 856.0, + "source_system": null, + "row_valid_from": "14/12/2025 12:04:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 9, + "product_code": "2049246368404", + "product_name": "影响产品", + "product_spec": "84x65mm", + "product_category": "机械", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 15.0, + "safety_stock_qty": null, + "max_stock_qty": 786.0, + "source_system": null, + "row_valid_from": "16/12/2025 17:48:38.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 10, + "product_code": "5102629212767", + "product_name": "两个产品", + "product_spec": "16x73mm", + "product_category": "机械", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 19.0, + "safety_stock_qty": null, + "max_stock_qty": 529.0, + "source_system": null, + "row_valid_from": "13/12/2025 04:51:01.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 11, + "product_code": "2970356760935", + "product_name": "这么产品", + "product_spec": "26x100mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 19.0, + "safety_stock_qty": null, + "max_stock_qty": 595.0, + "source_system": null, + "row_valid_from": "5/12/2025 21:56:11.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 12, + "product_code": "7040071637975", + "product_name": "应用产品", + "product_spec": "53x88mm", + "product_category": "机械", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 38.0, + "safety_stock_qty": null, + "max_stock_qty": 897.0, + "source_system": null, + "row_valid_from": "10/12/2025 09:59:45.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 13, + "product_code": "0879421094505", + "product_name": "的话产品", + "product_spec": "96x68mm", + "product_category": "机械", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 44.0, + "safety_stock_qty": null, + "max_stock_qty": 735.0, + "source_system": null, + "row_valid_from": "9/12/2025 11:00:02.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 14, + "product_code": "6226799835614", + "product_name": "社会产品", + "product_spec": "60x58mm", + "product_category": "机械", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 27.0, + "safety_stock_qty": null, + "max_stock_qty": 781.0, + "source_system": null, + "row_valid_from": "17/12/2025 13:40:03.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 15, + "product_code": "9006425053745", + "product_name": "产品产品", + "product_spec": "65x77mm", + "product_category": "电子", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 11.0, + "safety_stock_qty": null, + "max_stock_qty": 970.0, + "source_system": null, + "row_valid_from": "8/12/2025 19:42:52.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 16, + "product_code": "1583412793726", + "product_name": "希望产品", + "product_spec": "16x38mm", + "product_category": "机械", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 42.0, + "safety_stock_qty": null, + "max_stock_qty": 981.0, + "source_system": null, + "row_valid_from": "7/12/2025 20:23:28.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 17, + "product_code": "1977620666185", + "product_name": "学校产品", + "product_spec": "56x66mm", + "product_category": "机械", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 39.0, + "safety_stock_qty": null, + "max_stock_qty": 963.0, + "source_system": null, + "row_valid_from": "15/12/2025 22:13:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 18, + "product_code": "1039445799063", + "product_name": "不会产品", + "product_spec": "38x36mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 41.0, + "safety_stock_qty": null, + "max_stock_qty": 562.0, + "source_system": null, + "row_valid_from": "15/12/2025 21:41:47.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 19, + "product_code": "8211837706139", + "product_name": "女人产品", + "product_spec": "13x18mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 45.0, + "safety_stock_qty": null, + "max_stock_qty": 991.0, + "source_system": null, + "row_valid_from": "3/12/2025 17:44:55.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 20, + "product_code": "6293974814849", + "product_name": "名称产品", + "product_spec": "23x70mm", + "product_category": "电子", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 38.0, + "safety_stock_qty": null, + "max_stock_qty": 806.0, + "source_system": null, + "row_valid_from": "3/12/2025 13:28:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 21, + "product_code": "3188054791864", + "product_name": "管理产品", + "product_spec": "24x14mm", + "product_category": "化工", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 17.0, + "safety_stock_qty": null, + "max_stock_qty": 832.0, + "source_system": null, + "row_valid_from": "4/12/2025 11:49:53.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "product_id": 22, + "product_code": "2826090944868", + "product_name": "一次产品", + "product_spec": "43x88mm", + "product_category": "电子", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 24.0, + "safety_stock_qty": null, + "max_stock_qty": 759.0, + "source_system": null, + "row_valid_from": "21/12/2025 06:16:54.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 23, + "product_code": "8464737749892", + "product_name": "全部产品", + "product_spec": "80x94mm", + "product_category": "化工", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 12.0, + "safety_stock_qty": null, + "max_stock_qty": 671.0, + "source_system": null, + "row_valid_from": "15/12/2025 19:17:02.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 24, + "product_code": "4867845340588", + "product_name": "成为产品", + "product_spec": "38x44mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 50.0, + "safety_stock_qty": null, + "max_stock_qty": 754.0, + "source_system": null, + "row_valid_from": "11/12/2025 17:41:26.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 25, + "product_code": "1100938008426", + "product_name": "深圳产品", + "product_spec": "69x15mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 18.0, + "safety_stock_qty": null, + "max_stock_qty": 961.0, + "source_system": null, + "row_valid_from": "29/11/2025 17:42:28.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 26, + "product_code": "2212618436227", + "product_name": "活动产品", + "product_spec": "74x82mm", + "product_category": "电子", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 47.0, + "safety_stock_qty": null, + "max_stock_qty": 861.0, + "source_system": null, + "row_valid_from": "27/11/2025 12:23:26.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 27, + "product_code": "0048151171408", + "product_name": "市场产品", + "product_spec": "18x44mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 36.0, + "safety_stock_qty": null, + "max_stock_qty": 956.0, + "source_system": null, + "row_valid_from": "27/11/2025 14:31:25.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 28, + "product_code": "9439810842752", + "product_name": "以上产品", + "product_spec": "14x45mm", + "product_category": "电子", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 37.0, + "safety_stock_qty": null, + "max_stock_qty": 817.0, + "source_system": null, + "row_valid_from": "19/12/2025 11:22:19.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 29, + "product_code": "1326277406703", + "product_name": "自己产品", + "product_spec": "35x45mm", + "product_category": "化工", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 14.0, + "safety_stock_qty": null, + "max_stock_qty": 715.0, + "source_system": null, + "row_valid_from": "22/12/2025 17:00:58.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 30, + "product_code": "1986049085170", + "product_name": "研究产品", + "product_spec": "92x61mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 37.0, + "safety_stock_qty": null, + "max_stock_qty": 782.0, + "source_system": null, + "row_valid_from": "10/12/2025 19:48:54.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 31, + "product_code": "8441750643383", + "product_name": "基本产品", + "product_spec": "90x26mm", + "product_category": "电子", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 46.0, + "safety_stock_qty": null, + "max_stock_qty": 833.0, + "source_system": null, + "row_valid_from": "28/11/2025 11:28:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 32, + "product_code": "3801700019807", + "product_name": "上海产品", + "product_spec": "74x28mm", + "product_category": "电子", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 23.0, + "safety_stock_qty": null, + "max_stock_qty": 899.0, + "source_system": null, + "row_valid_from": "7/12/2025 17:30:26.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 33, + "product_code": "8498389498952", + "product_name": "生产产品", + "product_spec": "89x14mm", + "product_category": "机械", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 17.0, + "safety_stock_qty": null, + "max_stock_qty": 830.0, + "source_system": null, + "row_valid_from": "29/11/2025 07:13:37.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 34, + "product_code": "8603181123814", + "product_name": "广告产品", + "product_spec": "46x59mm", + "product_category": "化工", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 19.0, + "safety_stock_qty": null, + "max_stock_qty": 894.0, + "source_system": null, + "row_valid_from": "26/11/2025 16:54:36.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 35, + "product_code": "6835344685163", + "product_name": "会员产品", + "product_spec": "15x29mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 50.0, + "safety_stock_qty": null, + "max_stock_qty": 646.0, + "source_system": null, + "row_valid_from": "4/12/2025 18:38:08.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 36, + "product_code": "4164661112277", + "product_name": "单位产品", + "product_spec": "29x58mm", + "product_category": "化工", + "product_type": null, + "uom_code": "kg", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 35.0, + "safety_stock_qty": null, + "max_stock_qty": 897.0, + "source_system": null, + "row_valid_from": "23/12/2025 10:15:16.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 37, + "product_code": "3698468656357", + "product_name": "积分产品", + "product_spec": "65x54mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 22.0, + "safety_stock_qty": null, + "max_stock_qty": 591.0, + "source_system": null, + "row_valid_from": "7/12/2025 13:06:31.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 38, + "product_code": "7220108163596", + "product_name": "成功产品", + "product_spec": "94x82mm", + "product_category": "化工", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 25.0, + "safety_stock_qty": null, + "max_stock_qty": 508.0, + "source_system": null, + "row_valid_from": "8/12/2025 16:35:40.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 39, + "product_code": "5638608140665", + "product_name": "说明产品", + "product_spec": "93x97mm", + "product_category": "电子", + "product_type": null, + "uom_code": "m", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 12.0, + "safety_stock_qty": null, + "max_stock_qty": 551.0, + "source_system": null, + "row_valid_from": "29/11/2025 09:42:20.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 40, + "product_code": "8341088934569", + "product_name": "今天产品", + "product_spec": "19x56mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 23.0, + "safety_stock_qty": null, + "max_stock_qty": 845.0, + "source_system": null, + "row_valid_from": "2/12/2025 04:21:42.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "product_id": 41, + "product_code": "1440232079921", + "product_name": "积分产品", + "product_spec": "45x27mm", + "product_category": "化工", + "product_type": null, + "uom_code": "pcs", + "brand": null, + "origin": null, + "transport_condition": null, + "barcode": null, + "drawing_number": null, + "material": null, + "surface_treatment": null, + "min_stock_qty": 43.0, + "safety_stock_qty": null, + "max_stock_qty": 665.0, + "source_system": null, + "row_valid_from": "12/12/2025 23:53:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_qc_reason.json b/sql/dim_qc_reason.json new file mode 100644 index 0000000..6c9c230 --- /dev/null +++ b/sql/dim_qc_reason.json @@ -0,0 +1,52 @@ +[ + { + "qc_reason_id": 1, + "qc_reason_number": "QC822", + "qc_reason_name": "尺寸偏差", + "source_system": null, + "row_valid_from": "7/12/2025 18:23:18.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "qc_reason_id": 2, + "qc_reason_number": "QC838", + "qc_reason_name": "表面划痕", + "source_system": null, + "row_valid_from": "7/12/2025 17:10:33.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "qc_reason_id": 3, + "qc_reason_number": "QC428", + "qc_reason_name": "功能失效", + "source_system": null, + "row_valid_from": "13/12/2025 01:46:51.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "qc_reason_id": 4, + "qc_reason_number": "QC982", + "qc_reason_name": "材料缺陷", + "source_system": null, + "row_valid_from": "29/11/2025 00:57:34.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "qc_reason_id": 5, + "qc_reason_number": "QC840", + "qc_reason_name": "其他", + "source_system": null, + "row_valid_from": "19/12/2025 10:43:50.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_routing.json b/sql/dim_routing.json new file mode 100644 index 0000000..c043419 --- /dev/null +++ b/sql/dim_routing.json @@ -0,0 +1,112 @@ +[ + { + "routing_id": 1, + "routing_number": "RT928664", + "routing_name": "工艺路线 0", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "22/12/2025 01:28:41.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 2, + "routing_number": "RT813173", + "routing_name": "工艺路线 1", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "25/12/2025 02:25:02.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 3, + "routing_number": "RT317805", + "routing_name": "工艺路线 2", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "24/12/2025 22:26:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 4, + "routing_number": "RT814274", + "routing_name": "工艺路线 3", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "14/12/2025 18:17:46.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 5, + "routing_number": "RT506986", + "routing_name": "工艺路线 4", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "2/12/2025 07:40:10.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 6, + "routing_number": "RT384801", + "routing_name": "工艺路线 5", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "12/12/2025 21:46:11.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 7, + "routing_number": "RT472662", + "routing_name": "工艺路线 6", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "1/12/2025 18:32:07.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 8, + "routing_number": "RT557638", + "routing_name": "工艺路线 7", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "12/12/2025 09:16:30.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 9, + "routing_number": "RT394755", + "routing_name": "工艺路线 8", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "18/12/2025 09:36:41.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "routing_id": 10, + "routing_number": "RT314588", + "routing_name": "工艺路线 9", + "operation_list_text": "Op1 -> Op2 -> Op3", + "source_system": null, + "row_valid_from": "13/12/2025 14:50:52.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_supplier.json b/sql/dim_supplier.json new file mode 100644 index 0000000..72c9776 --- /dev/null +++ b/sql/dim_supplier.json @@ -0,0 +1,322 @@ +[ + { + "supplier_id": 2, + "supplier_code": "29635153", + "supplier_name": "飞利信科技有限公司", + "supplier_category": "设备", + "supplier_level": null, + "address": "香港特别行政区浩县兴山吴街y座 393831", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "25/12/2025 02:24:36.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 3, + "supplier_code": "60827272", + "supplier_name": "迪摩信息有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "安徽省天津县西峰刘路D座 348509", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "3/12/2025 00:04:20.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 4, + "supplier_code": "35503811", + "supplier_name": "联软传媒有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "天津市南宁县龙潭曹路V座 252377", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "14/12/2025 11:09:32.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 5, + "supplier_code": "22043849", + "supplier_name": "恒聪百汇网络有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "青海省昆明市华龙杭州路Y座 224823", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "10/12/2025 16:26:10.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 6, + "supplier_code": "66344148", + "supplier_name": "惠派国际公司科技有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "甘肃省敏市大东福州街n座 946705", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "24/12/2025 18:00:21.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 7, + "supplier_code": "70123661", + "supplier_name": "维旺明信息有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "福建省张家港市大东易路A座 727921", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "23/12/2025 09:19:05.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 8, + "supplier_code": "75720629", + "supplier_name": "凌云信息有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "甘肃省丹县涪城张路S座 323933", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "17/12/2025 18:46:28.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 9, + "supplier_code": "26315249", + "supplier_name": "襄樊地球村网络有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "辽宁省沈阳县普陀齐路l座 999109", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "26/11/2025 07:28:39.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 10, + "supplier_code": "58018903", + "supplier_name": "立信电子传媒有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "海南省辛集市丰都合肥路r座 299591", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "25/12/2025 14:58:35.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 11, + "supplier_code": "75456863", + "supplier_name": "彩虹信息有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "内蒙古自治区冬梅县翔安萧街k座 167178", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "13/12/2025 13:41:25.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "supplier_id": 12, + "supplier_code": "97373285", + "supplier_name": "凌云科技有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "安徽省桂珍市璧山陈街Q座 440048", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "7/12/2025 23:48:55.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 13, + "supplier_code": "99941253", + "supplier_name": "时空盒数字网络有限公司", + "supplier_category": "设备", + "supplier_level": null, + "address": "内蒙古自治区上海市兴山齐齐哈尔街B座 464689", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "25/12/2025 16:36:23.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 14, + "supplier_code": "02905303", + "supplier_name": "四通网络有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "福建省雪县黄浦刘街t座 138434", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "13/12/2025 14:12:50.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 15, + "supplier_code": "86588577", + "supplier_name": "立信电子科技有限公司", + "supplier_category": "设备", + "supplier_level": null, + "address": "山西省雪梅县门头沟通辽路k座 281455", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "27/11/2025 01:31:59.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 16, + "supplier_code": "72076675", + "supplier_name": "华远软件科技有限公司", + "supplier_category": "设备", + "supplier_level": null, + "address": "浙江省欣县城东大冶街Q座 973420", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "29/11/2025 20:36:53.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 17, + "supplier_code": "80219491", + "supplier_name": "佳禾传媒有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "甘肃省婷市沙湾蒋路y座 663937", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "25/12/2025 12:55:17.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 18, + "supplier_code": "22760197", + "supplier_name": "毕博诚网络有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "内蒙古自治区贵阳县牧野熊街N座 772146", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "18/12/2025 02:26:37.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 19, + "supplier_code": "07094002", + "supplier_name": "明腾传媒有限公司", + "supplier_category": "服务", + "supplier_level": null, + "address": "江苏省柳县孝南曹街U座 889122", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "29/11/2025 22:22:17.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 20, + "supplier_code": "03450178", + "supplier_name": "数字100科技有限公司", + "supplier_category": "原料", + "supplier_level": null, + "address": "江西省丹市沈河哈尔滨街W座 266948", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "28/11/2025 08:58:38.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "supplier_id": 21, + "supplier_code": "39872104", + "supplier_name": "恒聪百汇信息有限公司", + "supplier_category": "设备", + "supplier_level": null, + "address": "内蒙古自治区建军市白云齐街I座 845016", + "default_currency_code": null, + "settlement_term": null, + "contract_expiry_date_utc": null, + "source_system": null, + "row_valid_from": "22/12/2025 03:26:55.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/dim_warehouse.json b/sql/dim_warehouse.json new file mode 100644 index 0000000..303799e --- /dev/null +++ b/sql/dim_warehouse.json @@ -0,0 +1,132 @@ +[ + { + "warehouse_id": 2, + "warehouse_code": "WH001", + "warehouse_name": "淑珍市仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "10/12/2025 07:16:46.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "warehouse_id": 3, + "warehouse_code": "WH002", + "warehouse_name": "强市仓库", + "warehouse_type": "成品仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "13/12/2025 20:58:57.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "warehouse_id": 4, + "warehouse_code": "WH003", + "warehouse_name": "秀兰县仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "13/12/2025 22:49:34.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "warehouse_id": 5, + "warehouse_code": "WH004", + "warehouse_name": "太原县仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "15/12/2025 19:11:19.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "warehouse_id": 6, + "warehouse_code": "WH005", + "warehouse_name": "宇市仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "7/12/2025 22:34:16.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "warehouse_id": 7, + "warehouse_code": "WH001", + "warehouse_name": "杰市仓库", + "warehouse_type": "成品仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "24/12/2025 19:41:23.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "warehouse_id": 8, + "warehouse_code": "WH002", + "warehouse_name": "宇市仓库", + "warehouse_type": "成品仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "4/12/2025 02:48:58.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "warehouse_id": 9, + "warehouse_code": "WH003", + "warehouse_name": "海口市仓库", + "warehouse_type": "成品仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "26/12/2025 10:22:29.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "warehouse_id": 10, + "warehouse_code": "WH004", + "warehouse_name": "鹏市仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "4/12/2025 22:55:06.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "warehouse_id": 11, + "warehouse_code": "WH005", + "warehouse_name": "斌市仓库", + "warehouse_type": "原料仓", + "status": "ENABLED", + "address": null, + "source_system": null, + "row_valid_from": "10/12/2025 09:23:32.-1f+00", + "row_valid_to": "31/12/9999 15:59:59+00", + "is_current": "t", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_ap_payment.json b/sql/fact_ap_payment.json new file mode 100644 index 0000000..b0d2a5d --- /dev/null +++ b/sql/fact_ap_payment.json @@ -0,0 +1,422 @@ +[ + { + "ap_payment_id": 1, + "doc_number": "AP22766562", + "doc_type": "PAYMENT", + "supplier_id": 6, + "contract_id": null, + "doc_date_utc": "9/2/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 25906.71, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 2, + "doc_number": "AP88974654", + "doc_type": "PAYMENT", + "supplier_id": 8, + "contract_id": null, + "doc_date_utc": "16/11/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 37620.28, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 3, + "doc_number": "AP80527903", + "doc_type": "PAYMENT", + "supplier_id": 1, + "contract_id": null, + "doc_date_utc": "17/12/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 27273.98, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 4, + "doc_number": "AP46338366", + "doc_type": "PAYMENT", + "supplier_id": 3, + "contract_id": null, + "doc_date_utc": "17/5/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 7414.76, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 5, + "doc_number": "AP5549914", + "doc_type": "PAYMENT", + "supplier_id": 10, + "contract_id": null, + "doc_date_utc": "16/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 39895.91, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 6, + "doc_number": "AP30326495", + "doc_type": "PAYMENT", + "supplier_id": 1, + "contract_id": null, + "doc_date_utc": "16/10/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 18899.8, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 7, + "doc_number": "AP32421924", + "doc_type": "PAYMENT", + "supplier_id": 5, + "contract_id": null, + "doc_date_utc": "14/10/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 16104.34, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 8, + "doc_number": "AP58297564", + "doc_type": "PAYMENT", + "supplier_id": 10, + "contract_id": null, + "doc_date_utc": "9/4/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 45050.54, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 9, + "doc_number": "AP44327338", + "doc_type": "PAYMENT", + "supplier_id": 10, + "contract_id": null, + "doc_date_utc": "8/9/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 43071.66, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 10, + "doc_number": "AP58460499", + "doc_type": "PAYMENT", + "supplier_id": 1, + "contract_id": null, + "doc_date_utc": "7/5/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 37940.84, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 11, + "doc_number": "AP39014534", + "doc_type": "PAYMENT", + "supplier_id": 4, + "contract_id": null, + "doc_date_utc": "10/10/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 47428.08, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 12, + "doc_number": "AP14023853", + "doc_type": "PAYMENT", + "supplier_id": 5, + "contract_id": null, + "doc_date_utc": "10/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 37875.28, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 13, + "doc_number": "AP35235417", + "doc_type": "PAYMENT", + "supplier_id": 8, + "contract_id": null, + "doc_date_utc": "18/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 11187.59, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 14, + "doc_number": "AP83466622", + "doc_type": "PAYMENT", + "supplier_id": 10, + "contract_id": null, + "doc_date_utc": "23/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 29825.07, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 15, + "doc_number": "AP65495215", + "doc_type": "PAYMENT", + "supplier_id": 9, + "contract_id": null, + "doc_date_utc": "12/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 29137.77, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 16, + "doc_number": "AP60440000", + "doc_type": "PAYMENT", + "supplier_id": 6, + "contract_id": null, + "doc_date_utc": "16/8/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 25254.48, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 17, + "doc_number": "AP66571233", + "doc_type": "PAYMENT", + "supplier_id": 7, + "contract_id": null, + "doc_date_utc": "15/2/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 23098.47, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 18, + "doc_number": "AP33958730", + "doc_type": "PAYMENT", + "supplier_id": 3, + "contract_id": null, + "doc_date_utc": "27/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 4477.6, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 19, + "doc_number": "AP18134079", + "doc_type": "PAYMENT", + "supplier_id": 8, + "contract_id": null, + "doc_date_utc": "21/4/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 35126.28, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ap_payment_id": 20, + "doc_number": "AP16449942", + "doc_type": "PAYMENT", + "supplier_id": 1, + "contract_id": null, + "doc_date_utc": "16/5/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 30644.26, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_ar_receipt.json b/sql/fact_ar_receipt.json new file mode 100644 index 0000000..64917cc --- /dev/null +++ b/sql/fact_ar_receipt.json @@ -0,0 +1,422 @@ +[ + { + "ar_receipt_id": 1, + "doc_number": "AR7319819", + "doc_type": "RECEIPT", + "customer_id": 2, + "contract_id": null, + "doc_date_utc": "29/5/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 41230.16, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 2, + "doc_number": "AR97132012", + "doc_type": "RECEIPT", + "customer_id": 10, + "contract_id": null, + "doc_date_utc": "27/6/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 45220.89, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 3, + "doc_number": "AR60123143", + "doc_type": "RECEIPT", + "customer_id": 4, + "contract_id": null, + "doc_date_utc": "31/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 3280.64, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 4, + "doc_number": "AR80668128", + "doc_type": "RECEIPT", + "customer_id": 4, + "contract_id": null, + "doc_date_utc": "24/8/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 20409.1, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 5, + "doc_number": "AR8000318", + "doc_type": "RECEIPT", + "customer_id": 9, + "contract_id": null, + "doc_date_utc": "6/2/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 29089.97, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 6, + "doc_number": "AR41555486", + "doc_type": "RECEIPT", + "customer_id": 8, + "contract_id": null, + "doc_date_utc": "10/12/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 45088.01, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 7, + "doc_number": "AR97684129", + "doc_type": "RECEIPT", + "customer_id": 1, + "contract_id": null, + "doc_date_utc": "6/3/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 44233.58, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 8, + "doc_number": "AR8875506", + "doc_type": "RECEIPT", + "customer_id": 4, + "contract_id": null, + "doc_date_utc": "19/10/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 26942.91, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 9, + "doc_number": "AR88315098", + "doc_type": "RECEIPT", + "customer_id": 6, + "contract_id": null, + "doc_date_utc": "7/12/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 16724.37, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 10, + "doc_number": "AR93427405", + "doc_type": "RECEIPT", + "customer_id": 3, + "contract_id": null, + "doc_date_utc": "18/12/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 12976.69, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 11, + "doc_number": "AR93851917", + "doc_type": "RECEIPT", + "customer_id": 4, + "contract_id": null, + "doc_date_utc": "14/10/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 30762.29, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 12, + "doc_number": "AR1052947", + "doc_type": "RECEIPT", + "customer_id": 9, + "contract_id": null, + "doc_date_utc": "9/2/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 9059.86, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 13, + "doc_number": "AR30085293", + "doc_type": "RECEIPT", + "customer_id": 8, + "contract_id": null, + "doc_date_utc": "28/3/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 7984.02, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 14, + "doc_number": "AR66296577", + "doc_type": "RECEIPT", + "customer_id": 5, + "contract_id": null, + "doc_date_utc": "23/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 2698.12, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 15, + "doc_number": "AR60642387", + "doc_type": "RECEIPT", + "customer_id": 7, + "contract_id": null, + "doc_date_utc": "27/7/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 12560.89, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 16, + "doc_number": "AR728466", + "doc_type": "RECEIPT", + "customer_id": 10, + "contract_id": null, + "doc_date_utc": "27/11/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 29503.57, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 17, + "doc_number": "AR57762580", + "doc_type": "RECEIPT", + "customer_id": 6, + "contract_id": null, + "doc_date_utc": "27/1/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 10832.88, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 18, + "doc_number": "AR78376295", + "doc_type": "RECEIPT", + "customer_id": 10, + "contract_id": null, + "doc_date_utc": "2/6/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 32247.78, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 19, + "doc_number": "AR10637382", + "doc_type": "RECEIPT", + "customer_id": 9, + "contract_id": null, + "doc_date_utc": "5/5/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 38910.41, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "ar_receipt_id": 20, + "doc_number": "AR60241043", + "doc_type": "RECEIPT", + "customer_id": 1, + "contract_id": null, + "doc_date_utc": "11/2/2025 16:00:00+00", + "currency_code": null, + "fx_rate": null, + "amount": 10016.02, + "amount_base": null, + "fee_amount": null, + "discount_amount": null, + "write_off_amount": null, + "written_off_amount": null, + "unwritten_off_amount": null, + "related_doc_number": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_cash_flow.json b/sql/fact_cash_flow.json new file mode 100644 index 0000000..03e90e3 --- /dev/null +++ b/sql/fact_cash_flow.json @@ -0,0 +1,322 @@ +[ + { + "cash_flow_id": 1, + "doc_number": "CF6768483", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 256.26, + "expense_amount": 1306.72, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 2, + "doc_number": "CF3288503", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 1739.28, + "expense_amount": 440.53, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 3, + "doc_number": "CF39687070", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 4150.02, + "expense_amount": 2808.29, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 4, + "doc_number": "CF5123241", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 895.46, + "expense_amount": 6540.48, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 5, + "doc_number": "CF92582604", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 1050.94, + "expense_amount": 2203.11, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 6, + "doc_number": "CF19573339", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 1820.84, + "expense_amount": 7786.78, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 7, + "doc_number": "CF69107956", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 5520.24, + "expense_amount": 6787.02, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 8, + "doc_number": "CF12203628", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 5671.04, + "expense_amount": 5991.79, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 9, + "doc_number": "CF96412637", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 8718.46, + "expense_amount": 4419.49, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 10, + "doc_number": "CF12272309", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 5214.02, + "expense_amount": 2497.47, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 11, + "doc_number": "CF19227489", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 9817.26, + "expense_amount": 4641.33, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 12, + "doc_number": "CF71604298", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 6002.9, + "expense_amount": 7628.47, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 13, + "doc_number": "CF94626179", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 8908.12, + "expense_amount": 1403.26, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 14, + "doc_number": "CF89012391", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 8731.32, + "expense_amount": 1779.07, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 15, + "doc_number": "CF67343535", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 3998.41, + "expense_amount": 1184.74, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 16, + "doc_number": "CF22081511", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 6956.41, + "expense_amount": 6908.72, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 17, + "doc_number": "CF96019961", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 1420.7, + "expense_amount": 5795.18, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 18, + "doc_number": "CF92790804", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 5683.75, + "expense_amount": 9111.8, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 19, + "doc_number": "CF93146536", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 8435.89, + "expense_amount": 1738.36, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "cash_flow_id": 20, + "doc_number": "CF37862214", + "doc_type": "CASHFLOW", + "account_name": null, + "doc_date_utc": null, + "business_type": null, + "income_amount": 2913.84, + "expense_amount": 4442.69, + "balance_amount": null, + "counterparty": null, + "remark": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_commission.json b/sql/fact_commission.json new file mode 100644 index 0000000..f37e3f2 --- /dev/null +++ b/sql/fact_commission.json @@ -0,0 +1,192 @@ +[ + { + "commission_id": 1, + "commission_person": "吴建", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 739.75, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 2, + "commission_person": "赵雪", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 316.02, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 3, + "commission_person": "任龙", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 872.32, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 4, + "commission_person": "徐涛", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 139.82, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 5, + "commission_person": "王秀珍", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 269.59, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 6, + "commission_person": "杨婷婷", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 228.49, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 7, + "commission_person": "王秀芳", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 919.07, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 8, + "commission_person": "刘芳", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 524.2, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 9, + "commission_person": "郑林", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 987.76, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "commission_id": 10, + "commission_person": "朱帅", + "department": null, + "commission_rate_pct": null, + "coefficient": null, + "receivable_commission": 958.02, + "received_commission": null, + "contract_id": null, + "customer_id": null, + "product_name": null, + "opportunity_name": null, + "contract_amount": null, + "deal_time_utc": null, + "is_invoiced": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_inventory_count.json b/sql/fact_inventory_count.json new file mode 100644 index 0000000..3ae467c --- /dev/null +++ b/sql/fact_inventory_count.json @@ -0,0 +1,102 @@ +[ + { + "inventory_count_id": 1, + "count_number": "CNT55217992", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "25/9/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 2, + "count_number": "CNT11377040", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "20/4/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 3, + "count_number": "CNT94805545", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "5/10/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 4, + "count_number": "CNT64741450", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "23/1/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 5, + "count_number": "CNT89069471", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "16/6/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 6, + "count_number": "CNT6215086", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "17/12/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 7, + "count_number": "CNT72116393", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "12/1/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 8, + "count_number": "CNT25970731", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "20/12/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 9, + "count_number": "CNT96428082", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "5/9/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_count_id": 10, + "count_number": "CNT32858501", + "warehouse_name": null, + "count_name": null, + "count_time_utc": "1/6/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_inventory_movement.json b/sql/fact_inventory_movement.json new file mode 100644 index 0000000..979d492 --- /dev/null +++ b/sql/fact_inventory_movement.json @@ -0,0 +1,4002 @@ +[ + { + "inventory_movement_id": 3, + "event_time_utc": "4/12/2025 00:19:46.-1f+00", + "product_id": 11, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV402995443", + "doc_type": "IN", + "movement_qty": 43.5, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 4, + "event_time_utc": "5/12/2025 12:47:27.-1f+00", + "product_id": 17, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV2121838375", + "doc_type": "IN", + "movement_qty": 88.89, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 5, + "event_time_utc": "21/12/2025 12:23:33.-1f+00", + "product_id": 6, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV8914172487", + "doc_type": "IN", + "movement_qty": 70.52, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 6, + "event_time_utc": "23/12/2025 06:07:16.-1f+00", + "product_id": 6, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV9770150102", + "doc_type": "IN", + "movement_qty": 18.69, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 7, + "event_time_utc": "7/12/2025 07:37:53.-1f+00", + "product_id": 17, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV691215203", + "doc_type": "OUT", + "movement_qty": 5.03, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 8, + "event_time_utc": "2/12/2025 15:01:52.-1f+00", + "product_id": 19, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV244278957", + "doc_type": "IN", + "movement_qty": 28.44, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 9, + "event_time_utc": "6/12/2025 01:55:34.-1f+00", + "product_id": 10, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV3050062962", + "doc_type": "OUT", + "movement_qty": -91.25, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 10, + "event_time_utc": "15/12/2025 06:59:10.-1f+00", + "product_id": 12, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV8908742551", + "doc_type": "IN", + "movement_qty": 68.64, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 11, + "event_time_utc": "14/12/2025 04:03:23.-1f+00", + "product_id": 19, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV560652892", + "doc_type": "IN", + "movement_qty": -92.01, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 12, + "event_time_utc": "6/12/2025 23:14:41.-1f+00", + "product_id": 17, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2337677923", + "doc_type": "IN", + "movement_qty": -24.08, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 13, + "event_time_utc": "19/12/2025 21:03:20.-1f+00", + "product_id": 19, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7829309928", + "doc_type": "OUT", + "movement_qty": -46.05, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 14, + "event_time_utc": "10/12/2025 17:54:46.-1f+00", + "product_id": 14, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV526241820", + "doc_type": "IN", + "movement_qty": 56.0, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 15, + "event_time_utc": "5/12/2025 10:46:36.-1f+00", + "product_id": 17, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV6476060307", + "doc_type": "OUT", + "movement_qty": 21.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 16, + "event_time_utc": "13/12/2025 20:34:09.-1f+00", + "product_id": 2, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV1102760832", + "doc_type": "OUT", + "movement_qty": 10.73, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 17, + "event_time_utc": "15/12/2025 09:06:52.-1f+00", + "product_id": 17, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV3238727703", + "doc_type": "IN", + "movement_qty": -71.9, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 18, + "event_time_utc": "16/12/2025 09:52:29.-1f+00", + "product_id": 10, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1553243730", + "doc_type": "IN", + "movement_qty": -18.87, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 19, + "event_time_utc": "7/12/2025 14:02:16.-1f+00", + "product_id": 7, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV141207903", + "doc_type": "IN", + "movement_qty": 55.67, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 20, + "event_time_utc": "30/11/2025 23:13:08.-1f+00", + "product_id": 5, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5493352202", + "doc_type": "OUT", + "movement_qty": 49.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 21, + "event_time_utc": "23/12/2025 01:04:47.-1f+00", + "product_id": 16, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV8232278334", + "doc_type": "IN", + "movement_qty": 83.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 22, + "event_time_utc": "22/12/2025 18:03:20.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9659210186", + "doc_type": "OUT", + "movement_qty": -84.03, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 23, + "event_time_utc": "16/12/2025 23:53:15.-1f+00", + "product_id": 7, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7059269197", + "doc_type": "IN", + "movement_qty": 20.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 24, + "event_time_utc": "10/12/2025 09:18:57.-1f+00", + "product_id": 4, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2444555044", + "doc_type": "IN", + "movement_qty": 80.39, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 25, + "event_time_utc": "8/12/2025 00:17:22.-1f+00", + "product_id": 6, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV5399810016", + "doc_type": "OUT", + "movement_qty": 26.32, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 26, + "event_time_utc": "21/12/2025 10:28:39.-1f+00", + "product_id": 8, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV8718095135", + "doc_type": "OUT", + "movement_qty": -54.51, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 27, + "event_time_utc": "10/12/2025 10:39:01.-1f+00", + "product_id": 17, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV8461825430", + "doc_type": "OUT", + "movement_qty": -4.86, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 28, + "event_time_utc": "10/12/2025 22:13:11.-1f+00", + "product_id": 11, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2051146091", + "doc_type": "OUT", + "movement_qty": 90.19, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 29, + "event_time_utc": "7/12/2025 02:28:12.-1f+00", + "product_id": 19, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2999731245", + "doc_type": "OUT", + "movement_qty": 55.66, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 30, + "event_time_utc": "20/12/2025 16:32:48.-1f+00", + "product_id": 13, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV4863804357", + "doc_type": "OUT", + "movement_qty": -10.06, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 31, + "event_time_utc": "4/12/2025 06:24:20.-1f+00", + "product_id": 15, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV6940416909", + "doc_type": "OUT", + "movement_qty": -40.93, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 32, + "event_time_utc": "12/12/2025 14:20:47.-1f+00", + "product_id": 17, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV9849093167", + "doc_type": "IN", + "movement_qty": 93.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 33, + "event_time_utc": "19/12/2025 11:50:38.-1f+00", + "product_id": 20, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9193695587", + "doc_type": "OUT", + "movement_qty": 74.81, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 34, + "event_time_utc": "23/12/2025 06:08:39.-1f+00", + "product_id": 4, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV739514373", + "doc_type": "OUT", + "movement_qty": 49.7, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 35, + "event_time_utc": "14/12/2025 01:39:08.-1f+00", + "product_id": 4, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV9205731440", + "doc_type": "IN", + "movement_qty": -16.07, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 36, + "event_time_utc": "12/12/2025 18:16:24.-1f+00", + "product_id": 20, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2526666747", + "doc_type": "OUT", + "movement_qty": 74.6, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 37, + "event_time_utc": "23/12/2025 07:59:31.-1f+00", + "product_id": 1, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5365160948", + "doc_type": "IN", + "movement_qty": 18.82, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 38, + "event_time_utc": "25/12/2025 10:21:38.-1f+00", + "product_id": 12, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7138943656", + "doc_type": "IN", + "movement_qty": 35.65, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 39, + "event_time_utc": "8/12/2025 08:09:53.-1f+00", + "product_id": 1, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV8581258787", + "doc_type": "OUT", + "movement_qty": -66.52, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 40, + "event_time_utc": "7/12/2025 00:54:19.-1f+00", + "product_id": 14, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV8998473821", + "doc_type": "IN", + "movement_qty": -60.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 41, + "event_time_utc": "23/12/2025 02:01:49.-1f+00", + "product_id": 13, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV4032332944", + "doc_type": "OUT", + "movement_qty": -60.41, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 42, + "event_time_utc": "8/12/2025 10:50:30.-1f+00", + "product_id": 7, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6577141128", + "doc_type": "OUT", + "movement_qty": -82.47, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 43, + "event_time_utc": "25/12/2025 17:55:12.-1f+00", + "product_id": 3, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1553639114", + "doc_type": "OUT", + "movement_qty": -9.65, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 44, + "event_time_utc": "4/12/2025 00:13:36.-1f+00", + "product_id": 14, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6961872608", + "doc_type": "OUT", + "movement_qty": -57.61, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 45, + "event_time_utc": "20/12/2025 21:28:29.-1f+00", + "product_id": 13, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV797088484", + "doc_type": "OUT", + "movement_qty": -33.04, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 46, + "event_time_utc": "16/12/2025 20:41:25.-1f+00", + "product_id": 17, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV8094258572", + "doc_type": "OUT", + "movement_qty": -10.8, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 47, + "event_time_utc": "18/12/2025 11:42:56.-1f+00", + "product_id": 5, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV3011817410", + "doc_type": "OUT", + "movement_qty": 73.93, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 48, + "event_time_utc": "19/12/2025 18:10:51.-1f+00", + "product_id": 18, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9619364533", + "doc_type": "IN", + "movement_qty": -16.45, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 49, + "event_time_utc": "16/12/2025 14:24:35.-1f+00", + "product_id": 9, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9405562690", + "doc_type": "IN", + "movement_qty": 36.85, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 50, + "event_time_utc": "16/12/2025 06:15:28.-1f+00", + "product_id": 15, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7647089070", + "doc_type": "IN", + "movement_qty": -25.22, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 51, + "event_time_utc": "22/12/2025 13:10:07.-1f+00", + "product_id": 6, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV3454287229", + "doc_type": "OUT", + "movement_qty": -44.71, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 52, + "event_time_utc": "9/12/2025 05:27:42.-1f+00", + "product_id": 1, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV4833790499", + "doc_type": "OUT", + "movement_qty": 11.73, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 53, + "event_time_utc": "8/12/2025 16:42:21.-1f+00", + "product_id": 12, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV8534599712", + "doc_type": "OUT", + "movement_qty": -45.72, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 54, + "event_time_utc": "11/12/2025 08:47:55.-1f+00", + "product_id": 9, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1183130981", + "doc_type": "IN", + "movement_qty": 80.78, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 55, + "event_time_utc": "6/12/2025 22:41:19.-1f+00", + "product_id": 17, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5737204151", + "doc_type": "OUT", + "movement_qty": 20.67, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 56, + "event_time_utc": "12/12/2025 09:24:35.-1f+00", + "product_id": 15, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV6673862551", + "doc_type": "IN", + "movement_qty": 61.45, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 57, + "event_time_utc": "20/12/2025 19:48:20.-1f+00", + "product_id": 17, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV9923688251", + "doc_type": "IN", + "movement_qty": -41.25, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 58, + "event_time_utc": "11/12/2025 22:11:25.-1f+00", + "product_id": 20, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1231263387", + "doc_type": "OUT", + "movement_qty": 13.11, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 59, + "event_time_utc": "13/12/2025 18:57:27.-1f+00", + "product_id": 4, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV8884040121", + "doc_type": "OUT", + "movement_qty": -29.21, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 60, + "event_time_utc": "25/12/2025 01:31:59.-1f+00", + "product_id": 13, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV142086847", + "doc_type": "OUT", + "movement_qty": -58.66, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 61, + "event_time_utc": "8/12/2025 21:52:38.-1f+00", + "product_id": 13, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV5043953486", + "doc_type": "OUT", + "movement_qty": -61.67, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 62, + "event_time_utc": "24/12/2025 16:29:53.-1f+00", + "product_id": 7, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9703313884", + "doc_type": "IN", + "movement_qty": 25.76, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 63, + "event_time_utc": "24/12/2025 10:10:13.-1f+00", + "product_id": 4, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV1006914287", + "doc_type": "IN", + "movement_qty": 33.22, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 64, + "event_time_utc": "14/12/2025 01:31:49.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1837973661", + "doc_type": "OUT", + "movement_qty": -25.41, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 65, + "event_time_utc": "7/12/2025 17:39:24.-1f+00", + "product_id": 8, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV4057870390", + "doc_type": "OUT", + "movement_qty": -96.31, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 66, + "event_time_utc": "12/12/2025 08:25:11.-1f+00", + "product_id": 7, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV4834744035", + "doc_type": "OUT", + "movement_qty": 56.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 67, + "event_time_utc": "9/12/2025 13:29:56.-1f+00", + "product_id": 18, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV983797357", + "doc_type": "OUT", + "movement_qty": 41.77, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 68, + "event_time_utc": "16/12/2025 01:34:53.-1f+00", + "product_id": 12, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6194635776", + "doc_type": "IN", + "movement_qty": 74.86, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 69, + "event_time_utc": "23/12/2025 02:55:09.-1f+00", + "product_id": 20, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV4091486351", + "doc_type": "OUT", + "movement_qty": -27.09, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 70, + "event_time_utc": "6/12/2025 14:16:20.-1f+00", + "product_id": 2, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2557428608", + "doc_type": "IN", + "movement_qty": 38.0, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 71, + "event_time_utc": "15/12/2025 20:41:57.-1f+00", + "product_id": 4, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV3397210527", + "doc_type": "IN", + "movement_qty": -61.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 72, + "event_time_utc": "3/12/2025 12:31:16.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5007561468", + "doc_type": "OUT", + "movement_qty": 23.39, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 73, + "event_time_utc": "1/12/2025 05:53:30.-1f+00", + "product_id": 3, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV1200343630", + "doc_type": "IN", + "movement_qty": -17.75, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 74, + "event_time_utc": "2/12/2025 03:46:13.-1f+00", + "product_id": 13, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1935377341", + "doc_type": "IN", + "movement_qty": -82.9, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 75, + "event_time_utc": "12/12/2025 11:10:40.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1837127910", + "doc_type": "OUT", + "movement_qty": -47.6, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 76, + "event_time_utc": "18/12/2025 00:47:09.-1f+00", + "product_id": 17, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV350136189", + "doc_type": "OUT", + "movement_qty": -24.44, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 77, + "event_time_utc": "6/12/2025 09:32:27.-1f+00", + "product_id": 7, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV4351809588", + "doc_type": "IN", + "movement_qty": 77.74, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 78, + "event_time_utc": "10/12/2025 23:14:52.-1f+00", + "product_id": 9, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV7036499364", + "doc_type": "OUT", + "movement_qty": 49.05, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 79, + "event_time_utc": "21/12/2025 07:48:19.-1f+00", + "product_id": 18, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV9012383954", + "doc_type": "OUT", + "movement_qty": 79.19, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 80, + "event_time_utc": "2/12/2025 01:20:44.-1f+00", + "product_id": 7, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV220113027", + "doc_type": "IN", + "movement_qty": 90.13, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 81, + "event_time_utc": "15/12/2025 20:14:48.-1f+00", + "product_id": 14, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1783213716", + "doc_type": "IN", + "movement_qty": 92.44, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 82, + "event_time_utc": "4/12/2025 01:14:15.-1f+00", + "product_id": 8, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV7583006744", + "doc_type": "OUT", + "movement_qty": -68.18, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 83, + "event_time_utc": "1/12/2025 01:28:24.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV5201544802", + "doc_type": "OUT", + "movement_qty": -60.76, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 84, + "event_time_utc": "14/12/2025 07:00:55.-1f+00", + "product_id": 18, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9580402920", + "doc_type": "IN", + "movement_qty": 3.07, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 85, + "event_time_utc": "15/12/2025 16:19:27.-1f+00", + "product_id": 19, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV3294625024", + "doc_type": "OUT", + "movement_qty": 60.56, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 86, + "event_time_utc": "25/12/2025 03:30:24.-1f+00", + "product_id": 18, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV5297789693", + "doc_type": "OUT", + "movement_qty": 37.9, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 87, + "event_time_utc": "16/12/2025 13:48:07.-1f+00", + "product_id": 13, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV9943906338", + "doc_type": "OUT", + "movement_qty": -64.38, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 88, + "event_time_utc": "19/12/2025 02:35:16.-1f+00", + "product_id": 2, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7261750960", + "doc_type": "OUT", + "movement_qty": 61.55, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 89, + "event_time_utc": "14/12/2025 08:25:45.-1f+00", + "product_id": 17, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9312919575", + "doc_type": "OUT", + "movement_qty": -81.27, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 90, + "event_time_utc": "20/12/2025 14:56:05.-1f+00", + "product_id": 14, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1425734508", + "doc_type": "IN", + "movement_qty": 10.09, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 91, + "event_time_utc": "20/12/2025 14:09:33.-1f+00", + "product_id": 15, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV8846036235", + "doc_type": "OUT", + "movement_qty": 19.65, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 92, + "event_time_utc": "4/12/2025 05:46:03.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV7102686237", + "doc_type": "OUT", + "movement_qty": -97.82, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 93, + "event_time_utc": "5/12/2025 21:20:49.-1f+00", + "product_id": 5, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV5464757559", + "doc_type": "IN", + "movement_qty": -70.46, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 94, + "event_time_utc": "10/12/2025 20:25:56.-1f+00", + "product_id": 18, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV1872028926", + "doc_type": "OUT", + "movement_qty": -91.02, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 95, + "event_time_utc": "10/12/2025 11:52:48.-1f+00", + "product_id": 15, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9288948372", + "doc_type": "IN", + "movement_qty": -9.37, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 96, + "event_time_utc": "20/12/2025 05:37:27.-1f+00", + "product_id": 2, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV2498501126", + "doc_type": "OUT", + "movement_qty": -52.73, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 97, + "event_time_utc": "18/12/2025 23:06:43.-1f+00", + "product_id": 17, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV2853128010", + "doc_type": "IN", + "movement_qty": 82.86, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 98, + "event_time_utc": "20/12/2025 19:49:08.-1f+00", + "product_id": 19, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV2170334925", + "doc_type": "IN", + "movement_qty": -68.83, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 99, + "event_time_utc": "15/12/2025 10:29:32.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1614759754", + "doc_type": "IN", + "movement_qty": -67.28, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 100, + "event_time_utc": "4/12/2025 20:01:03.-1f+00", + "product_id": 19, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV9016611475", + "doc_type": "OUT", + "movement_qty": -15.04, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 101, + "event_time_utc": "19/12/2025 17:51:40.-1f+00", + "product_id": 11, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV976304440", + "doc_type": "OUT", + "movement_qty": 52.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 102, + "event_time_utc": "16/12/2025 05:33:02.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV166126828", + "doc_type": "OUT", + "movement_qty": 72.27, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "inventory_movement_id": 103, + "event_time_utc": "12/12/2025 11:48:52.-1f+00", + "product_id": 6, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1765553923", + "doc_type": "IN", + "movement_qty": -20.71, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 104, + "event_time_utc": "6/12/2025 14:33:30.-1f+00", + "product_id": 19, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV6804525846", + "doc_type": "OUT", + "movement_qty": -81.07, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 105, + "event_time_utc": "8/12/2025 22:12:42.-1f+00", + "product_id": 8, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV8789591467", + "doc_type": "IN", + "movement_qty": -5.1, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 106, + "event_time_utc": "11/12/2025 09:18:31.-1f+00", + "product_id": 12, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV4513544935", + "doc_type": "IN", + "movement_qty": 83.36, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 107, + "event_time_utc": "12/12/2025 07:04:30.-1f+00", + "product_id": 20, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5116085025", + "doc_type": "OUT", + "movement_qty": -84.91, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 108, + "event_time_utc": "17/12/2025 14:59:13.-1f+00", + "product_id": 6, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV3611750545", + "doc_type": "IN", + "movement_qty": 25.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 109, + "event_time_utc": "9/12/2025 15:46:37.-1f+00", + "product_id": 6, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV4282405379", + "doc_type": "OUT", + "movement_qty": -98.59, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 110, + "event_time_utc": "8/12/2025 13:52:15.-1f+00", + "product_id": 5, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV8651209937", + "doc_type": "OUT", + "movement_qty": -22.25, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 111, + "event_time_utc": "22/12/2025 12:58:11.-1f+00", + "product_id": 4, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9873350949", + "doc_type": "IN", + "movement_qty": -72.56, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 112, + "event_time_utc": "16/12/2025 08:20:34.-1f+00", + "product_id": 4, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6660743118", + "doc_type": "IN", + "movement_qty": -92.83, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 113, + "event_time_utc": "6/12/2025 10:41:54.-1f+00", + "product_id": 3, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV41662701", + "doc_type": "OUT", + "movement_qty": 37.97, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 114, + "event_time_utc": "30/11/2025 16:26:20.-1f+00", + "product_id": 6, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV2212087021", + "doc_type": "OUT", + "movement_qty": -2.75, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 115, + "event_time_utc": "20/12/2025 12:47:38.-1f+00", + "product_id": 8, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV5057779688", + "doc_type": "OUT", + "movement_qty": -4.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 116, + "event_time_utc": "20/12/2025 13:00:43.-1f+00", + "product_id": 15, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV394379579", + "doc_type": "IN", + "movement_qty": 81.17, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 117, + "event_time_utc": "26/12/2025 01:54:36.-1f+00", + "product_id": 8, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV2882308361", + "doc_type": "IN", + "movement_qty": -99.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 118, + "event_time_utc": "1/12/2025 13:16:40.-1f+00", + "product_id": 9, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV8881271984", + "doc_type": "IN", + "movement_qty": 49.96, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 119, + "event_time_utc": "22/12/2025 20:07:41.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV5381972035", + "doc_type": "OUT", + "movement_qty": 84.22, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 120, + "event_time_utc": "3/12/2025 21:38:51.-1f+00", + "product_id": 20, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV4187995691", + "doc_type": "OUT", + "movement_qty": 15.63, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 121, + "event_time_utc": "24/12/2025 10:42:59.-1f+00", + "product_id": 18, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1515567469", + "doc_type": "IN", + "movement_qty": 38.36, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 122, + "event_time_utc": "24/12/2025 05:13:01.-1f+00", + "product_id": 9, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV6055865684", + "doc_type": "OUT", + "movement_qty": -7.2, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 123, + "event_time_utc": "6/12/2025 14:01:08.-1f+00", + "product_id": 16, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV8765064646", + "doc_type": "IN", + "movement_qty": 58.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 124, + "event_time_utc": "17/12/2025 18:43:44.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV7582771173", + "doc_type": "OUT", + "movement_qty": -41.3, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 125, + "event_time_utc": "12/12/2025 08:02:51.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9279184136", + "doc_type": "IN", + "movement_qty": 7.99, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 126, + "event_time_utc": "14/12/2025 06:10:08.-1f+00", + "product_id": 7, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5946606508", + "doc_type": "OUT", + "movement_qty": 56.28, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 127, + "event_time_utc": "25/12/2025 08:01:46.-1f+00", + "product_id": 6, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV2692990993", + "doc_type": "OUT", + "movement_qty": -55.19, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 128, + "event_time_utc": "12/12/2025 10:42:30.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV1407517132", + "doc_type": "IN", + "movement_qty": 61.76, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 129, + "event_time_utc": "16/12/2025 00:53:07.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV4051966044", + "doc_type": "OUT", + "movement_qty": -45.12, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 130, + "event_time_utc": "21/12/2025 06:51:04.-1f+00", + "product_id": 4, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV2551719944", + "doc_type": "IN", + "movement_qty": 64.93, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 131, + "event_time_utc": "15/12/2025 00:29:33.-1f+00", + "product_id": 13, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV1931436187", + "doc_type": "IN", + "movement_qty": -61.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 132, + "event_time_utc": "7/12/2025 12:17:22.-1f+00", + "product_id": 9, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2716187652", + "doc_type": "OUT", + "movement_qty": -95.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 133, + "event_time_utc": "13/12/2025 04:24:52.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV7426814276", + "doc_type": "OUT", + "movement_qty": -31.22, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 134, + "event_time_utc": "13/12/2025 12:54:11.-1f+00", + "product_id": 14, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6617154539", + "doc_type": "OUT", + "movement_qty": -29.63, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 135, + "event_time_utc": "23/12/2025 14:10:44.-1f+00", + "product_id": 10, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7887614131", + "doc_type": "IN", + "movement_qty": -60.87, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 136, + "event_time_utc": "9/12/2025 04:18:59.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1711589555", + "doc_type": "OUT", + "movement_qty": -92.95, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 137, + "event_time_utc": "24/12/2025 02:13:24.-1f+00", + "product_id": 10, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2104276735", + "doc_type": "IN", + "movement_qty": 23.23, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 138, + "event_time_utc": "9/12/2025 12:18:48.-1f+00", + "product_id": 19, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5306036530", + "doc_type": "OUT", + "movement_qty": 24.92, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 139, + "event_time_utc": "10/12/2025 19:22:52.-1f+00", + "product_id": 3, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV8341928208", + "doc_type": "IN", + "movement_qty": 69.59, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 140, + "event_time_utc": "7/12/2025 03:27:54.-1f+00", + "product_id": 9, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV4518076818", + "doc_type": "IN", + "movement_qty": -57.24, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 141, + "event_time_utc": "21/12/2025 23:47:54.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV8568128251", + "doc_type": "OUT", + "movement_qty": 48.64, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 142, + "event_time_utc": "6/12/2025 05:53:19.-1f+00", + "product_id": 13, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV8368495793", + "doc_type": "OUT", + "movement_qty": 77.06, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 143, + "event_time_utc": "11/12/2025 09:29:44.-1f+00", + "product_id": 14, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9792362562", + "doc_type": "OUT", + "movement_qty": -97.33, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 144, + "event_time_utc": "3/12/2025 13:56:22.-1f+00", + "product_id": 7, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV9191728174", + "doc_type": "OUT", + "movement_qty": -37.8, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 145, + "event_time_utc": "30/11/2025 23:02:48.-1f+00", + "product_id": 12, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1360200357", + "doc_type": "IN", + "movement_qty": 79.11, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 146, + "event_time_utc": "7/12/2025 02:28:07.-1f+00", + "product_id": 16, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV5360459804", + "doc_type": "IN", + "movement_qty": -51.46, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 147, + "event_time_utc": "7/12/2025 13:19:06.-1f+00", + "product_id": 16, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV8642178133", + "doc_type": "IN", + "movement_qty": -42.2, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 148, + "event_time_utc": "22/12/2025 06:31:24.-1f+00", + "product_id": 18, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV5145596323", + "doc_type": "OUT", + "movement_qty": -8.92, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 149, + "event_time_utc": "13/12/2025 09:35:35.-1f+00", + "product_id": 2, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV764845171", + "doc_type": "OUT", + "movement_qty": -1.2, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 150, + "event_time_utc": "9/12/2025 14:48:24.-1f+00", + "product_id": 19, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7226436257", + "doc_type": "IN", + "movement_qty": 27.21, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 151, + "event_time_utc": "18/12/2025 11:20:31.-1f+00", + "product_id": 5, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV597995534", + "doc_type": "IN", + "movement_qty": 47.66, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 152, + "event_time_utc": "13/12/2025 23:38:01.-1f+00", + "product_id": 19, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2652832681", + "doc_type": "OUT", + "movement_qty": -94.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 153, + "event_time_utc": "14/12/2025 00:52:57.-1f+00", + "product_id": 7, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2352419595", + "doc_type": "OUT", + "movement_qty": 71.46, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 154, + "event_time_utc": "8/12/2025 15:40:03.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV6724278170", + "doc_type": "OUT", + "movement_qty": 21.16, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 155, + "event_time_utc": "16/12/2025 18:33:41.-1f+00", + "product_id": 7, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV4663318509", + "doc_type": "IN", + "movement_qty": -61.42, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 156, + "event_time_utc": "16/12/2025 18:17:42.-1f+00", + "product_id": 18, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV3023794803", + "doc_type": "OUT", + "movement_qty": -22.89, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 157, + "event_time_utc": "14/12/2025 04:45:18.-1f+00", + "product_id": 3, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV8320984454", + "doc_type": "IN", + "movement_qty": 84.55, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 158, + "event_time_utc": "18/12/2025 05:01:13.-1f+00", + "product_id": 13, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV3034687286", + "doc_type": "IN", + "movement_qty": 39.28, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 159, + "event_time_utc": "1/12/2025 02:49:36.-1f+00", + "product_id": 13, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5471222983", + "doc_type": "IN", + "movement_qty": 21.48, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 160, + "event_time_utc": "1/12/2025 09:45:59.-1f+00", + "product_id": 10, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV5542908794", + "doc_type": "IN", + "movement_qty": -5.91, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 161, + "event_time_utc": "11/12/2025 22:05:28.-1f+00", + "product_id": 3, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV2214868913", + "doc_type": "OUT", + "movement_qty": -92.49, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 162, + "event_time_utc": "22/12/2025 21:20:25.-1f+00", + "product_id": 5, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV2564635760", + "doc_type": "IN", + "movement_qty": -31.83, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 163, + "event_time_utc": "23/12/2025 23:35:15.-1f+00", + "product_id": 2, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9231845919", + "doc_type": "IN", + "movement_qty": -23.32, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 164, + "event_time_utc": "8/12/2025 06:38:03.-1f+00", + "product_id": 14, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV8938309141", + "doc_type": "IN", + "movement_qty": 54.71, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 165, + "event_time_utc": "23/12/2025 19:43:21.-1f+00", + "product_id": 19, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV7096234894", + "doc_type": "OUT", + "movement_qty": -4.48, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 166, + "event_time_utc": "7/12/2025 19:00:12.-1f+00", + "product_id": 12, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV2929419176", + "doc_type": "IN", + "movement_qty": -48.22, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 167, + "event_time_utc": "10/12/2025 05:50:35.-1f+00", + "product_id": 15, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV4687619394", + "doc_type": "IN", + "movement_qty": 66.67, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 168, + "event_time_utc": "15/12/2025 11:11:26.-1f+00", + "product_id": 16, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV3119072555", + "doc_type": "OUT", + "movement_qty": 92.55, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 169, + "event_time_utc": "20/12/2025 12:30:45.-1f+00", + "product_id": 2, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2782785938", + "doc_type": "IN", + "movement_qty": 31.45, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 170, + "event_time_utc": "22/12/2025 23:13:31.-1f+00", + "product_id": 6, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV2372019696", + "doc_type": "OUT", + "movement_qty": -30.14, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 171, + "event_time_utc": "21/12/2025 23:00:28.-1f+00", + "product_id": 17, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV5829779931", + "doc_type": "OUT", + "movement_qty": -94.83, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 172, + "event_time_utc": "11/12/2025 13:50:59.-1f+00", + "product_id": 10, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV6782951618", + "doc_type": "IN", + "movement_qty": -1.77, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 173, + "event_time_utc": "2/12/2025 10:43:43.-1f+00", + "product_id": 3, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV6952738372", + "doc_type": "IN", + "movement_qty": -36.38, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 174, + "event_time_utc": "11/12/2025 08:10:06.-1f+00", + "product_id": 11, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV8842665149", + "doc_type": "IN", + "movement_qty": -17.53, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 175, + "event_time_utc": "25/12/2025 18:23:21.-1f+00", + "product_id": 6, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2348000498", + "doc_type": "IN", + "movement_qty": 68.05, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 176, + "event_time_utc": "10/12/2025 13:29:49.-1f+00", + "product_id": 6, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV5769266135", + "doc_type": "OUT", + "movement_qty": -49.61, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 177, + "event_time_utc": "1/12/2025 13:23:08.-1f+00", + "product_id": 6, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV3821486910", + "doc_type": "OUT", + "movement_qty": 41.95, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 178, + "event_time_utc": "8/12/2025 12:08:41.-1f+00", + "product_id": 13, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV9459735723", + "doc_type": "IN", + "movement_qty": -91.54, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 179, + "event_time_utc": "8/12/2025 17:09:59.-1f+00", + "product_id": 3, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1244548624", + "doc_type": "IN", + "movement_qty": 45.89, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 180, + "event_time_utc": "25/12/2025 20:14:53.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV1375484074", + "doc_type": "OUT", + "movement_qty": -21.73, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 181, + "event_time_utc": "24/12/2025 19:34:34.-1f+00", + "product_id": 8, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV4903340657", + "doc_type": "OUT", + "movement_qty": 66.88, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 182, + "event_time_utc": "21/12/2025 23:47:30.-1f+00", + "product_id": 15, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5168293928", + "doc_type": "OUT", + "movement_qty": -10.8, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 183, + "event_time_utc": "13/12/2025 22:34:10.-1f+00", + "product_id": 4, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV922910750", + "doc_type": "OUT", + "movement_qty": -21.0, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 184, + "event_time_utc": "9/12/2025 07:20:56.-1f+00", + "product_id": 9, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV6941080905", + "doc_type": "IN", + "movement_qty": 94.74, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 185, + "event_time_utc": "25/12/2025 13:31:48.-1f+00", + "product_id": 12, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV63184695", + "doc_type": "IN", + "movement_qty": -9.6, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 186, + "event_time_utc": "5/12/2025 10:18:09.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV8361499784", + "doc_type": "OUT", + "movement_qty": 34.25, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 187, + "event_time_utc": "16/12/2025 00:01:04.-1f+00", + "product_id": 17, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV2330294049", + "doc_type": "OUT", + "movement_qty": -63.75, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 188, + "event_time_utc": "23/12/2025 16:52:42.-1f+00", + "product_id": 1, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV1939733806", + "doc_type": "IN", + "movement_qty": 68.51, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 189, + "event_time_utc": "19/12/2025 20:45:06.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV762014401", + "doc_type": "IN", + "movement_qty": -49.28, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 190, + "event_time_utc": "1/12/2025 10:28:41.-1f+00", + "product_id": 16, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1932735745", + "doc_type": "IN", + "movement_qty": -43.65, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 191, + "event_time_utc": "5/12/2025 23:45:16.-1f+00", + "product_id": 14, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV6352699952", + "doc_type": "OUT", + "movement_qty": -82.97, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 192, + "event_time_utc": "18/12/2025 06:05:18.-1f+00", + "product_id": 12, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV7306615014", + "doc_type": "OUT", + "movement_qty": -10.68, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 193, + "event_time_utc": "7/12/2025 04:53:23.-1f+00", + "product_id": 15, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV3097043363", + "doc_type": "IN", + "movement_qty": -15.82, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 194, + "event_time_utc": "11/12/2025 13:39:09.-1f+00", + "product_id": 12, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV5029900284", + "doc_type": "IN", + "movement_qty": -77.97, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 195, + "event_time_utc": "11/12/2025 18:06:53.-1f+00", + "product_id": 20, + "warehouse_id": 2, + "bom_id": null, + "doc_number": "MOV4917907754", + "doc_type": "IN", + "movement_qty": -29.87, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 196, + "event_time_utc": "17/12/2025 10:46:21.-1f+00", + "product_id": 16, + "warehouse_id": 4, + "bom_id": null, + "doc_number": "MOV9637155867", + "doc_type": "OUT", + "movement_qty": 27.41, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 197, + "event_time_utc": "20/12/2025 14:21:16.-1f+00", + "product_id": 8, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV7013054886", + "doc_type": "OUT", + "movement_qty": 35.12, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 198, + "event_time_utc": "9/12/2025 01:29:11.-1f+00", + "product_id": 1, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1435418635", + "doc_type": "IN", + "movement_qty": -18.66, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 199, + "event_time_utc": "12/12/2025 03:35:04.-1f+00", + "product_id": 17, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV8769475518", + "doc_type": "OUT", + "movement_qty": -23.18, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 200, + "event_time_utc": "14/12/2025 04:54:09.-1f+00", + "product_id": 14, + "warehouse_id": 5, + "bom_id": null, + "doc_number": "MOV1374126890", + "doc_type": "OUT", + "movement_qty": 70.13, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 201, + "event_time_utc": "23/12/2025 16:26:41.-1f+00", + "product_id": 6, + "warehouse_id": 1, + "bom_id": null, + "doc_number": "MOV1662709510", + "doc_type": "IN", + "movement_qty": -79.55, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "inventory_movement_id": 202, + "event_time_utc": "8/12/2025 11:16:02.-1f+00", + "product_id": 15, + "warehouse_id": 3, + "bom_id": null, + "doc_number": "MOV5984399789", + "doc_type": "IN", + "movement_qty": 24.42, + "uom_code": null, + "unit_price": null, + "discount_unit_price": null, + "amount": null, + "discount_amount": null, + "onhand_qty_after": null, + "responsible_person": null, + "audit_status": null, + "source_system": "WMS", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_inventory_transfer.json b/sql/fact_inventory_transfer.json new file mode 100644 index 0000000..2aa9344 --- /dev/null +++ b/sql/fact_inventory_transfer.json @@ -0,0 +1,122 @@ +[ + { + "inventory_transfer_id": 1, + "transfer_number": "TR86704957", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "12/9/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 2, + "transfer_number": "TR25229646", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "3/2/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 3, + "transfer_number": "TR20773990", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "14/5/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 4, + "transfer_number": "TR79949116", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "28/5/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 5, + "transfer_number": "TR53104189", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "14/12/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 6, + "transfer_number": "TR60080040", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "30/7/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 7, + "transfer_number": "TR65555184", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "21/7/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 8, + "transfer_number": "TR10515517", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "26/7/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 9, + "transfer_number": "TR15089271", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "1/10/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "inventory_transfer_id": 10, + "transfer_number": "TR36502040", + "transfer_name": null, + "tag": null, + "transfer_time_utc": "6/3/2025 16:00:00+00", + "plate_number": null, + "delivery_mode": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_invoice.json b/sql/fact_invoice.json new file mode 100644 index 0000000..5b68031 --- /dev/null +++ b/sql/fact_invoice.json @@ -0,0 +1,322 @@ +[ + { + "invoice_id": 1, + "invoice_request_number": "INV36396299", + "contract_id": null, + "customer_id": 5, + "invoice_amount": 28586.57, + "contract_amount": null, + "invoice_date_utc": "6/7/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 2, + "invoice_request_number": "INV69987646", + "contract_id": null, + "customer_id": 7, + "invoice_amount": 31731.68, + "contract_amount": null, + "invoice_date_utc": "14/6/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 3, + "invoice_request_number": "INV86425647", + "contract_id": null, + "customer_id": 7, + "invoice_amount": 21165.3, + "contract_amount": null, + "invoice_date_utc": "14/7/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 4, + "invoice_request_number": "INV31949080", + "contract_id": null, + "customer_id": 3, + "invoice_amount": 3492.19, + "contract_amount": null, + "invoice_date_utc": "7/3/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 5, + "invoice_request_number": "INV26915438", + "contract_id": null, + "customer_id": 2, + "invoice_amount": 5276.53, + "contract_amount": null, + "invoice_date_utc": "30/4/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 6, + "invoice_request_number": "INV95836121", + "contract_id": null, + "customer_id": 2, + "invoice_amount": 27742.82, + "contract_amount": null, + "invoice_date_utc": "2/2/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 7, + "invoice_request_number": "INV62615584", + "contract_id": null, + "customer_id": 10, + "invoice_amount": 3952.38, + "contract_amount": null, + "invoice_date_utc": "17/5/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 8, + "invoice_request_number": "INV12452264", + "contract_id": null, + "customer_id": 8, + "invoice_amount": 49931.53, + "contract_amount": null, + "invoice_date_utc": "24/1/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 9, + "invoice_request_number": "INV28287981", + "contract_id": null, + "customer_id": 9, + "invoice_amount": 10737.77, + "contract_amount": null, + "invoice_date_utc": "16/4/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 10, + "invoice_request_number": "INV18976893", + "contract_id": null, + "customer_id": 5, + "invoice_amount": 32111.73, + "contract_amount": null, + "invoice_date_utc": "13/7/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 11, + "invoice_request_number": "INV91178844", + "contract_id": null, + "customer_id": 7, + "invoice_amount": 29249.76, + "contract_amount": null, + "invoice_date_utc": "20/8/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 12, + "invoice_request_number": "INV58682278", + "contract_id": null, + "customer_id": 7, + "invoice_amount": 32661.61, + "contract_amount": null, + "invoice_date_utc": "1/5/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 13, + "invoice_request_number": "INV77991324", + "contract_id": null, + "customer_id": 8, + "invoice_amount": 46350.89, + "contract_amount": null, + "invoice_date_utc": "19/6/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 14, + "invoice_request_number": "INV25245957", + "contract_id": null, + "customer_id": 2, + "invoice_amount": 33793.45, + "contract_amount": null, + "invoice_date_utc": "2/4/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 15, + "invoice_request_number": "INV81090744", + "contract_id": null, + "customer_id": 9, + "invoice_amount": 26883.11, + "contract_amount": null, + "invoice_date_utc": "2/8/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 16, + "invoice_request_number": "INV10910850", + "contract_id": null, + "customer_id": 6, + "invoice_amount": 28263.65, + "contract_amount": null, + "invoice_date_utc": "18/6/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 17, + "invoice_request_number": "INV16880249", + "contract_id": null, + "customer_id": 5, + "invoice_amount": 1304.23, + "contract_amount": null, + "invoice_date_utc": "29/9/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 18, + "invoice_request_number": "INV881944", + "contract_id": null, + "customer_id": 2, + "invoice_amount": 47111.67, + "contract_amount": null, + "invoice_date_utc": "29/10/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 19, + "invoice_request_number": "INV63773037", + "contract_id": null, + "customer_id": 5, + "invoice_amount": 39694.31, + "contract_amount": null, + "invoice_date_utc": "4/12/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "invoice_id": 20, + "invoice_request_number": "INV82625925", + "contract_id": null, + "customer_id": 10, + "invoice_amount": 35210.5, + "contract_amount": null, + "invoice_date_utc": "30/10/2025 16:00:00+00", + "actual_invoice_date_utc": null, + "invoice_type": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_labor_report.json b/sql/fact_labor_report.json new file mode 100644 index 0000000..9a268e5 --- /dev/null +++ b/sql/fact_labor_report.json @@ -0,0 +1,902 @@ +[ + { + "labor_report_id": 1, + "work_order_number": "WO6412", + "task_name": null, + "product_id": 19, + "operation_status": null, + "worker_name": "周峰", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "17/12/2025 05:41:28.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 2, + "work_order_number": "WO2388", + "task_name": null, + "product_id": 14, + "operation_status": null, + "worker_name": "熊兵", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "13/12/2025 07:08:00.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 3, + "work_order_number": "WO1629", + "task_name": null, + "product_id": 13, + "operation_status": null, + "worker_name": "伍岩", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "12/12/2025 14:05:41.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 4, + "work_order_number": "WO5008", + "task_name": null, + "product_id": 7, + "operation_status": null, + "worker_name": "王建", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 02:32:16.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 5, + "work_order_number": "WO7200", + "task_name": null, + "product_id": 8, + "operation_status": null, + "worker_name": "赵浩", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "21/12/2025 16:34:12.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 6, + "work_order_number": "WO4458", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "谢桂英", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "14/12/2025 06:54:43.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 7, + "work_order_number": "WO7776", + "task_name": null, + "product_id": 17, + "operation_status": null, + "worker_name": "许萍", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "22/12/2025 00:04:35.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 8, + "work_order_number": "WO5361", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "朱颖", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "14/12/2025 20:27:57.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 9, + "work_order_number": "WO1098", + "task_name": null, + "product_id": 4, + "operation_status": null, + "worker_name": "李辉", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "1/12/2025 12:46:43.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 10, + "work_order_number": "WO5575", + "task_name": null, + "product_id": 16, + "operation_status": null, + "worker_name": "庄霞", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "12/12/2025 18:29:43.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 11, + "work_order_number": "WO1265", + "task_name": null, + "product_id": 4, + "operation_status": null, + "worker_name": "刘桂香", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 10:44:05.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 12, + "work_order_number": "WO3524", + "task_name": null, + "product_id": 10, + "operation_status": null, + "worker_name": "徐兵", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "7/12/2025 22:21:36.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 13, + "work_order_number": "WO1914", + "task_name": null, + "product_id": 14, + "operation_status": null, + "worker_name": "陶霞", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "16/12/2025 06:22:53.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 14, + "work_order_number": "WO6005", + "task_name": null, + "product_id": 15, + "operation_status": null, + "worker_name": "罗东", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "3/12/2025 02:34:28.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 15, + "work_order_number": "WO5624", + "task_name": null, + "product_id": 19, + "operation_status": null, + "worker_name": "刘东", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "2/12/2025 21:47:35.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 16, + "work_order_number": "WO6872", + "task_name": null, + "product_id": 7, + "operation_status": null, + "worker_name": "陈文", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "17/12/2025 20:15:54.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 17, + "work_order_number": "WO4081", + "task_name": null, + "product_id": 12, + "operation_status": null, + "worker_name": "李波", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "6/12/2025 17:20:02.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 18, + "work_order_number": "WO8892", + "task_name": null, + "product_id": 8, + "operation_status": null, + "worker_name": "鲁飞", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "10/12/2025 00:59:40.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 19, + "work_order_number": "WO6903", + "task_name": null, + "product_id": 8, + "operation_status": null, + "worker_name": "赵海燕", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "1/12/2025 18:59:21.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 20, + "work_order_number": "WO1683", + "task_name": null, + "product_id": 20, + "operation_status": null, + "worker_name": "董柳", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "2/12/2025 06:07:09.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 21, + "work_order_number": "WO1211", + "task_name": null, + "product_id": 3, + "operation_status": null, + "worker_name": "王玉珍", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "19/12/2025 08:58:24.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 22, + "work_order_number": "WO8142", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "杜凤英", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "9/12/2025 20:20:59.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 23, + "work_order_number": "WO5186", + "task_name": null, + "product_id": 9, + "operation_status": null, + "worker_name": "杨荣", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "1/12/2025 05:44:20.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 24, + "work_order_number": "WO9034", + "task_name": null, + "product_id": 8, + "operation_status": null, + "worker_name": "江龙", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "12/12/2025 10:32:57.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 25, + "work_order_number": "WO9982", + "task_name": null, + "product_id": 11, + "operation_status": null, + "worker_name": "金峰", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "22/12/2025 04:35:19.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 26, + "work_order_number": "WO7206", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "黄旭", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 10:30:58.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 27, + "work_order_number": "WO7799", + "task_name": null, + "product_id": 7, + "operation_status": null, + "worker_name": "梁海燕", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "25/12/2025 22:48:21.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 28, + "work_order_number": "WO6625", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "赵秀云", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 07:18:49.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 29, + "work_order_number": "WO2794", + "task_name": null, + "product_id": 18, + "operation_status": null, + "worker_name": "张娟", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 22:59:31.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 30, + "work_order_number": "WO2496", + "task_name": null, + "product_id": 18, + "operation_status": null, + "worker_name": "刘淑珍", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "7/12/2025 06:50:59.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 31, + "work_order_number": "WO8351", + "task_name": null, + "product_id": 16, + "operation_status": null, + "worker_name": "李桂珍", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "11/12/2025 11:06:03.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 32, + "work_order_number": "WO8138", + "task_name": null, + "product_id": 5, + "operation_status": null, + "worker_name": "王丽华", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "7/12/2025 00:15:47.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 33, + "work_order_number": "WO9452", + "task_name": null, + "product_id": 20, + "operation_status": null, + "worker_name": "石英", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 21:53:06.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 34, + "work_order_number": "WO4409", + "task_name": null, + "product_id": 4, + "operation_status": null, + "worker_name": "陆桂珍", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "7/12/2025 16:39:07.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 35, + "work_order_number": "WO7925", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "吴欣", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "16/12/2025 06:38:52.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 36, + "work_order_number": "WO8532", + "task_name": null, + "product_id": 16, + "operation_status": null, + "worker_name": "江桂英", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 02:26:17.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 37, + "work_order_number": "WO7266", + "task_name": null, + "product_id": 4, + "operation_status": null, + "worker_name": "周秀英", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "3/12/2025 08:23:32.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 38, + "work_order_number": "WO4046", + "task_name": null, + "product_id": 17, + "operation_status": null, + "worker_name": "魏岩", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "9/12/2025 19:24:07.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 39, + "work_order_number": "WO8200", + "task_name": null, + "product_id": 1, + "operation_status": null, + "worker_name": "曾桂花", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "5/12/2025 22:42:57.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 40, + "work_order_number": "WO3456", + "task_name": null, + "product_id": 16, + "operation_status": null, + "worker_name": "胥秀梅", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "9/12/2025 18:41:22.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 41, + "work_order_number": "WO5008", + "task_name": null, + "product_id": 3, + "operation_status": null, + "worker_name": "郑峰", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "25/12/2025 06:04:38.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 42, + "work_order_number": "WO7168", + "task_name": null, + "product_id": 16, + "operation_status": null, + "worker_name": "季军", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "6/12/2025 01:04:07.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 43, + "work_order_number": "WO7984", + "task_name": null, + "product_id": 15, + "operation_status": null, + "worker_name": "林浩", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "21/12/2025 08:52:28.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 44, + "work_order_number": "WO5715", + "task_name": null, + "product_id": 12, + "operation_status": null, + "worker_name": "向娟", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "21/12/2025 09:13:33.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 45, + "work_order_number": "WO1740", + "task_name": null, + "product_id": 3, + "operation_status": null, + "worker_name": "陈畅", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 04:24:48.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 46, + "work_order_number": "WO7612", + "task_name": null, + "product_id": 6, + "operation_status": null, + "worker_name": "尹荣", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "16/12/2025 11:39:30.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 47, + "work_order_number": "WO7327", + "task_name": null, + "product_id": 17, + "operation_status": null, + "worker_name": "黄慧", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "10/12/2025 16:24:45.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 48, + "work_order_number": "WO4578", + "task_name": null, + "product_id": 9, + "operation_status": null, + "worker_name": "朱秀兰", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 05:01:09.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 49, + "work_order_number": "WO1076", + "task_name": null, + "product_id": 10, + "operation_status": null, + "worker_name": "孟小红", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "22/12/2025 02:15:01.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "labor_report_id": 50, + "work_order_number": "WO2427", + "task_name": null, + "product_id": 17, + "operation_status": null, + "worker_name": "鲍桂花", + "report_qty": 10.0, + "good_qty": null, + "bad_qty": null, + "duration_minutes": 60.0, + "uom_code": null, + "bad_reason_text": null, + "event_time_utc": "16/12/2025 09:22:53.-1f+00", + "supplier_id": null, + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_lead.json b/sql/fact_lead.json new file mode 100644 index 0000000..1cc7d6f --- /dev/null +++ b/sql/fact_lead.json @@ -0,0 +1,401 @@ +[ + { + "lead_id": 1, + "lead_name": "南机空间", + "lead_source": "线下", + "phone": "13454543434", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 01:20:50+00", + "source_system": null, + "last_updated_utc": "26/12/2025 01:20:50+00" + }, + { + "lead_id": 2, + "lead_name": "杨婷", + "lead_source": null, + "phone": "13876785939", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 3, + "lead_name": "袁龙", + "lead_source": null, + "phone": "13623737069", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 4, + "lead_name": "齐萍", + "lead_source": null, + "phone": "13799386215", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 5, + "lead_name": "郭玉梅", + "lead_source": null, + "phone": "15993191738", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 6, + "lead_name": "黄辉", + "lead_source": null, + "phone": "15806905278", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 7, + "lead_name": "王红霞", + "lead_source": null, + "phone": "18597835513", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 8, + "lead_name": "潘红霞", + "lead_source": null, + "phone": "18685119644", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 9, + "lead_name": "乔丽娟", + "lead_source": null, + "phone": "13367787703", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 10, + "lead_name": "尹畅", + "lead_source": null, + "phone": "13056776353", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 11, + "lead_name": "梁淑珍", + "lead_source": null, + "phone": "13286948682", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 12, + "lead_name": "牛淑华", + "lead_source": null, + "phone": "15110881281", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 13, + "lead_name": "郑桂芳", + "lead_source": null, + "phone": "13564615531", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 14, + "lead_name": "连艳", + "lead_source": null, + "phone": "13324744584", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 15, + "lead_name": "秦秀云", + "lead_source": null, + "phone": "15214943375", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 16, + "lead_name": "蒋淑兰", + "lead_source": null, + "phone": "18617232139", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 17, + "lead_name": "刘丽娟", + "lead_source": null, + "phone": "13452051385", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 18, + "lead_name": "何利", + "lead_source": null, + "phone": "18568387229", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 19, + "lead_name": "韦晨", + "lead_source": null, + "phone": "18677015384", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 20, + "lead_name": "陶亮", + "lead_source": null, + "phone": "15537189558", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "lead_id": 21, + "lead_name": "霍龙", + "lead_source": null, + "phone": "13575091415", + "telephone": null, + "email": null, + "address": null, + "industry": null, + "customer_level": null, + "next_contact_time_utc": null, + "follow_up_status": null, + "is_converted": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_operation_task.json b/sql/fact_operation_task.json new file mode 100644 index 0000000..e434070 --- /dev/null +++ b/sql/fact_operation_task.json @@ -0,0 +1,852 @@ +[ + { + "operation_task_id": 1, + "work_order_number": "WO2050", + "operation_id": 9, + "product_id": 12, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "2/12/2025 08:39:49.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 2, + "work_order_number": "WO3412", + "operation_id": 3, + "product_id": 2, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "23/12/2025 12:56:30.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 3, + "work_order_number": "WO1280", + "operation_id": 7, + "product_id": 7, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "9/12/2025 11:29:47.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 4, + "work_order_number": "WO2560", + "operation_id": 9, + "product_id": 11, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "2/12/2025 17:14:48.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 5, + "work_order_number": "WO4545", + "operation_id": 10, + "product_id": 2, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 14:07:08.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 6, + "work_order_number": "WO9513", + "operation_id": 2, + "product_id": 4, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "9/12/2025 06:46:09.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 7, + "work_order_number": "WO4953", + "operation_id": 7, + "product_id": 10, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 18:39:40.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 8, + "work_order_number": "WO8166", + "operation_id": 7, + "product_id": 15, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "2/12/2025 17:39:35.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 9, + "work_order_number": "WO7515", + "operation_id": 8, + "product_id": 6, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "5/12/2025 10:41:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 10, + "work_order_number": "WO7376", + "operation_id": 2, + "product_id": 12, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 17:48:15.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 11, + "work_order_number": "WO4728", + "operation_id": 4, + "product_id": 20, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "15/12/2025 06:03:04.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 12, + "work_order_number": "WO4393", + "operation_id": 4, + "product_id": 5, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 07:57:55.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 13, + "work_order_number": "WO9411", + "operation_id": 8, + "product_id": 13, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "15/12/2025 19:16:43.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 14, + "work_order_number": "WO5246", + "operation_id": 7, + "product_id": 8, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "19/12/2025 20:58:25.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 15, + "work_order_number": "WO6942", + "operation_id": 1, + "product_id": 19, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "23/12/2025 09:33:24.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 16, + "work_order_number": "WO5874", + "operation_id": 4, + "product_id": 19, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "3/12/2025 00:37:44.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 17, + "work_order_number": "WO7218", + "operation_id": 2, + "product_id": 7, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "14/12/2025 22:03:44.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 18, + "work_order_number": "WO5273", + "operation_id": 1, + "product_id": 14, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "26/12/2025 04:52:23.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 19, + "work_order_number": "WO2136", + "operation_id": 7, + "product_id": 20, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 12:44:27.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 20, + "work_order_number": "WO2274", + "operation_id": 6, + "product_id": 15, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "24/12/2025 02:34:14.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 21, + "work_order_number": "WO4494", + "operation_id": 8, + "product_id": 5, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 19:33:37.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 22, + "work_order_number": "WO9614", + "operation_id": 4, + "product_id": 20, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "21/12/2025 07:58:16.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 23, + "work_order_number": "WO7692", + "operation_id": 10, + "product_id": 7, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "25/12/2025 06:29:31.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 24, + "work_order_number": "WO8917", + "operation_id": 8, + "product_id": 9, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "7/12/2025 08:04:15.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 25, + "work_order_number": "WO3626", + "operation_id": 9, + "product_id": 17, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "16/12/2025 23:17:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 26, + "work_order_number": "WO8432", + "operation_id": 1, + "product_id": 17, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "5/12/2025 19:27:30.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 27, + "work_order_number": "WO5053", + "operation_id": 6, + "product_id": 19, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "5/12/2025 19:19:41.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 28, + "work_order_number": "WO5175", + "operation_id": 9, + "product_id": 15, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "22/12/2025 13:22:32.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 29, + "work_order_number": "WO6692", + "operation_id": 1, + "product_id": 17, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "23/12/2025 22:41:23.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 30, + "work_order_number": "WO9712", + "operation_id": 3, + "product_id": 18, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "11/12/2025 02:41:38.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 31, + "work_order_number": "WO7626", + "operation_id": 8, + "product_id": 13, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "10/12/2025 11:33:13.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 32, + "work_order_number": "WO7697", + "operation_id": 8, + "product_id": 11, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "23/12/2025 03:31:49.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 33, + "work_order_number": "WO9549", + "operation_id": 4, + "product_id": 16, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "18/12/2025 15:55:47.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 34, + "work_order_number": "WO4509", + "operation_id": 4, + "product_id": 17, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "23/12/2025 11:21:31.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 35, + "work_order_number": "WO6662", + "operation_id": 6, + "product_id": 8, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "5/12/2025 01:16:16.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 36, + "work_order_number": "WO1397", + "operation_id": 3, + "product_id": 16, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "19/12/2025 18:18:53.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 37, + "work_order_number": "WO1895", + "operation_id": 7, + "product_id": 13, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "13/12/2025 06:58:01.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 38, + "work_order_number": "WO5442", + "operation_id": 5, + "product_id": 14, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "15/12/2025 05:37:07.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 39, + "work_order_number": "WO9508", + "operation_id": 10, + "product_id": 14, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "12/12/2025 04:07:43.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 40, + "work_order_number": "WO4792", + "operation_id": 3, + "product_id": 3, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "12/12/2025 08:22:44.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 41, + "work_order_number": "WO5999", + "operation_id": 2, + "product_id": 10, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "8/12/2025 20:22:04.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 42, + "work_order_number": "WO2856", + "operation_id": 5, + "product_id": 18, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "18/12/2025 16:18:09.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 43, + "work_order_number": "WO6857", + "operation_id": 5, + "product_id": 9, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "19/12/2025 23:59:26.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 44, + "work_order_number": "WO9478", + "operation_id": 6, + "product_id": 2, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "18/12/2025 14:22:32.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 45, + "work_order_number": "WO5980", + "operation_id": 7, + "product_id": 13, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "11/12/2025 13:40:42.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 46, + "work_order_number": "WO3082", + "operation_id": 2, + "product_id": 20, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "26/12/2025 03:01:27.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 47, + "work_order_number": "WO9465", + "operation_id": 7, + "product_id": 13, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "14/12/2025 03:12:40.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 48, + "work_order_number": "WO6276", + "operation_id": 8, + "product_id": 18, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "25/12/2025 23:51:26.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 49, + "work_order_number": "WO9260", + "operation_id": 5, + "product_id": 16, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 06:59:31.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "operation_task_id": 50, + "work_order_number": "WO2693", + "operation_id": 9, + "product_id": 6, + "planned_start_time_utc": null, + "planned_end_time_utc": null, + "actual_start_time_utc": null, + "actual_end_time_utc": null, + "planned_qty": 100.0, + "good_qty": 98.0, + "bad_qty": 2.0, + "bad_reason_text": null, + "event_time_utc": "20/12/2025 01:40:23.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_opportunity.json b/sql/fact_opportunity.json new file mode 100644 index 0000000..ed9ee99 --- /dev/null +++ b/sql/fact_opportunity.json @@ -0,0 +1,212 @@ +[ + { + "opportunity_id": 1, + "opportunity_name": "出现商机", + "customer_id": 3, + "opportunity_amount": 10178.17, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 2, + "opportunity_name": "一起商机", + "customer_id": 3, + "opportunity_amount": 88569.91, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 3, + "opportunity_name": "程序商机", + "customer_id": 5, + "opportunity_amount": 84196.37, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 4, + "opportunity_name": "说明商机", + "customer_id": 2, + "opportunity_amount": 10003.92, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 5, + "opportunity_name": "孩子商机", + "customer_id": 10, + "opportunity_amount": 72339.91, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 6, + "opportunity_name": "控制商机", + "customer_id": 3, + "opportunity_amount": 44096.15, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 7, + "opportunity_name": "那么商机", + "customer_id": 9, + "opportunity_amount": 47860.89, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 8, + "opportunity_name": "游戏商机", + "customer_id": 6, + "opportunity_amount": 24936.97, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 9, + "opportunity_name": "评论商机", + "customer_id": 6, + "opportunity_amount": 51882.51, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 10, + "opportunity_name": "显示商机", + "customer_id": 9, + "opportunity_amount": 68081.56, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 11, + "opportunity_name": "建设商机", + "customer_id": 2, + "opportunity_amount": 42515.21, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 12, + "opportunity_name": "电话商机", + "customer_id": 5, + "opportunity_amount": 48403.11, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 13, + "opportunity_name": "当然商机", + "customer_id": 2, + "opportunity_amount": 38638.05, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 14, + "opportunity_name": "美国商机", + "customer_id": 7, + "opportunity_amount": 27767.22, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "opportunity_id": 15, + "opportunity_name": "因为商机", + "customer_id": 6, + "opportunity_amount": 89630.93, + "expected_deal_date_utc": null, + "next_contact_time_utc": null, + "status_group": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_production_plan.json b/sql/fact_production_plan.json new file mode 100644 index 0000000..c0e177e --- /dev/null +++ b/sql/fact_production_plan.json @@ -0,0 +1,142 @@ +[ + { + "production_plan_id": 1, + "assembly_work_order_number": "AWO40743515", + "work_order_count": 5, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 2, + "assembly_work_order_number": "AWO8398648", + "work_order_count": 5, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 3, + "assembly_work_order_number": "AWO14185163", + "work_order_count": 3, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 4, + "assembly_work_order_number": "AWO15498809", + "work_order_count": 5, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 5, + "assembly_work_order_number": "AWO49921525", + "work_order_count": 5, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 6, + "assembly_work_order_number": "AWO36182849", + "work_order_count": 3, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 7, + "assembly_work_order_number": "AWO64090531", + "work_order_count": 4, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 8, + "assembly_work_order_number": "AWO30488156", + "work_order_count": 1, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 9, + "assembly_work_order_number": "AWO86661804", + "work_order_count": 1, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "production_plan_id": 10, + "assembly_work_order_number": "AWO72968658", + "work_order_count": 5, + "finished_count": null, + "planned_qty": 100.0, + "completed_qty": null, + "plan_status": null, + "progress_text": null, + "customer_name": null, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_purchase_order.json b/sql/fact_purchase_order.json new file mode 100644 index 0000000..7de4599 --- /dev/null +++ b/sql/fact_purchase_order.json @@ -0,0 +1,322 @@ +[ + { + "purchase_order_id": 1, + "purchase_order_number": "PO46687889", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "11/7/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 2, + "purchase_order_number": "PO52924265", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "20/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 3, + "purchase_order_number": "PO71059352", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "15/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 4, + "purchase_order_number": "PO81421429", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "11/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 5, + "purchase_order_number": "PO30442381", + "supplier_id": 2, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "22/5/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 6, + "purchase_order_number": "PO41110345", + "supplier_id": 2, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "31/5/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 7, + "purchase_order_number": "PO49227120", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 8, + "purchase_order_number": "PO53044033", + "supplier_id": 9, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/8/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 9, + "purchase_order_number": "PO35646206", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "25/9/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 10, + "purchase_order_number": "PO94831278", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "21/8/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 11, + "purchase_order_number": "PO49569902", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "22/9/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 12, + "purchase_order_number": "PO76891465", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "20/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 13, + "purchase_order_number": "PO9667614", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 14, + "purchase_order_number": "PO5970081", + "supplier_id": 9, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "17/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 15, + "purchase_order_number": "PO13604696", + "supplier_id": 3, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "2/5/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 16, + "purchase_order_number": "PO4070883", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "15/8/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 17, + "purchase_order_number": "PO85696564", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "5/8/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 18, + "purchase_order_number": "PO82742840", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/2/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 19, + "purchase_order_number": "PO22906470", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "7/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_order_id": 20, + "purchase_order_number": "PO13277527", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "26/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "delivery_note_number": null, + "settlement_date_utc": null, + "settlement_term": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_purchase_receipt.json b/sql/fact_purchase_receipt.json new file mode 100644 index 0000000..31b7f7f --- /dev/null +++ b/sql/fact_purchase_receipt.json @@ -0,0 +1,692 @@ +[ + { + "purchase_receipt_id": 1, + "purchase_receipt_number": "PRC62269319", + "supplier_id": 6, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "30/6/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 8077.53, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 2, + "purchase_receipt_number": "PRC92878594", + "supplier_id": 6, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "3/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 40158.06, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 3, + "purchase_receipt_number": "PRC31612946", + "supplier_id": 7, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "17/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 27389.28, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 4, + "purchase_receipt_number": "PRC31143884", + "supplier_id": 5, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/1/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 35097.27, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 5, + "purchase_receipt_number": "PRC99344468", + "supplier_id": 3, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/6/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 21866.74, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 6, + "purchase_receipt_number": "PRC47897055", + "supplier_id": 2, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "19/2/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 42154.17, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 7, + "purchase_receipt_number": "PRC10587372", + "supplier_id": 8, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "2/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 23628.14, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 8, + "purchase_receipt_number": "PRC53434148", + "supplier_id": 8, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "4/6/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 22893.66, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 9, + "purchase_receipt_number": "PRC41830227", + "supplier_id": 3, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "18/8/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 16564.55, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 10, + "purchase_receipt_number": "PRC23410942", + "supplier_id": 3, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "4/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 31343.7, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 11, + "purchase_receipt_number": "PRC4288899", + "supplier_id": 1, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "9/7/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 46399.39, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 12, + "purchase_receipt_number": "PRC66873664", + "supplier_id": 8, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 18013.85, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 13, + "purchase_receipt_number": "PRC29982381", + "supplier_id": 1, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 5657.47, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 14, + "purchase_receipt_number": "PRC18938089", + "supplier_id": 9, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "9/10/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 37930.6, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 15, + "purchase_receipt_number": "PRC72177866", + "supplier_id": 2, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "26/9/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 21695.35, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 16, + "purchase_receipt_number": "PRC2413184", + "supplier_id": 6, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "26/9/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 17542.38, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 17, + "purchase_receipt_number": "PRC69715967", + "supplier_id": 7, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "30/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 45678.83, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 18, + "purchase_receipt_number": "PRC60563471", + "supplier_id": 10, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "3/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 17592.33, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 19, + "purchase_receipt_number": "PRC47113160", + "supplier_id": 1, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "4/9/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 18159.37, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 20, + "purchase_receipt_number": "PRC43664801", + "supplier_id": 4, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "16/12/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 26731.57, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 21, + "purchase_receipt_number": "PRC44202374", + "supplier_id": 1, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "13/1/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 12562.58, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 22, + "purchase_receipt_number": "PRC63546936", + "supplier_id": 5, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "13/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 39919.96, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 23, + "purchase_receipt_number": "PRC64419670", + "supplier_id": 4, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "2/12/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 21096.59, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 24, + "purchase_receipt_number": "PRC66177549", + "supplier_id": 9, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "19/7/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 40616.92, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 25, + "purchase_receipt_number": "PRC91456627", + "supplier_id": 7, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "4/10/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 33138.8, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 26, + "purchase_receipt_number": "PRC71057930", + "supplier_id": 2, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/3/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 43056.15, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 27, + "purchase_receipt_number": "PRC85631925", + "supplier_id": 7, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "13/6/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 19537.31, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 28, + "purchase_receipt_number": "PRC95966229", + "supplier_id": 5, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "29/10/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 41578.09, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 29, + "purchase_receipt_number": "PRC28157373", + "supplier_id": 5, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "8/11/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 38451.56, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_receipt_id": 30, + "purchase_receipt_number": "PRC59018290", + "supplier_id": 2, + "purchase_order_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "3/4/2025 16:00:00+00", + "delivery_date_utc": null, + "contract_number": null, + "amount": 28844.54, + "estimated_cost": null, + "receipt_qty_total": 100.0, + "paid_amount": null, + "unpaid_amount": null, + "payment_status": null, + "returned_qty": null, + "not_returned_qty": null, + "return_status": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_purchase_request.json b/sql/fact_purchase_request.json new file mode 100644 index 0000000..d811afc --- /dev/null +++ b/sql/fact_purchase_request.json @@ -0,0 +1,322 @@ +[ + { + "purchase_request_id": 1, + "purchase_request_number": "PR74373407", + "supplier_id": 3, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "9/9/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 40343.59, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 2, + "purchase_request_number": "PR3197164", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/8/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 10282.5, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 3, + "purchase_request_number": "PR25213757", + "supplier_id": 9, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/12/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 30633.66, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 4, + "purchase_request_number": "PR77290340", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "12/4/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 43069.26, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 5, + "purchase_request_number": "PR4968719", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "3/12/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 12416.66, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 6, + "purchase_request_number": "PR43870003", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "19/9/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 17904.11, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 7, + "purchase_request_number": "PR29802771", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/2/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 12826.31, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 8, + "purchase_request_number": "PR66861238", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "15/4/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 17490.41, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 9, + "purchase_request_number": "PR1133525", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "25/1/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 22588.43, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 10, + "purchase_request_number": "PR90232127", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/2/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 48310.07, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 11, + "purchase_request_number": "PR87761304", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "30/9/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 9754.54, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 12, + "purchase_request_number": "PR34707409", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/7/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 17262.64, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 13, + "purchase_request_number": "PR88853692", + "supplier_id": 5, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "29/10/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 29440.3, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 14, + "purchase_request_number": "PR81818155", + "supplier_id": 3, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "15/9/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 38365.41, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 15, + "purchase_request_number": "PR68228246", + "supplier_id": 2, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "27/1/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 36025.66, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 16, + "purchase_request_number": "PR531304", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/1/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 21933.52, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 17, + "purchase_request_number": "PR29567205", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/3/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 37543.26, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 18, + "purchase_request_number": "PR21593197", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "24/1/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 34965.61, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 19, + "purchase_request_number": "PR44612134", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "12/1/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 29549.23, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_request_id": 20, + "purchase_request_number": "PR11456222", + "supplier_id": 4, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "1/4/2025 16:00:00+00", + "delivery_date_utc": null, + "total_amount": 34575.02, + "status": null, + "related_order_number": null, + "contract_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_purchase_return.json b/sql/fact_purchase_return.json new file mode 100644 index 0000000..cfc1a28 --- /dev/null +++ b/sql/fact_purchase_return.json @@ -0,0 +1,72 @@ +[ + { + "purchase_return_id": 1, + "purchase_return_number": "PRET10055889", + "supplier_id": 1, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "11/6/2025 16:00:00+00", + "return_reason": "损坏", + "contract_number": null, + "related_order_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_return_id": 2, + "purchase_return_number": "PRET94654435", + "supplier_id": 8, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "8/9/2025 16:00:00+00", + "return_reason": "损坏", + "contract_number": null, + "related_order_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_return_id": 3, + "purchase_return_number": "PRET35781733", + "supplier_id": 10, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/8/2025 16:00:00+00", + "return_reason": "损坏", + "contract_number": null, + "related_order_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_return_id": 4, + "purchase_return_number": "PRET26734831", + "supplier_id": 4, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "8/9/2025 16:00:00+00", + "return_reason": "损坏", + "contract_number": null, + "related_order_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "purchase_return_id": 5, + "purchase_return_number": "PRET48298023", + "supplier_id": 7, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "1/6/2025 16:00:00+00", + "return_reason": "损坏", + "contract_number": null, + "related_order_number": null, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_quality_inspection.json b/sql/fact_quality_inspection.json new file mode 100644 index 0000000..518370d --- /dev/null +++ b/sql/fact_quality_inspection.json @@ -0,0 +1,722 @@ +[ + { + "quality_inspection_id": 1, + "inspection_number": "QC79170659", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "6/12/2025 08:34:41.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 2, + "inspection_number": "QC2841764", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 5, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "19/12/2025 11:33:45.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 3, + "inspection_number": "QC32330966", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 1, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "15/12/2025 21:49:03.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 4, + "inspection_number": "QC83789760", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 3, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "5/12/2025 03:01:43.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 5, + "inspection_number": "QC23748035", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "5/12/2025 13:19:26.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 6, + "inspection_number": "QC85580865", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 7, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "17/12/2025 10:55:38.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 7, + "inspection_number": "QC26947404", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 15, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "7/12/2025 02:22:38.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 8, + "inspection_number": "QC14244389", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 10, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "14/12/2025 03:21:23.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 9, + "inspection_number": "QC17261920", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 10, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "17/12/2025 08:20:08.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 10, + "inspection_number": "QC65680691", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 10, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "5/12/2025 19:44:53.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 11, + "inspection_number": "QC45201646", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 10, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "20/12/2025 05:34:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 12, + "inspection_number": "QC2904611", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 20, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "10/12/2025 04:04:54.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 13, + "inspection_number": "QC50101129", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "2/12/2025 10:56:45.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 14, + "inspection_number": "QC7654355", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 1, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "20/12/2025 03:36:22.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 15, + "inspection_number": "QC65262328", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 13, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "16/12/2025 01:39:27.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 16, + "inspection_number": "QC57707379", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "6/12/2025 02:57:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 17, + "inspection_number": "QC82854790", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 10, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "18/12/2025 07:01:24.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 18, + "inspection_number": "QC31389428", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 3, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "1/12/2025 11:36:51.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 19, + "inspection_number": "QC36989388", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 3, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "18/12/2025 05:59:26.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 20, + "inspection_number": "QC1416316", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "25/12/2025 07:12:03.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 21, + "inspection_number": "QC53323968", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 20, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "24/12/2025 05:05:29.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 22, + "inspection_number": "QC18108361", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 20, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "5/12/2025 08:28:06.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 23, + "inspection_number": "QC57970449", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 4, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "15/12/2025 21:37:57.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 24, + "inspection_number": "QC58088949", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "10/12/2025 15:20:33.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 25, + "inspection_number": "QC3644411", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 3, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "20/12/2025 07:56:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 26, + "inspection_number": "QC58243176", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 6, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "26/12/2025 05:22:18.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 27, + "inspection_number": "QC21517907", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "18/12/2025 03:00:20.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 28, + "inspection_number": "QC68062150", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "6/12/2025 21:26:49.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 29, + "inspection_number": "QC33189904", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 14, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "4/12/2025 11:29:26.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 30, + "inspection_number": "QC68953666", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 2, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "22/12/2025 08:50:42.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 31, + "inspection_number": "QC29461199", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 1, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "16/12/2025 15:51:08.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 32, + "inspection_number": "QC45390570", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "5/12/2025 07:04:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 33, + "inspection_number": "QC24502363", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 11, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "21/12/2025 19:48:36.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 34, + "inspection_number": "QC34620271", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 8, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "15/12/2025 07:39:23.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 35, + "inspection_number": "QC56151325", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "16/12/2025 00:21:15.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 36, + "inspection_number": "QC86107178", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 19, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "11/12/2025 02:12:45.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 37, + "inspection_number": "QC99037226", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 9, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "18/12/2025 06:14:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 38, + "inspection_number": "QC27521865", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 18, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "IN_PROCESS", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "25/12/2025 17:38:29.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 39, + "inspection_number": "QC11711535", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 6, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "15/12/2025 15:19:18.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "quality_inspection_id": 40, + "inspection_number": "QC26733168", + "inspection_batch_number": null, + "work_order_number": null, + "product_id": 17, + "supplier_id": null, + "qc_reason_id": null, + "qc_type": "FINAL", + "pass_qty": 95.0, + "fail_qty": 5.0, + "sales_order_number": null, + "customer_name": null, + "ship_qty": null, + "event_time_utc": "20/12/2025 10:23:15.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_sales_order.json b/sql/fact_sales_order.json new file mode 100644 index 0000000..4e27fae --- /dev/null +++ b/sql/fact_sales_order.json @@ -0,0 +1,2102 @@ +[ + { + "sales_order_id": 2, + "sales_order_number": "SO7878700783", + "customer_id": 2, + "contract_number": "CTR40349808", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "5/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 3935.29, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 3, + "sales_order_number": "SO4854514050", + "customer_id": 3, + "contract_number": "CTR79617018", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "10/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 25883.36, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 4, + "sales_order_number": "SO5049246824", + "customer_id": 4, + "contract_number": "CTR20915447", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "26/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 1084.26, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 5, + "sales_order_number": "SO7641374511", + "customer_id": 6, + "contract_number": "CTR31217890", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "15/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 34593.87, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 6, + "sales_order_number": "SO6011764213", + "customer_id": 7, + "contract_number": "CTR20113710", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "22/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 23399.78, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 7, + "sales_order_number": "SO9140788472", + "customer_id": 8, + "contract_number": "CTR32400280", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "17/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 31094.53, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 8, + "sales_order_number": "SO1887233351", + "customer_id": 10, + "contract_number": "CTR94259520", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "8/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 25618.78, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 9, + "sales_order_number": "SO3526402751", + "customer_id": 9, + "contract_number": "CTR82870246", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 13420.94, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 10, + "sales_order_number": "SO7156933969", + "customer_id": 9, + "contract_number": "CTR39755225", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "12/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 2447.18, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 11, + "sales_order_number": "SO6935713614", + "customer_id": 7, + "contract_number": "CTR22306595", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "12/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 43820.57, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 12, + "sales_order_number": "SO8310493820", + "customer_id": 9, + "contract_number": "CTR61805684", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "29/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 10758.12, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 13, + "sales_order_number": "SO8910518370", + "customer_id": 6, + "contract_number": "CTR80829367", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "16/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 10665.9, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 14, + "sales_order_number": "SO8003043712", + "customer_id": 1, + "contract_number": "CTR29998652", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "3/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 9856.0, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 15, + "sales_order_number": "SO4708580199", + "customer_id": 4, + "contract_number": "CTR70525591", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "24/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 44217.09, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 16, + "sales_order_number": "SO4181277571", + "customer_id": 6, + "contract_number": "CTR10321879", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 32729.99, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 17, + "sales_order_number": "SO2298514161", + "customer_id": 10, + "contract_number": "CTR16472141", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "19/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 34516.82, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 18, + "sales_order_number": "SO5307920121", + "customer_id": 10, + "contract_number": "CTR24904970", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 43030.53, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 19, + "sales_order_number": "SO8147524558", + "customer_id": 6, + "contract_number": "CTR25308181", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "18/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 35023.42, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 20, + "sales_order_number": "SO6715955200", + "customer_id": 5, + "contract_number": "CTR13534037", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 39254.55, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 21, + "sales_order_number": "SO4670881851", + "customer_id": 7, + "contract_number": "CTR76575425", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "28/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 7619.98, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 22, + "sales_order_number": "SO7624862371", + "customer_id": 4, + "contract_number": "CTR61389753", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "23/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 15283.29, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 23, + "sales_order_number": "SO9516827098", + "customer_id": 1, + "contract_number": "CTR13443902", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "2/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 25159.02, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 24, + "sales_order_number": "SO9363282976", + "customer_id": 2, + "contract_number": "CTR87091549", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 9171.66, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 25, + "sales_order_number": "SO2769859433", + "customer_id": 7, + "contract_number": "CTR50640866", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "12/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 10236.56, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 26, + "sales_order_number": "SO608849209", + "customer_id": 1, + "contract_number": "CTR11135459", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 26987.48, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 27, + "sales_order_number": "SO9231130171", + "customer_id": 6, + "contract_number": "CTR45249389", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "5/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 39269.27, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 28, + "sales_order_number": "SO5424551550", + "customer_id": 8, + "contract_number": "CTR43911628", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 13320.16, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 29, + "sales_order_number": "SO8110152190", + "customer_id": 3, + "contract_number": "CTR98040482", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "6/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 44983.76, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 30, + "sales_order_number": "SO6882581665", + "customer_id": 1, + "contract_number": "CTR46480025", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "4/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 37221.89, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 31, + "sales_order_number": "SO3480759478", + "customer_id": 9, + "contract_number": "CTR70258142", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "16/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 44372.52, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 32, + "sales_order_number": "SO8828071380", + "customer_id": 5, + "contract_number": "CTR94180439", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "30/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 7988.4, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 33, + "sales_order_number": "SO792243271", + "customer_id": 3, + "contract_number": "CTR64779649", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "28/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 27026.92, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 34, + "sales_order_number": "SO6533824306", + "customer_id": 1, + "contract_number": "CTR89778549", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "24/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 24400.17, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 35, + "sales_order_number": "SO2631933044", + "customer_id": 10, + "contract_number": "CTR31841412", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "10/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 32250.46, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 36, + "sales_order_number": "SO6349894550", + "customer_id": 4, + "contract_number": "CTR72536197", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "22/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 15149.48, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 37, + "sales_order_number": "SO7196838676", + "customer_id": 7, + "contract_number": "CTR79270712", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 46393.08, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 38, + "sales_order_number": "SO9360627164", + "customer_id": 4, + "contract_number": "CTR20161672", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "23/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 21925.34, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 39, + "sales_order_number": "SO4317704570", + "customer_id": 1, + "contract_number": "CTR29465336", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "23/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 26266.71, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 40, + "sales_order_number": "SO7237963169", + "customer_id": 4, + "contract_number": "CTR79610038", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "2/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 6718.38, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 41, + "sales_order_number": "SO5576507471", + "customer_id": 4, + "contract_number": "CTR56211725", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "17/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 34789.3, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 42, + "sales_order_number": "SO4839336482", + "customer_id": 4, + "contract_number": "CTR79307470", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "28/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 44033.88, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 43, + "sales_order_number": "SO4073510698", + "customer_id": 5, + "contract_number": "CTR70698174", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "19/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 18373.3, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 44, + "sales_order_number": "SO7000874640", + "customer_id": 6, + "contract_number": "CTR37136213", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "19/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 46219.42, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 45, + "sales_order_number": "SO133033915", + "customer_id": 2, + "contract_number": "CTR13653161", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "19/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 9940.78, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 46, + "sales_order_number": "SO6587242194", + "customer_id": 5, + "contract_number": "CTR16075492", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "6/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 27799.79, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 47, + "sales_order_number": "SO2700226473", + "customer_id": 4, + "contract_number": "CTR90432901", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 28587.13, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 48, + "sales_order_number": "SO5791495401", + "customer_id": 3, + "contract_number": "CTR18542082", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "27/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 38575.9, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 49, + "sales_order_number": "SO79315877", + "customer_id": 8, + "contract_number": "CTR33078872", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "28/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 27743.86, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 50, + "sales_order_number": "SO8878209424", + "customer_id": 9, + "contract_number": "CTR31480850", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "15/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 37889.42, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 51, + "sales_order_number": "SO1745089925", + "customer_id": 6, + "contract_number": "CTR56890433", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 24991.7, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "25/12/2025 19:16:27.-1f+00", + "source_system": "ERP", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "sales_order_id": 52, + "sales_order_number": "SO9690025423", + "customer_id": 5, + "contract_number": "CTR58701556", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "16/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 40425.79, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 53, + "sales_order_number": "SO9232792099", + "customer_id": 8, + "contract_number": "CTR54823019", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "19/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 13009.43, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 54, + "sales_order_number": "SO5050933803", + "customer_id": 9, + "contract_number": "CTR65039786", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "15/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 25811.49, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 55, + "sales_order_number": "SO3012001039", + "customer_id": 10, + "contract_number": "CTR92639528", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "11/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 37388.11, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 56, + "sales_order_number": "SO1602334374", + "customer_id": 8, + "contract_number": "CTR87929234", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 43802.59, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 57, + "sales_order_number": "SO4802270121", + "customer_id": 8, + "contract_number": "CTR22760510", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 18122.29, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 58, + "sales_order_number": "SO3142797293", + "customer_id": 9, + "contract_number": "CTR83679307", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "11/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 46099.27, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 59, + "sales_order_number": "SO4635332240", + "customer_id": 9, + "contract_number": "CTR71663813", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "7/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 40291.52, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 60, + "sales_order_number": "SO7757796597", + "customer_id": 3, + "contract_number": "CTR94989034", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "29/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 17168.06, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 61, + "sales_order_number": "SO6642204531", + "customer_id": 5, + "contract_number": "CTR59483235", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "18/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 3396.2, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 62, + "sales_order_number": "SO3374440944", + "customer_id": 5, + "contract_number": "CTR65276407", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 35218.35, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 63, + "sales_order_number": "SO9245988277", + "customer_id": 6, + "contract_number": "CTR79743551", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "4/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 4489.84, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 64, + "sales_order_number": "SO8311834123", + "customer_id": 2, + "contract_number": "CTR85634235", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "23/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 21090.43, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 65, + "sales_order_number": "SO1161278243", + "customer_id": 3, + "contract_number": "CTR49960702", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "9/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 7267.35, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 66, + "sales_order_number": "SO9037922272", + "customer_id": 3, + "contract_number": "CTR44203771", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 36834.4, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 67, + "sales_order_number": "SO2208645095", + "customer_id": 7, + "contract_number": "CTR71713343", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "30/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 35262.44, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 68, + "sales_order_number": "SO733456404", + "customer_id": 7, + "contract_number": "CTR69193313", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "7/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 26622.38, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 69, + "sales_order_number": "SO6336269727", + "customer_id": 10, + "contract_number": "CTR84370136", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "5/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 30749.46, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 70, + "sales_order_number": "SO7798464195", + "customer_id": 10, + "contract_number": "CTR25331448", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 22755.43, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 71, + "sales_order_number": "SO338047238", + "customer_id": 5, + "contract_number": "CTR47439529", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 10785.56, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 72, + "sales_order_number": "SO6368764663", + "customer_id": 1, + "contract_number": "CTR83603364", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 18130.77, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 73, + "sales_order_number": "SO6784669459", + "customer_id": 6, + "contract_number": "CTR80307244", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 40502.44, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 74, + "sales_order_number": "SO727504239", + "customer_id": 3, + "contract_number": "CTR60381626", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "13/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 13512.22, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 75, + "sales_order_number": "SO7374708858", + "customer_id": 5, + "contract_number": "CTR19208614", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "10/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 34080.74, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 76, + "sales_order_number": "SO5792817247", + "customer_id": 5, + "contract_number": "CTR85663494", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "3/12/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 31208.29, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 77, + "sales_order_number": "SO7730026474", + "customer_id": 7, + "contract_number": "CTR65125418", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "30/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 33275.8, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 78, + "sales_order_number": "SO1429864612", + "customer_id": 10, + "contract_number": "CTR12500531", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "13/3/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 39549.0, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 79, + "sales_order_number": "SO2919441400", + "customer_id": 9, + "contract_number": "CTR65311514", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "18/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 43343.22, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 80, + "sales_order_number": "SO4863116860", + "customer_id": 10, + "contract_number": "CTR22407240", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "8/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 37604.21, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 81, + "sales_order_number": "SO2378595571", + "customer_id": 2, + "contract_number": "CTR51911336", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/4/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 36922.47, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 82, + "sales_order_number": "SO4103829617", + "customer_id": 4, + "contract_number": "CTR26336038", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "14/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 9992.8, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 83, + "sales_order_number": "SO3423529569", + "customer_id": 6, + "contract_number": "CTR66606302", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "1/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 1210.14, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 84, + "sales_order_number": "SO4612538723", + "customer_id": 8, + "contract_number": "CTR73549971", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "13/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 33880.48, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 85, + "sales_order_number": "SO8462507738", + "customer_id": 6, + "contract_number": "CTR53636297", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "18/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 16454.93, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 86, + "sales_order_number": "SO5538815345", + "customer_id": 10, + "contract_number": "CTR88666464", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "15/8/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 41379.32, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 87, + "sales_order_number": "SO4223490831", + "customer_id": 7, + "contract_number": "CTR61545576", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "22/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 2871.48, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 88, + "sales_order_number": "SO9663030316", + "customer_id": 4, + "contract_number": "CTR12333967", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "6/10/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 11424.47, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 89, + "sales_order_number": "SO2262926063", + "customer_id": 4, + "contract_number": "CTR47569719", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "15/9/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 2717.76, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 90, + "sales_order_number": "SO2972754129", + "customer_id": 9, + "contract_number": "CTR78928844", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "6/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 38367.04, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 91, + "sales_order_number": "SO1813007571", + "customer_id": 1, + "contract_number": "CTR48521116", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "10/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 7176.57, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 92, + "sales_order_number": "SO5433378253", + "customer_id": 1, + "contract_number": "CTR26092045", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "27/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 11757.82, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 93, + "sales_order_number": "SO6891386222", + "customer_id": 3, + "contract_number": "CTR53265230", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "24/2/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 19407.9, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 94, + "sales_order_number": "SO870646438", + "customer_id": 1, + "contract_number": "CTR88955645", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "20/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 46455.17, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 95, + "sales_order_number": "SO1982529853", + "customer_id": 8, + "contract_number": "CTR95229508", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "23/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 26726.89, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 96, + "sales_order_number": "SO4704972767", + "customer_id": 5, + "contract_number": "CTR49278135", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "7/7/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 46465.91, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 97, + "sales_order_number": "SO7236262408", + "customer_id": 3, + "contract_number": "CTR60643615", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "22/6/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 23795.86, + "payment_status": "PARTIAL", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 98, + "sales_order_number": "SO3033216953", + "customer_id": 3, + "contract_number": "CTR69407768", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "30/1/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 8931.17, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 99, + "sales_order_number": "SO680733264", + "customer_id": 1, + "contract_number": "CTR89436068", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "22/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 3713.88, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 100, + "sales_order_number": "SO6234270421", + "customer_id": 5, + "contract_number": "CTR65839447", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "5/5/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 8115.2, + "payment_status": "PAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + }, + { + "sales_order_id": 101, + "sales_order_number": "SO5005265767", + "customer_id": 8, + "contract_number": "CTR36563394", + "currency_code": "CNY", + "fx_rate": 1.0, + "order_date_utc": "29/11/2025 16:00:00+00", + "delivery_date_utc": null, + "deal_amount": 18445.7, + "payment_status": "UNPAID", + "transport_mode": null, + "packaging": null, + "customs_number": null, + "production_doc_number": null, + "stage": null, + "result": null, + "event_time_utc": "26/12/2025 05:36:09.-1f+00", + "source_system": "ERP", + "last_updated_utc": "26/12/2025 05:36:09.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_sales_return.json b/sql/fact_sales_return.json new file mode 100644 index 0000000..40a3d43 --- /dev/null +++ b/sql/fact_sales_return.json @@ -0,0 +1,152 @@ +[ + { + "sales_return_id": 1, + "sales_return_number": "RET33607093", + "customer_id": 8, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "22/2/2025 16:00:00+00", + "amount": 3873.24, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 2, + "sales_return_number": "RET17956713", + "customer_id": 1, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "10/8/2025 16:00:00+00", + "amount": 4677.54, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 3, + "sales_return_number": "RET64807117", + "customer_id": 4, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "11/5/2025 16:00:00+00", + "amount": 4327.39, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 4, + "sales_return_number": "RET67765737", + "customer_id": 8, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "17/7/2025 16:00:00+00", + "amount": 4937.5, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 5, + "sales_return_number": "RET20539715", + "customer_id": 4, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "31/5/2025 16:00:00+00", + "amount": 3970.17, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 6, + "sales_return_number": "RET19806490", + "customer_id": 2, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "10/8/2025 16:00:00+00", + "amount": 1424.25, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 7, + "sales_return_number": "RET65157989", + "customer_id": 4, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "17/7/2025 16:00:00+00", + "amount": 2324.6, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 8, + "sales_return_number": "RET23958183", + "customer_id": 5, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "27/10/2025 16:00:00+00", + "amount": 715.04, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 9, + "sales_return_number": "RET13387787", + "customer_id": 3, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "18/4/2025 16:00:00+00", + "amount": 3646.64, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_return_id": 10, + "sales_return_number": "RET13090325", + "customer_id": 4, + "contract_number": null, + "return_reason": "质量问题", + "is_reship": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "31/1/2025 16:00:00+00", + "amount": 3795.88, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_sales_shipment.json b/sql/fact_sales_shipment.json new file mode 100644 index 0000000..8c3af9c --- /dev/null +++ b/sql/fact_sales_shipment.json @@ -0,0 +1,482 @@ +[ + { + "sales_shipment_id": 1, + "shipment_number": "SH24823992", + "customer_id": 7, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "3/7/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 12086.56, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 2, + "shipment_number": "SH34635337", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "27/9/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 18792.46, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 3, + "shipment_number": "SH88366414", + "customer_id": 1, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "9/12/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 5747.19, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 4, + "shipment_number": "SH57206465", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "31/5/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 3556.75, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 5, + "shipment_number": "SH57511283", + "customer_id": 3, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "23/9/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 12916.49, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 6, + "shipment_number": "SH48137491", + "customer_id": 1, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "5/6/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 7813.07, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 7, + "shipment_number": "SH27541058", + "customer_id": 3, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "26/4/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 12511.55, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 8, + "shipment_number": "SH70220367", + "customer_id": 7, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "18/9/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 3138.85, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 9, + "shipment_number": "SH55193994", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "27/2/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 11332.5, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 10, + "shipment_number": "SH17856572", + "customer_id": 1, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "29/4/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 13076.02, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 11, + "shipment_number": "SH28422300", + "customer_id": 10, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "20/12/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 7275.45, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 12, + "shipment_number": "SH61251946", + "customer_id": 8, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "8/10/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 19433.81, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 13, + "shipment_number": "SH64983519", + "customer_id": 9, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "1/12/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 16433.8, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 14, + "shipment_number": "SH73216699", + "customer_id": 9, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "1/3/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 6400.14, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 15, + "shipment_number": "SH81029178", + "customer_id": 5, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "26/6/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 16318.92, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 16, + "shipment_number": "SH72625775", + "customer_id": 6, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "21/12/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 11595.61, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 17, + "shipment_number": "SH61687721", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "7/5/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 5710.41, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 18, + "shipment_number": "SH32435794", + "customer_id": 3, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "7/4/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 17535.07, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 19, + "shipment_number": "SH29875774", + "customer_id": 8, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "31/1/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 4436.25, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 20, + "shipment_number": "SH9932668", + "customer_id": 9, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "11/1/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 5888.78, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 21, + "shipment_number": "SH36240144", + "customer_id": 9, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/3/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 17137.02, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 22, + "shipment_number": "SH96157441", + "customer_id": 3, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "15/1/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 1167.8, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 23, + "shipment_number": "SH18823114", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "30/8/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 8319.09, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 24, + "shipment_number": "SH28275600", + "customer_id": 7, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "17/6/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 16231.08, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 25, + "shipment_number": "SH84358888", + "customer_id": 4, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "28/11/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 17400.46, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 26, + "shipment_number": "SH13641433", + "customer_id": 10, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "6/9/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 18342.63, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 27, + "shipment_number": "SH18469349", + "customer_id": 5, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "20/2/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 15479.16, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 28, + "shipment_number": "SH18420257", + "customer_id": 9, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "13/3/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 10248.8, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 29, + "shipment_number": "SH64951199", + "customer_id": 10, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "14/11/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 13947.55, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "sales_shipment_id": 30, + "shipment_number": "SH36825810", + "customer_id": 1, + "contract_number": null, + "currency_code": null, + "fx_rate": null, + "doc_date_utc": "20/2/2025 16:00:00+00", + "delivery_date_utc": null, + "transport_mode": null, + "customs_number": null, + "amount": 9783.1, + "event_time_utc": "26/12/2025 05:36:10.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_scrap.json b/sql/fact_scrap.json new file mode 100644 index 0000000..ce8d483 --- /dev/null +++ b/sql/fact_scrap.json @@ -0,0 +1,92 @@ +[ + { + "scrap_id": 1, + "scrap_number": "SCR29224832", + "warehouse_name": null, + "scrap_time_utc": "11/11/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 2, + "scrap_number": "SCR94358885", + "warehouse_name": null, + "scrap_time_utc": "23/1/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 3, + "scrap_number": "SCR5362558", + "warehouse_name": null, + "scrap_time_utc": "20/6/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 4, + "scrap_number": "SCR20950494", + "warehouse_name": null, + "scrap_time_utc": "1/4/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 5, + "scrap_number": "SCR40775893", + "warehouse_name": null, + "scrap_time_utc": "21/3/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 6, + "scrap_number": "SCR56499569", + "warehouse_name": null, + "scrap_time_utc": "27/2/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 7, + "scrap_number": "SCR31480752", + "warehouse_name": null, + "scrap_time_utc": "3/7/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 8, + "scrap_number": "SCR38577142", + "warehouse_name": null, + "scrap_time_utc": "4/2/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 9, + "scrap_number": "SCR37752664", + "warehouse_name": null, + "scrap_time_utc": "14/3/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "scrap_id": 10, + "scrap_number": "SCR56248465", + "warehouse_name": null, + "scrap_time_utc": "10/10/2025 16:00:00+00", + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_work_order.json b/sql/fact_work_order.json new file mode 100644 index 0000000..08a67dc --- /dev/null +++ b/sql/fact_work_order.json @@ -0,0 +1,1082 @@ +[ + { + "work_order_id": 2, + "work_order_number": "WO1311343859", + "product_id": 5, + "supplier_id": null, + "routing_id": null, + "planned_qty": 178.48, + "completed_qty": 36.56, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "14/12/2025 01:59:43.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 3, + "work_order_number": "WO9923496857", + "product_id": 17, + "supplier_id": null, + "routing_id": null, + "planned_qty": 597.09, + "completed_qty": 70.19, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "16/12/2025 09:34:58.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 4, + "work_order_number": "WO8789389900", + "product_id": 2, + "supplier_id": null, + "routing_id": null, + "planned_qty": 155.41, + "completed_qty": 0.67, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "16/12/2025 21:11:44.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 5, + "work_order_number": "WO2482215249", + "product_id": 15, + "supplier_id": null, + "routing_id": null, + "planned_qty": 750.14, + "completed_qty": 67.73, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "19/12/2025 13:11:18.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 6, + "work_order_number": "WO7208743306", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 779.02, + "completed_qty": 87.16, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "6/12/2025 22:58:59.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 7, + "work_order_number": "WO2627731017", + "product_id": 12, + "supplier_id": null, + "routing_id": null, + "planned_qty": 508.3, + "completed_qty": 26.98, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "11/12/2025 20:53:07.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 8, + "work_order_number": "WO4850159101", + "product_id": 12, + "supplier_id": null, + "routing_id": null, + "planned_qty": 634.34, + "completed_qty": 90.93, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "15/12/2025 23:25:55.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 9, + "work_order_number": "WO9695903980", + "product_id": 12, + "supplier_id": null, + "routing_id": null, + "planned_qty": 735.85, + "completed_qty": 1.67, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "7/12/2025 08:10:37.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 10, + "work_order_number": "WO8309470953", + "product_id": 8, + "supplier_id": null, + "routing_id": null, + "planned_qty": 557.73, + "completed_qty": 89.68, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "15/12/2025 08:00:43.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 11, + "work_order_number": "WO401244827", + "product_id": 19, + "supplier_id": null, + "routing_id": null, + "planned_qty": 827.6, + "completed_qty": 77.58, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "7/12/2025 14:47:08.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 12, + "work_order_number": "WO6691486926", + "product_id": 7, + "supplier_id": null, + "routing_id": null, + "planned_qty": 255.96, + "completed_qty": 98.27, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "4/12/2025 13:21:02.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 13, + "work_order_number": "WO3888053760", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 530.65, + "completed_qty": 74.79, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "5/12/2025 23:41:29.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 14, + "work_order_number": "WO504420733", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 444.61, + "completed_qty": 96.32, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "23/12/2025 01:11:59.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 15, + "work_order_number": "WO9230834468", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 933.88, + "completed_qty": 85.69, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "17/12/2025 04:00:25.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 16, + "work_order_number": "WO2647623657", + "product_id": 19, + "supplier_id": null, + "routing_id": null, + "planned_qty": 525.49, + "completed_qty": 15.23, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "1/12/2025 05:11:35.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 17, + "work_order_number": "WO2826970895", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 453.69, + "completed_qty": 55.8, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "21/12/2025 01:47:12.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 18, + "work_order_number": "WO7229615910", + "product_id": 7, + "supplier_id": null, + "routing_id": null, + "planned_qty": 488.57, + "completed_qty": 73.08, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "7/12/2025 23:51:10.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 19, + "work_order_number": "WO6599527157", + "product_id": 5, + "supplier_id": null, + "routing_id": null, + "planned_qty": 908.67, + "completed_qty": 13.1, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "23/12/2025 23:02:48.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 20, + "work_order_number": "WO9004268804", + "product_id": 9, + "supplier_id": null, + "routing_id": null, + "planned_qty": 842.9, + "completed_qty": 97.1, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "6/12/2025 19:52:20.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 21, + "work_order_number": "WO2928092287", + "product_id": 13, + "supplier_id": null, + "routing_id": null, + "planned_qty": 751.65, + "completed_qty": 16.7, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "17/12/2025 23:40:18.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 22, + "work_order_number": "WO9454862469", + "product_id": 4, + "supplier_id": null, + "routing_id": null, + "planned_qty": 476.45, + "completed_qty": 31.7, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "12/12/2025 12:24:29.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 23, + "work_order_number": "WO1666517570", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 798.58, + "completed_qty": 83.67, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "25/12/2025 17:25:41.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 24, + "work_order_number": "WO933293100", + "product_id": 17, + "supplier_id": null, + "routing_id": null, + "planned_qty": 938.15, + "completed_qty": 26.12, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "1/12/2025 21:00:49.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 25, + "work_order_number": "WO4939773064", + "product_id": 16, + "supplier_id": null, + "routing_id": null, + "planned_qty": 130.88, + "completed_qty": 88.99, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "1/12/2025 04:01:26.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 26, + "work_order_number": "WO5729225680", + "product_id": 19, + "supplier_id": null, + "routing_id": null, + "planned_qty": 459.21, + "completed_qty": 44.91, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "17/12/2025 16:11:24.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 27, + "work_order_number": "WO9805972939", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 202.68, + "completed_qty": 44.48, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "2/12/2025 16:01:00.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 28, + "work_order_number": "WO7899635251", + "product_id": 6, + "supplier_id": null, + "routing_id": null, + "planned_qty": 586.46, + "completed_qty": 72.88, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "11/12/2025 10:30:33.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 29, + "work_order_number": "WO219252860", + "product_id": 18, + "supplier_id": null, + "routing_id": null, + "planned_qty": 639.76, + "completed_qty": 45.35, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "1/12/2025 04:33:38.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 30, + "work_order_number": "WO9224408965", + "product_id": 2, + "supplier_id": null, + "routing_id": null, + "planned_qty": 364.1, + "completed_qty": 15.57, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "15/12/2025 18:22:09.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 31, + "work_order_number": "WO8866324243", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 368.2, + "completed_qty": 90.27, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "24/12/2025 23:03:26.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "25/12/2025 19:16:27.-1f+00" + }, + { + "work_order_id": 32, + "work_order_number": "WO3029956039", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 781.0, + "completed_qty": 42.17, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "11/12/2025 09:11:15.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 33, + "work_order_number": "WO6321026612", + "product_id": 6, + "supplier_id": null, + "routing_id": null, + "planned_qty": 193.82, + "completed_qty": 64.39, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "25/12/2025 04:25:33.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 34, + "work_order_number": "WO6936024240", + "product_id": 6, + "supplier_id": null, + "routing_id": null, + "planned_qty": 548.29, + "completed_qty": 56.58, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "5/12/2025 08:30:12.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 35, + "work_order_number": "WO1671850933", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 482.36, + "completed_qty": 24.36, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "17/12/2025 17:33:56.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 36, + "work_order_number": "WO6060802518", + "product_id": 20, + "supplier_id": null, + "routing_id": null, + "planned_qty": 908.94, + "completed_qty": 82.06, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "22/12/2025 11:22:22.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 37, + "work_order_number": "WO1867164372", + "product_id": 11, + "supplier_id": null, + "routing_id": null, + "planned_qty": 611.46, + "completed_qty": 86.8, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "8/12/2025 22:22:41.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 38, + "work_order_number": "WO128369879", + "product_id": 9, + "supplier_id": null, + "routing_id": null, + "planned_qty": 753.97, + "completed_qty": 34.29, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "12/12/2025 10:58:34.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 39, + "work_order_number": "WO7068019689", + "product_id": 4, + "supplier_id": null, + "routing_id": null, + "planned_qty": 674.26, + "completed_qty": 49.6, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "9/12/2025 08:42:31.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 40, + "work_order_number": "WO2603114686", + "product_id": 6, + "supplier_id": null, + "routing_id": null, + "planned_qty": 529.35, + "completed_qty": 77.95, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "14/12/2025 16:05:50.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 41, + "work_order_number": "WO287542536", + "product_id": 13, + "supplier_id": null, + "routing_id": null, + "planned_qty": 335.18, + "completed_qty": 43.8, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "13/12/2025 12:22:44.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 42, + "work_order_number": "WO7475649628", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 484.94, + "completed_qty": 13.78, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "15/12/2025 14:00:19.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 43, + "work_order_number": "WO2028251217", + "product_id": 18, + "supplier_id": null, + "routing_id": null, + "planned_qty": 129.48, + "completed_qty": 3.73, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "10/12/2025 14:56:33.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 44, + "work_order_number": "WO4871284107", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 589.77, + "completed_qty": 9.11, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "14/12/2025 02:21:50.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 45, + "work_order_number": "WO547512654", + "product_id": 7, + "supplier_id": null, + "routing_id": null, + "planned_qty": 337.79, + "completed_qty": 2.42, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "25/12/2025 18:41:43.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 46, + "work_order_number": "WO7812001116", + "product_id": 17, + "supplier_id": null, + "routing_id": null, + "planned_qty": 906.63, + "completed_qty": 22.54, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "4/12/2025 04:08:18.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 47, + "work_order_number": "WO2721438033", + "product_id": 15, + "supplier_id": null, + "routing_id": null, + "planned_qty": 162.79, + "completed_qty": 15.81, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "2/12/2025 12:26:48.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 48, + "work_order_number": "WO9426476918", + "product_id": 11, + "supplier_id": null, + "routing_id": null, + "planned_qty": 454.54, + "completed_qty": 36.29, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "22/12/2025 18:38:50.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 49, + "work_order_number": "WO1570658643", + "product_id": 12, + "supplier_id": null, + "routing_id": null, + "planned_qty": 201.71, + "completed_qty": 75.33, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "6/12/2025 11:15:02.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 50, + "work_order_number": "WO6664397408", + "product_id": 16, + "supplier_id": null, + "routing_id": null, + "planned_qty": 677.28, + "completed_qty": 97.52, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "14/12/2025 21:48:14.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 51, + "work_order_number": "WO9155547008", + "product_id": 11, + "supplier_id": null, + "routing_id": null, + "planned_qty": 777.69, + "completed_qty": 79.36, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "3/12/2025 02:36:07.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 52, + "work_order_number": "WO7436028406", + "product_id": 9, + "supplier_id": null, + "routing_id": null, + "planned_qty": 361.77, + "completed_qty": 3.24, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "17/12/2025 12:27:16.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 53, + "work_order_number": "WO5193220198", + "product_id": 4, + "supplier_id": null, + "routing_id": null, + "planned_qty": 571.64, + "completed_qty": 3.29, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "15/12/2025 00:09:02.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 54, + "work_order_number": "WO8229056464", + "product_id": 11, + "supplier_id": null, + "routing_id": null, + "planned_qty": 283.89, + "completed_qty": 0.43, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "9/12/2025 18:10:39.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 55, + "work_order_number": "WO2121604450", + "product_id": 18, + "supplier_id": null, + "routing_id": null, + "planned_qty": 267.32, + "completed_qty": 7.63, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "7/12/2025 03:55:05.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 56, + "work_order_number": "WO1568409655", + "product_id": 7, + "supplier_id": null, + "routing_id": null, + "planned_qty": 772.66, + "completed_qty": 21.89, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "4/12/2025 11:53:47.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 57, + "work_order_number": "WO1159181235", + "product_id": 1, + "supplier_id": null, + "routing_id": null, + "planned_qty": 956.22, + "completed_qty": 31.47, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "6/12/2025 18:26:28.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 58, + "work_order_number": "WO4442420146", + "product_id": 5, + "supplier_id": null, + "routing_id": null, + "planned_qty": 596.51, + "completed_qty": 15.75, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "STARTED", + "event_time_utc": "21/12/2025 03:07:54.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 59, + "work_order_number": "WO3475553153", + "product_id": 14, + "supplier_id": null, + "routing_id": null, + "planned_qty": 986.09, + "completed_qty": 54.85, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "OPEN", + "event_time_utc": "19/12/2025 01:27:49.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 60, + "work_order_number": "WO3911371277", + "product_id": 10, + "supplier_id": null, + "routing_id": null, + "planned_qty": 561.8, + "completed_qty": 60.26, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "3/12/2025 03:27:56.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + }, + { + "work_order_id": 61, + "work_order_number": "WO3789446205", + "product_id": 7, + "supplier_id": null, + "routing_id": null, + "planned_qty": 164.88, + "completed_qty": 14.17, + "operation_good_qty": null, + "operation_bad_qty": null, + "qc_good_qty": null, + "qc_bad_qty": null, + "status": "CLOSED", + "event_time_utc": "20/12/2025 13:17:45.-1f+00", + "source_doc_number": null, + "source_system": "MES", + "last_updated_utc": "26/12/2025 05:36:10.-1f+00" + } +] \ No newline at end of file diff --git a/sql/fact_write_off.json b/sql/fact_write_off.json new file mode 100644 index 0000000..1e40abc --- /dev/null +++ b/sql/fact_write_off.json @@ -0,0 +1,162 @@ +[ + { + "write_off_id": 1, + "write_off_number": "WOFF4957019", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 5, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 2250.39, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 2, + "write_off_number": "WOFF86844048", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 7, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 4232.3, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 3, + "write_off_number": "WOFF5965561", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 6, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 2778.39, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 4, + "write_off_number": "WOFF35734725", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 6, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 1788.25, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 5, + "write_off_number": "WOFF98551101", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 1, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 680.83, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 6, + "write_off_number": "WOFF46489967", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 2, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 272.54, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 7, + "write_off_number": "WOFF51718480", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 9, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 3758.38, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 8, + "write_off_number": "WOFF79810467", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 6, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 596.88, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 9, + "write_off_number": "WOFF97024109", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 7, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 1841.56, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + }, + { + "write_off_id": 10, + "write_off_number": "WOFF59780497", + "doc_date_utc": null, + "contract_id": null, + "customer_id": 2, + "supplier_id": null, + "write_off_type": null, + "currency_code": null, + "fx_rate": null, + "discount_amount": null, + "write_off_amount": 1310.11, + "event_time_utc": "26/12/2025 05:36:11.-1f+00", + "source_system": null, + "last_updated_utc": "26/12/2025 05:36:11.-1f+00" + } +] \ No newline at end of file diff --git a/sql/现有表.json b/sql/现有表.json new file mode 100644 index 0000000..da6143e --- /dev/null +++ b/sql/现有表.json @@ -0,0 +1,107 @@ +[ + { + "table_name": "dim_bom" + }, + { + "table_name": "dim_contract" + }, + { + "table_name": "dim_customer" + }, + { + "table_name": "dim_equipment" + }, + { + "table_name": "dim_operation" + }, + { + "table_name": "dim_person" + }, + { + "table_name": "dim_product" + }, + { + "table_name": "dim_qc_reason" + }, + { + "table_name": "dim_routing" + }, + { + "table_name": "dim_supplier" + }, + { + "table_name": "dim_warehouse" + }, + { + "table_name": "fact_ap_payment" + }, + { + "table_name": "fact_ar_receipt" + }, + { + "table_name": "fact_cash_flow" + }, + { + "table_name": "fact_commission" + }, + { + "table_name": "fact_inventory_count" + }, + { + "table_name": "fact_inventory_movement" + }, + { + "table_name": "fact_inventory_transfer" + }, + { + "table_name": "fact_invoice" + }, + { + "table_name": "fact_labor_report" + }, + { + "table_name": "fact_lead" + }, + { + "table_name": "fact_operation_task" + }, + { + "table_name": "fact_opportunity" + }, + { + "table_name": "fact_production_plan" + }, + { + "table_name": "fact_purchase_order" + }, + { + "table_name": "fact_purchase_receipt" + }, + { + "table_name": "fact_purchase_request" + }, + { + "table_name": "fact_purchase_return" + }, + { + "table_name": "fact_quality_inspection" + }, + { + "table_name": "fact_sales_order" + }, + { + "table_name": "fact_sales_return" + }, + { + "table_name": "fact_sales_shipment" + }, + { + "table_name": "fact_scrap" + }, + { + "table_name": "fact_work_order" + }, + { + "table_name": "fact_write_off" + } +] \ No newline at end of file