# `Sp_PlanListCTP_BtnEventFinished_Control` (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_PlanListCTP_BtnEventFinished_Control`'`._

## Narrative

**Business context:** 生产管理 → 计划、排程 → 计划列表 — variant of `Sp_PlanListCTP_BtnEventFinished` that confirms 出版/CTP completion at the **workorder** (mftworkorderslave) layer instead of the plan layer. Body comment 出版完成,后改为按照工单拼版 indicates this version implements the "per-workorder makeup" model after the policy switch. Used when the shop arranges CTP plates per workorder rather than per plan row.

**What it does:** Requires the user to enter `iPublishQty` (number of plates) and `textareaValue` (the 出版文件编号 list). For each plan row in `$.params[*].value[*]`, dereferences `sSlaveId` (the workorder-slave id) and `UPDATE mftworkorderslave SET bPublish=1, tPublishDate=NOW(), sPublishPerson=sMakePerson, iPublishQty=p_iPublishQty WHERE sId=p_sId AND sBrandsId/sSubsidiaryId match`. Aborts with `sCode=-1` and the localised `sEnterPublishNo` ("请输入出版文件编号") message if the file-no is empty.

**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 出版完工(按工单) toolbar button on the 计划列表 grid names this proc. Selected at deploy time by `gdsmodule`/前端配置 instead of the per-plan-row variant. DB-only; not in xly-src `30100101`.
