# `Sp_BtnEvent_ProductItestType` (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 | `sUserId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_BtnEvent_ProductItestType`'`._

## Narrative

**Business context:** 产品 / 免检设置 — toolbar handler that flags a set of `eleproduct` rows (产品 master) as exemption-from-inspection (`iTestType=3`). The flag suppresses downstream QC/品检 requirements for that 产品.

**What it does:** Parses `$.params[*].value[*].sProductId` from `sProInParam`. For each id, sets `eleproduct.iTestType=3`. If `sProInParam` is shorter than 5 chars, returns `sCode=-1` with the localised `paramsErro` message from `Sp_Sis_GetConst`. Unlike its sibling for 工序, it does not stamp the operator name.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 产品 grid's 设置免检 toolbar button names this proc as its action. Companion: `Sp_BtnEvent_ProcessItestType` for 工序.
