# `Sp_BtnEvent_PurInstorePrintName` (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_PurInstorePrintName`'`._

## Narrative

**Business context:** 采购入库 — button-click handler that records the user who printed a 采购入库单 (`purpurchaseinstoremaster`) by writing their name into `sPrintName`. Used for print-audit trail on the goods-receipt label.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each unique master id (deduplicated via `p_sAllId`), sets `purpurchaseinstoremaster.sPrintName=sMakePerson`. Returns `sCode=-1, paramsErro` if `sProInParam` is shorter than 5 chars.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 采购入库 grid's 标记打印人 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_PurInstoreComfirm` for logistics confirmation on the same table.
