# `Sp_productionPlan_BtnEventLockSd_cnl` (procedure)

> 生产计划跟进-锁定或修改所选生产计划


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `longtext` |
| 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_productionPlan_BtnEventLockSd_cnl`'`._

## Narrative

**Business context:** 生产计划管理 → 生管主计划 / 生产排程 — cancel-lock companion to `Sp_productionPlan_BtnEventLockSd`. Reverts a row-level lock applied via the 锁定 toolbar action on `mftproductionplanslave` schedule rows. Same proc name suffix as the `*_cnl` family across the BtnEvent set.

**What it does:** Validates `sMachineId` and the `sRowData` JSON array. Loads selected `sId`s into a `p_Lock` temp table, then `UPDATE mftproductionplanslave INNER JOIN p_Lock` to write `tLock=NOW(), sLock=sMakePerson, bLock=1`. The bulk of the proc body matches `Sp_productionPlan_BtnEventLockSd` (lines for re-numbering `iOrder` are commented out in this variant) — it leaves the surrounding iOrder timeline untouched.

**Invocation:** Called directly from `Sp_productionPlan_BtnEventCnl` before `Sp_Manufacture_SetTime`. No standalone xly-src caller — operates as a sub-step of the composite cancel-and-recompute path. Not dispatched on its own from the UI.
