# `Sp_productionPlan_BtnEventLock24HourNotCalcTime` (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_productionPlan_BtnEventLock24HourNotCalcTime`'`._

## Narrative

**Business context:** 生产计划管理 → 生管主计划 / 生产排程 — 计划锁定：移动到计划确认表(时间占用不动). Variant of `Sp_productionPlan_BtnEventLock24Hour` that performs the same 24-hour lock-snapshot move but does **not** trigger a downstream time recalculation — the machine's `tStartDate` planning window is held as-is.

**What it does:** Same loop over `$.params[*].value[*]` JSON. For each `(sMachineId, tStartDate)` pair, resolves the current 班次 via `FUN_GET_DATE_BC` on `elemachine.sWorkType/sShiftsWork/sOffWork`, copies the matching `mftproductionplanslave` rows into `mftproductionplanslavelock` (skipping ones already locked for that 班次), then `UPDATE mftproductionplanslave` to set `bLock=1, sLock, tLock=NOW()`. Logs to `syslog` with `sOperationType='锁定24H机台任务'`. Does not call any subsequent `Sp_Manufacture_SetTime` step.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 锁定24H(时间不动) toolbar button on the 生产排程 grids. xly-src `script/标版/30100101/Sp_productionPlan_BtnEventLock24HourNotCalcTime.sql` ships the install copy.
