# `Sp_productionPlan_BtnEventCnl` (procedure)

> 先锁定，再计算settime


- **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_BtnEventCnl`'`._

## Narrative

**Business context:** 生产计划管理 → 生管主计划 / 生产排程 — composite "cancel-and-recompute settime" handler for a single machine's locked plan rows in `mftproductionplanslave`. Wraps the unlock-then-recalc-time path used when the planner reverses a 24-hour lock and needs the machine timeline rebuilt.

**What it does:** Calls `Sp_productionPlan_BtnEventLockSd_cnl` first to clear the lock on the JSON-supplied `sRowData` row set (sets `bLock`, `sLock`, `tLock` back). If that returns `sCode < 0`, leaves immediately. Otherwise builds a `JSON_OBJECT` payload with the resolved `sMachineId` and `CALL Sp_Manufacture_SetTime(...)` to recompute the start/end times on the remaining schedule.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — wired to the 取消 / cancel-lock action on the 排程信息表 / 排程从表 grid under 生产排程. Not present in xly-src 30100101 install scripts — DB-only.
