# `Sp_WorkOrder_CalcDataStdCenterProcess` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `bChangeRate` | `int` |
| 3 | IN | `sLoginId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `p_iControlType` | `int` |
| 7 | IN | `p_sId` | `varchar(100)` |
| 8 | IN | `p_sControlId` | `varchar(100)` |
| 9 | IN | `p_sProcessId` | `varchar(100)` |
| 10 | IN | `p_sType` | `varchar(100)` |
| 11 | IN | `p_iOrder` | `int` |
| 12 | IN | `p_dAdjustLossQty` | `double` |
| 13 | IN | `p_sProcessName` | `varchar(100)` |
| 14 | IN | `p_sProductionPaperFormulaId` | `varchar(100)` |
| 15 | IN | `p_sCapacityFormulaId` | `varchar(100)` |
| 16 | IN | `p_sProductionReportId` | `varchar(100)` |
| 17 | IN | `p_bRateTransformSet` | `int` |
| 18 | IN | `p_dPartsQty` | `double` |
| 19 | IN | `p_sControlParentId` | `varchar(100)` |
| 20 | IN | `p_sSelfControlId` | `varchar(100)` |
| 21 | IN | `p_sAllId` | `varchar(100)` |
| 22 | IN | `p_dSinglePQty` | `double` |
| 23 | IN | `p_sPartsName` | `varchar(100)` |
| 24 | IN | `p_dProcessOutQty` | `double` |
| 25 | IN | `p_iSlaveCount` | `int` |
| 26 | IN | `p_bSample` | `int` |
| 27 | IN | `p_dSumPQty` | `double` |
| 28 | IN | `p_iPage` | `int` |

## Body

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

## Narrative

**Business context:** 制造 → 工单 (`mftworkordermaster_Tmp` / `MftWorkOrderControl_Tmp` / `MftWorkOrderProcess_Tmp`) — per-process calculator in the standard-工单 recompute pipeline. Sits next to the `Sp_WorkOrder_CalcDataStd*` family and is named like a "center process" recompute (one工序 row at a time given a control id + process id), used when a single process row's loss/quantity needs re-solving without touching peer processes.

**What it does:** Takes 30+ in-params (sGuid, control / parts / process ids, rates, page/sample flags, qty inputs). On the temp tables loaded for the active session (`sParentId=sGuid AND sMakePerson=sLoginId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`), drives a long `top:` block that re-derives `dMaterialsQty`, `dProcessOutQty`, machine/stick math, capacity hours, and downstream process linkage rows; pure `UPDATE`s on `MftWorkOrderProcess_Tmp` / `MftWorkOrderControl_Tmp` / `MftWorkOrderMaterials_Tmp`. No outside-DB side effects.

**Invocation:** Status: appears orphaned. No caller found in any channel — neither `gdsconfigformmaster`, `gdsmodule.sProcName/sSaveProName*/sDeleteProName`, other DB routines (the live wiring orchestrator `Sp_WorkOrder_CalcDataStd` and its `Std`-suffixed peers do not reference this name), nor xly-src grep across all extensions. Candidate dead code / branched experiment — verify before relying on it.
