# `Sp_chart_OrderProcess` (procedure)

> 工单进度


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLoginId` | `varchar(100)` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |
| 4 | IN | `bFilter` | `varchar(5000)` |
| 5 | OUT | `sCode` | `int` |
| 6 | OUT | `sReturn` | `longtext` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_chart_OrderProcess`'`._

## Narrative

**Business context:** 生产图表分析 → 图表分析 → 决策支持 — the dashboard card 工单生产进度 renders a per-part/per-process Gantt-style heatmap (sCharType `ColorBlock`) showing scheduled hours for the work-order's processes across the active production plan window.

**What it does:** Walks `mftproductionplanslave` for in-progress states `(1,2)` to compute the time span, then joins `mftworkordercontrol` → `mftworkordermaster` → `mftworkorderprocess` to gather parts and processes, builds temp tables `TMP_Part`, `TMP_PartDate`, and loops to emit a JSON payload of `data`/`day`/`sParts` for the chart-renderer's color-block grid.

**Invocation:** Bound via `gdsconfigcharmaster.sProcedureName` on chart card `15982487350003335095626557923300` under 生产图表分析.

Hard-coded to work-order `sBillNo = 'SGD20080065'` — the routine ignores its `bFilter` input and always renders that one demo order. Either a partially-finished feature or developer-only sample; flag for maintainer audit if used in production.
