# `Sp_productionPlan_BtnRepairdAjusthour` (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_BtnRepairdAjusthour`'`._

## Narrative

**Business context:** 生产计划管理 → 生管主计划 / 生产排程 — 机台计划：同部件工序调整时间修改 (per the COMMENT). Repair-style mass update: writes a planner-entered "adjust hour" (`dAdjustHour`) onto every `mftproductionplanslave` row that shares a machine and `sWorkOrderControlId` (the parts-control linkage), so the same component's process line picks up the new manual time offset uniformly.

**What it does:** Walks `$.params[*].value[*]` looking for `sMachineId` and `sWorkOrderControlId`. Reads `$.changeValue.dAdjustHour` from the same payload. Rejects with `chooseData` / `sProductionPlanChooseAdjustTime` constants on missing inputs. Then `UPDATE mftproductionplanslave SET dAdjustHour = p_dAdjustHour WHERE sMachineId = p_sMachineId AND sWorkOrderControlId = p_sWorkOrderControlId` — propagating the adjustment to every shift/row on that machine sharing the part-control id.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — `Sp_BtnRepair_*` family routes through the same `doGenericProcedureCall` path as `Sp_BtnEvent_*`, here from the "调整时间" 修复 toolbar button on 生产排程 grids. xly-src `script/标版/30100101/schedule/Sp_productionPlan_BtnRepairdAjusthour.sql` ships the install copy.
