# `Sp_SaleOrderlist_BtnEventCraftworkDo` (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_SaleOrderlist_BtnEventCraftworkDo`'`._

## Narrative

**Business context:** 销售 / 工艺 — 订单交接表 page's 拒绝接收 button handler. When the craftworks (工艺) reviewer cannot accept an order line for technical reasons (typically incomplete 齐套), this records the rejection plus a free-text memo back onto the order slave so sales/PMC can react.

**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` and `$.changeValue[*].textareaValue` (the operator's reason). For each slave id, `UPDATE salsalesorderslave SET iReplyCount = ifnull(iReplyCount,0)+1, iReplyResult = 1, tCraftworksReply = NOW(), sCraftworksMemo = <memo|'齐套不全'>` scoped to `sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Aborts with `Sp_Sis_GetConst('paramsErro')` when the JSON payload is too short.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 订单交接表 grid's 拒绝接收 toolbar button names this proc as the action. Companion procs: `Sp_SaleOrderlist_BtnEventCraftworkOk` (accept) and `Sp_SaleOrderlist_BtnEventSaleDepartDo` (业务部 reply). Install script: `script/标版/30100101/Sp_SaleOrderlist_BtnEventCraftworkDo.sql`.
