# `Sp_CTPPlanList_BtnEventFinished` (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_CTPPlanList_BtnEventFinished`'`._

## Narrative

**Business context:** 生产管理 → 出版/印版 → 待出版任务列表 (CTPPlanList) — button handler marking selected plan rows as "出版完成". Standard JSON-batch shape: the caller picks rows in the front-end CTP plan list and clicks the 出版完成 button; this proc stamps `bPublish=1` plus publish-person/publish-date on each `mftproductionplanslave` row.

**What it does:** Validates `sProInParam` (≥5 chars), parses `$.params[].value[].sId` from the JSON payload, then for each `sId` runs `UPDATE mftproductionplanslave SET tPublishDate=NOW(), sPublishPerson=sMakePerson, bPublish=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No KPI write, no flow, no back-write.

**Invocation:** `sp_btn_action*`-style — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 出版完成 button is wired to this proc by name. No `gdsconfigformmaster`/`gdsmodule` hook references; xly-src ships `script/标版/30100101/Sp_CTPPlanList_BtnEventFinished.sql` as the install body. The button binding lives in the form configuration (button column referencing this proc), not in the standard hook tables.
