# `Sp_productionPlanInfo_BtnEventRelease` (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_productionPlanInfo_BtnEventRelease`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — toolbar handler "机台计划：下达" (release machine-plan to the shop floor) on `mftproductionplanslave`. Promotes a scheduled row from "已排程/暂停" (`sState` 1 or 3) to "已下达" (`sState=2`), at which point the operator can start work.

**What it does:** Picks `slave`/`slaveInfo` JSON value list, then for every dash-split `sId`: reads `bFrozen`, `sState`, `bLock`, `dHour`. Rejects frozen rows with `sColdOrderWaitOperation`, locked rows with `sLockOrderWaitOperation`. If `sState` is neither 1 nor 3, rejects with `sIssueOnlyPcOrPause`. Otherwise `UPDATE mftproductionplanslave SET sState='2', iAutoOrder=0 WHERE sId=p_sIdOne AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No syslog row.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 生产排程 form's "下达" button. xly-src ships `script/标版/30100101/schedule/Sp_productionPlanInfo_BtnEventRelease.sql`.
