# `Sp_CustomerComplaints_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_CustomerComplaints_BtnRepair`'`._ ## Narrative **Business context:** 销售管理 → 客户投诉 / 质量管理 → 内部质量投诉 — button-repair handler that flips a `mftqualityaccidentMaster` (质量事故/客户投诉) row to "修复" status. Sets `sType=3` (a status enum value meaning 已处理/修复) and records the operator's textarea comment into `sCheckMemo`, plus any extra change fields the front-end included. **What it does:** Validates `sProInParam`, parses `$.params[].value[].sId` plus the front-end `changeValue` envelope. Walks `changeValue[0].valueKey` (a comma-separated list of column names that were edited) and builds a dynamic SET clause `col1=val1, col2=val2`, then appends `sType=3, sCheckMemo=`. The whole UPDATE is `PREPARE`/`EXECUTE`-d against `mftqualityaccidentMaster` for the target id with tenant guards. The original `bCheck` early-out for `sCurrStatus='startWorking'` is commented out. **Invocation:** `Sp_BtnRepair_*` family — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 报修/修复 button on a 客户投诉 / 内部质量投诉 form fires. xly-src ships `script/标版/30100101/Sp_CustomerComplaints_BtnRepair.sql` as the install body. No `gdsmodule` hook nor `gdsconfigformmaster` data-source reference — binding is in the form's button configuration. Naming mismatch worth flagging: the proc name says CustomerComplaints but it writes to `mftqualityaccidentMaster`.