# `Sp_Manufacture_ProcessReport` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `iState` | `int` |
| 2 | IN | `sLoginId` | `varchar(100)` |
| 3 | IN | `sMachineId_s` | `varchar(100)` |
| 4 | IN | `sProceeAllMachine` | `varchar(10)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `bFilter` | `longtext` |
| 8 | IN | `sUnTaskFormId` | `varchar(100)` |
| 9 | IN | `pageNum` | `int` |
| 10 | IN | `pageSize` | `int` |
| 11 | OUT | `totalCount` | `int` |
| 12 | IN | `countCloumn` | `varchar(5000)` |
| 13 | OUT | `countMapJson` | `longtext` |
| 14 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 15 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 16 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 — process-level production-report dashboard. Counterpart of `Sp_Manufacture_PlanReport`: groups by 工序 instead of by 计划, so a planner can see, for each machine and state (`iState`), what process steps were reported and what plc/machine-data telemetry was captured.

**What it does:** Allocates temp `p_Tmp_ProductionReport`, inserts the process-report rows filtered by `iState` (报工状态), `sMachineId_s` (single or all-machine via `sProceeAllMachine`), `sBrId`, `sSuId`, `sLoginId`. `UPDATE`s the temp set with `eleprocessmachine` join data (process metadata per machine), `plc_machinedata` (live PLC telemetry), `SalRejectGoodsSlave` (reject totals), `SftLoginInfo` and `SysSystemSettings`. Returns the paged dataset via the standard `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*` block.

**Invocation:** Standard report-proc signature, but no `gdsconfigformmaster.sSqlStr` in the live snapshot references `Sp_Manufacture_ProcessReport` and no other routine in `xlyweberp_saas_ai` calls it. No xly-src install script either. Status: appears orphaned in this snapshot — likely once bound to a 报工/工序日报 form whose data-source was rewired; candidate for maintainer audit.
