# `Sp_PlanListMasterials_BtnEventUnCheck` (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_PlanListMasterials_BtnEventUnCheck`'`._

## Narrative

**Business context:** 生产管理 → 计划、排程 → 计划列表 — materials-side (材料) un-audit, the reverse of `Sp_PlanListMasterials_BtnEventCheck`. Lets the operator pull back the materials confirmation on the upstream 销售开发计划 row when the materials picture changes after the first audit.

**What it does:** Parses `$.params[*].value[*].sId` (plan slave ids). For each, resolves the dev-plan master via `SELECT sId INTO @p_sIdTmp FROM viw_salsalesdevplan WHERE sSlaveId=p_sId AND bCheck=0`. If no row matches (because 品质部 has already audited and the primary `bCheck` is now 1), aborts with `sCode=-1, sReturn='品质部已审核，请先通知消审'` (forces the user to unwind the quality audit first). Otherwise `UPDATE salsalesdevplanmaster SET bCheck1=0, tCheckDate1=null, sCheckPerson1=null WHERE sId=@p_sIdTmp`.

**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 撤销材料审核 (反核) toolbar button on the 计划列表 grid names this proc. DB-only.
