# `Sp_BtnEvent_BillSlaveLastInstore` (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_BillSlaveLastInstore`'`._

## Narrative

**Business context:** 生产 / 返工单 — button-click handler that flags selected `mftproductionplanbillslave` (production-plan bill slave) rows as the "last batch" (最后一批) so subsequent in-storage tracking treats them as the terminal delivery for the rework / split-batch order.

**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and per id `UPDATE mftproductionplanbillslave SET iLastInStock=1, tLastInStockDate=NOW(), sLastInStockPerson=sMakePerson`. Returns `Operation successful` (default English-locale message — likely a copy-paste artifact).

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 返工单 grid's 最后一批 toolbar button names `Sp_BtnEvent_BillSlaveLastInstore` as the action. No static caller, no `gdsmodule` hook.
