# `Sp_Manufacture_ReportProgress` (procedure)

> 机台计划，主计划：工序进度查看


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sWorkOrderId` | `varchar(50)` |
| 2 | IN | `s_sWorkOrderId` | `varchar(50)` |
| 3 | IN | `sLoginId` | `varchar(50)` |
| 4 | IN | `sBrId` | `varchar(50)` |
| 5 | IN | `sSuId` | `varchar(50)` |
| 6 | IN | `bFilter` | `text` |
| 7 | IN | `pageNum` | `int` |
| 8 | IN | `pageSize` | `int` |
| 9 | OUT | `totalCount` | `int` |
| 10 | IN | `countCloumn` | `varchar(50)` |
| 11 | OUT | `countMapJson` | `longtext` |
| 12 | IN | `sFilterOrderBy` | `varchar(50)` |
| 13 | IN | `sGroupby_select_sql` | `varchar(50)` |
| 14 | IN | `sGroupby_group_sql` | `varchar(50)` |

## Body

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

## Narrative

**Business context:** 常用模块 → 常用设置 → 生产进度(弹窗) — `机台计划，主计划：工序进度查看`. Pop-up dialog data source that shows the per-process progress for one selected work-order (passed as `p_sWorkOrderId` for the master and `s_sWorkOrderId` for the slave/specific phase). Operators on the machine-plan or master-plan board double-click a row to see how far each process has progressed.

**What it does:** Builds scratch `p_TempTable` from `mftworkorderprocess` and `mftproductionplan`, joined back to `MftProductionPlanSlave` for plan-vs.-actual rows. Two enrichment passes (`UPDATE p_TempTable P` / `UPDATE p_TempTable t`) layer reported qty and progress per-process. Final result paged via `Sp_Outstanding_Query`. ~12K body, comments include `机台计划，主计划：工序进度查看`.

**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` of the 生产进度(弹窗) form `sId 101251240115016209138719510` under module 常用设置 (`sId 19211681019715652613160550`) → 常用模块. Loaded when the user opens the progress pop-up. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ReportProgress.sql`; customer override exists in `script/客户/无锡中江/`.
