# `Sp_SingleReceipt_BtnEventAbnormal` (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_SingleReceipt_BtnEventAbnormal`'`._

## Narrative

**Business context:** 移动端管理 → 现场 → 功能操作 → 送货回执 (`101251240115015892027636750`) — mobile-side button "异常回执" on the 送货回执 module. The driver / receiver marks one or more delivery lines as abnormal (e.g. damaged, short, mis-shipped) and types an explanation; this proc records the abnormal flag, the typed memo and any custom fields on the upstream 送货单从表 `saldelivergoodsslave`.

**What it does:** Parses the standard `$.params[*].value[*].sId` JSON and the bag `$.changeValue` carrying `textareaValue` (the memo) and `valueKey` (comma-separated list of extra fields the front-end is overwriting — `sSingleReceipt`, custom abnormal fields, etc.). For each sId, builds a dynamic UPDATE on `saldelivergoodsslave` setting the listed fields plus the memo column. Refuses with the localised `paramsErro` from `Sp_Sis_GetConst` when the JSON is too short or malformed.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 异常回执 button on the mobile 送货回执 grid names `Sp_SingleReceipt_BtnEventAbnormal` as the action. Sibling: `Sp_SingleReceipt_BtnEventFinished` (正常回执). xly-src ships `script/标版/30100101/Sp_SingleReceipt_BtnEventAbnormal.sql`.
