# `Sp_BtnEvent_UpdateOutProcessLogistics` (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 | `sUserId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_BtnEvent_UpdateOutProcessLogistics`'`._

## Narrative

**Business context:** 工序发外 — toolbar handler for setting the in/out logistics method on 工序发外明细 (`opsoutsideprocessslave`). Lets the dispatcher batch-assign which carrier/transport mode covers send-out and return shipments for a set of outsource lines.

**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. Reads `iInLogistics` and `iOutLogistics` codes from `$.changeValue` (the toolbar prompt's input). For each slave id, sets `opsoutsideprocessslave.iInLogistics=p_iInLogistics, iOutLogistics=p_iOutLogistics`. Returns `sCode=-1, paramsErro` on missing input.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工序发外 detail grid's 设置物流 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_UpdateOpsAgainCar` for the re-dispatch flow on the same slave table.
