# `Sp_MftPlanPhaseProduct_BtnEventConvertPlanB` (procedure)

> 常用生产计划跟进(部件)-转入备用计划


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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进 → 备用计划 — toolbar action that pushes a selected work-order line out of the regular 跟进 plan and into the 备用 (alternate / standby) pool. Used when a planner wants to deprioritise a line without invalidating it. Inverse of `Sp_MftPlanPhaseProduct_BtnEventConvertPlanA`.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each id, `UPDATE mftworkorderslave SET bPlanB = 1 WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId` and `UPDATE CalcProductsPhase SET bPlanB = 1 WHERE sId = p_sId`. Setting `bPlanB = 1` reclassifies the row from 常规 to 备用 — it disappears from the active 跟进 view and surfaces in 备用生产计划跟进.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 转入备用计划 button on the 常用生产计划跟进 grid names `Sp_MftPlanPhaseProduct_BtnEventConvertPlanB` as the action. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.sql` (install script).
