# `Sp_productionMainPlan_Process_BtnEventCompletionRelease` (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_productionMainPlan_Process_BtnEventCompletionRelease`'`._

## Narrative

**Business context:** 生产管理 / 主计划 / 工序 → 取消单个工序加工完成 — process-level grid button. Inverse of `Process_BtnEventCompletion`: reopens a工序 that was wrongly marked complete, returning the slave row to in-progress so the scheduler resumes dispatching it. Refuses on frozen rows.

**What it does:** Parses `$.params[0].value[*].sId` as `sWorkOrderProcessTbId` keys. For each: reads `bFrozen` from `mftproductionplanslave`; aborts with `sCode=-1` "已经冻结..." if frozen. Otherwise reads work-order/parts/process descriptors and production-reported quantities, then updates `mftproductionplanslave` to clear the process-complete flag and revert the state value. Empty-selection guard returns "请选择数据".

**Invocation:** Standard `Sp_<Module>_BtnEvent*` slot — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 主计划-工序 grid's 取消工序完成 button names this procedure. Inverse: `Sp_productionMainPlan_Process_BtnEventCompletion`.
