# `Sp_OutsideInspection_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_OutsideInspection_BtnRepair`'`._

## Narrative

**Business context:** 质量管理 / 外协检验 — `Sp_BtnRepair_*` family handler that marks selected 外协检验 lines as 返修 (rework / `iTestResult=2`) and writes the operator's exception memo back, optionally applying any other column edits captured in the dialog's `valueKey` list.

**What it does:** Validates `sProInParam` length (`paramsErro` from `Sp_Sis_GetConst` on failure). Parses `$.params[*].value[*].sId` and `$.changeValue` JSON. From `$.changeValue.valueKey` (a comma list of column names) builds a dynamic `SET col=$.changeValue[0].col, ...` fragment by walking the list. For each selected `sId` runs an UPDATE that always sets `iTestResult=2, sExceptionMemo=<textareaValue>` and adds the dynamic SET fragment when present.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). Naming and JSON-shape match the generic `Sp_BtnRepair_*` contract dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` for a 返修 toolbar button on a 外协检验 grid — likely either renamed (current outside-process inspection flows use `Sp_OutSideInspection_*`) or wired through a customer override; verify before relying on it.
