# `Sp_Manufacture_ReportQty_BtnEventCalc` (procedure)

> @author: 							
								
		@date:20220321  封存				
								
		@describe : 生产数量统计							
								
		1.统计工单所有工序计划数与实际上报数，创建表Manufacture_CalcReportQty，以备快速查询


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sReturn` | `varchar(1000)` |
| 6 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 生产管理 — `生产数量统计` button-event calc. Self-marked `封存` (sealed/archived) on 2022-03-21 in the proc COMMENT. Pre-archival use case: for the work-orders selected on the grid, count all phase plan-qty vs. actual-report-qty and persist a per-工单/工序 snapshot into helper table `Manufacture_CalcReportQty` plus dynamic columns on form `gdsconfigformslave sParentId='20221120093809227887221363776979'` so a fast-query report can read it back.

**What it does:** Parses the standard generic-dispatch payload `sProInParam` (`$.params[0].value[*].sId` = slave ids). Enumerates `eleprocessphase` rows via a cursor to size up dynamic columns; rebuilds `p_TempTable` and `p_MftWorkOrderProcess` from `MftWorkOrderProcess` joined to `elecustomer`. Refreshes `gdsconfigformslave` for that fixed `sParentId` — `DELETE` + `INSERT INTO gdsconfigformslave (…) VALUES (…)` per-phase to materialise dynamic columns shaped like `decimal(18,0) default 0 comment '<phase-name>'`. Self-test snippet in the comments shows the form_sId is `20221120093809227887221363776979`.

**Invocation:** Status: appears orphaned and self-marked `封存`. No form-master binding, no `gdsmodule` hook, no other-routine caller, no xly-src reference. The `sProInParam`/`sReturn`/`sCode` signature is the generic-dispatch button-event shape (would have been called via `GenericProcedureCallServiceImpl.doGenericProcedureCall()`). Candidate for maintainer cleanup.
