# `Sp_WorkProcess_BtnEventOutSide` (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_WorkProcess_BtnEventOutSide`'`._

## Narrative

**Business context:** 制造 → 工序 — toolbar handler that flips a 工单 工序 (`mftworkorderprocess`) row to "发外加工" (outside processing). Caption-wise the `COMMENT` reads 研发任务认领 (probably stale from a forked template) but the body is a 发外加工 mark: it sets `bOutSide=1` and stamps the outside qty/date/person.

**What it does:** Validates `sProInParam` (JSON), unpacks `$.params[0].value[*].sSlaveId` (multi-row pattern) and walks them in a WHILE loop. For each `sSlaveId`, runs `UPDATE mftworkorderprocess SET bOutSide=1, dOutsideQty=dProcessQty, tOutSideDate=NOW(), sOutSidePerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. On empty `sProInParam` it pulls the `paramsErro` constant via `Sp_Sis_GetConst` and returns `sCode=-1`. Reads `$.changeValue.textareaValue` but does not write it (leftover from template).

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — fired by the 发外加工 toolbar button on a 工单工序 grid. Not bound on `gdsmodule` or `gdsconfigformmaster` (the standard `Sp_BtnEvent_*`/`sp_btn_action*` channel). No other DB-routine callers, no xly-src references — discoverable only via the generic-dispatch contract.
