# `Sp_Manufacture_MftPlanPhase_productBtnEventCalc` (procedure)

> @author:  zhucx			    
								@date:20220321  封存
				
								@describe :     
								生产Plan跟进(成品)                                		
								1.根据跟进阶段 印刷之后的阶段，创建表CalcProductsPhase，以备快速查询


- **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_MftPlanPhase_productBtnEventCalc`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进表(成品) — `BtnEvent` recalc handler for the finished-product phase-progress report. Header comments describe building a `CalcProductsPhase` snapshot for "印刷之后的阶段" (post-press phases) so the report side can return quickly. Header `@date:20220321 封存` flags it as frozen — sits beside `Sp_Manufacture_MftPlanPhase_product` (the read proc).

**What it does:** Standard generic-button signature (`sProInParam`, `sMakePerson`, `sBrId`, `sSuId`, `sReturn`, `sCode`). Rebuilds the same `p_TempTable` / `p_MftWorkOrderProcess` / `p_MftWorkOrder_Materials` rollup from `mftworkorderprocess`, `mftworkorderslave`, `mftworkordermaterials`, `mftproductionplan`, `mftproductionreportslave`, `mftworkordercontrolcombine`, `sgdsemigoodsmatchbillslave/process`, `eleprocessphase` and persists the per-phase totals so subsequent report queries can skip the recompute.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 重算 toolbar button on the 生产计划跟进表(成品) form (`Sp_BtnEvent_*` family signature). No `gdsmodule` hook and no form-master sSqlStr — referenced only by its own install script `xly-src/script/标版/30100101/schedule/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.sql`. Frozen — verify the form's recalc button still targets this name before relying on it.
