# `Sp_MacRepClaim_BtnEventGroupLaderZP` (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_MacRepClaim_BtnEventGroupLaderZP`'`._

## Narrative

**Business context:** 销售管理 — 指派设计单 button on a 销售订单从表 grid view. A dispatcher assigns a 组长 (`sGroupLeader`) to selected order-slave lines; despite the `Sp_MacRepClaim_*` prefix the proc writes to `salsalesorderslave`, not the repair table — likely co-located with the dispatcher-style ZP family on a custom 设计任务认领 / 组长指派 toolbar.

**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue.sGroupLeader` + `$.changeValue.textareaValue` from `sProInParam`. For each sSlaveId, when `sGroupLeader` is non-blank, `UPDATE salsalesorderslave` sets `bClaim=1`, `sGroupLeader=<picked>`, `tClaimDate=NOW()` for matching rows under `sBrandsId/sSubsidiaryId`.

**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 销售订单 从表 (or a 设计任务派工) grid's 指派组长 toolbar button names this proc by string. Companion ZP-family procs: `Sp_MacRepClaim_BtnEventClaimZP` (EptMachineRepairFixMaster), `Sp_MacRepClaim_BtnEventMaterialsZP` (mftworkordermaterials).
