# `Sp_MaterialCheck_BtnEventMaterialCheckPass` (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_MaterialCheck_BtnEventMaterialCheckPass`'`._

## Narrative

**Business context:** 生产管理 — 主辅料稽查：稽查通过 (mark material-check pass). Per-row positive-disposition button: after `Sp_MaterialCheck_BtnEventMaterialCheck` has computed which work-order materials match stock, the user clicks 稽查通过 on a row to record that material as confirmed-available.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each `sId` runs `UPDATE mftworkordermaterials SET bPlanMaterialCheck=1, bPlanMaterialCheckResult=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Empty payload returns the localised `paramsErro` message from `Sp_Sis_GetConst` and `sCode=-1`.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 稽查通过 toolbar/row-action button on the 主辅料稽查 form names `Sp_MaterialCheck_BtnEventMaterialCheckPass` (`Sp_<Module>_BtnEvent*` pattern). Companion to `Sp_MaterialCheck_BtnEventMaterialCheckFail` and the parent enumerator `Sp_MaterialCheck_BtnEventMaterialCheck`. Install script ships at `script/标版/30100101/schedule/Sp_MaterialCheck_BtnEventMaterialCheckPass.sql`.
