# `Sp_ProductInspection_BtnRepair` (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_ProductInspection_BtnRepair`'`._

## Narrative

**Business context:** 品质管理 / 产品检验 — grid-row "mark as exception/repair" button handler on `qlyproducttestmaster`. The QC operator picks failing rows, optionally edits inline grid cells plus an exception-memo textarea, clicks Repair, and this proc batch-flags those test rows with `iTestResult=2` (exception) plus the memo, applying any inline edits in the same UPDATE.

**What it does:** Parses `$.params` (selected row sIds) and `$.changeValue` (textareaValue + per-column edits keyed by `valueKey`). Walks `valueKey` (comma-separated column list) to splice a dynamic `SET col1=$[0].col1, col2=$[0].col2, ...` clause, then appends `iTestResult=2, sExceptionMemo=<textareaValue>`. For each selected `sId`, runs `PREPARE` + `EXECUTE` on `Update qlyproducttestmaster Set ... Where sId=? AND sBrandsId=? AND sSubsidiaryId=?`.

**Invocation:** Standard `Sp_<Module>_BtnRepair*` slot — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 产品检验 grid's Repair button names this procedure. xly-src ships `script/标版/30100101/Sp_ProductInspection_BtnRepair.sql`. No form-master, gdsmodule hook, or other-proc reference — name lives on the button definition.
