# `Sp_Manufacture_SetTime_process` (procedure)

> 单条工序的计算


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sPlanslaveId` | `varchar(50)` |
| 2 | IN | `p_tCStartTime` | `datetime` |
| 3 | IN | `p_sMachineId` | `varchar(50)` |
| 4 | IN | `sMakePerson` | `varchar(100)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | OUT | `sReturn` | `varchar(1000)` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `p_tEndtDate` | `datetime` |
| 10 | IN | `p_tPriorDateIN` | `datetime` |
| 11 | OUT | `p_tPriorDateOut` | `datetime` |
| 12 | INOUT | `p_calPlanOrder` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Manufacture_SetTime_process`'`._

## Narrative

**Business context:** 生产管理 → 机台作业任务执行 — single-process worker (header: "单条工序的计算") inside the SetTime family. Recomputes one work-step row of `mftproductionplanslave` for a given `p_sPlanslaveId / p_tCStartTime / p_sMachineId`: applies the shift/work-time/off-day calendar via `Sp_Manufacture_SetTime_tDate`, returns the new `p_tEndtDate` and the advanced cursor `p_tPriorDateOut / p_calPlanOrder` so the caller can chain to the next row.

**What it does:** Calls `Sp_System_ReplaceField` to splice templatable column assignments, then `UPDATE mftproductionplanslave` with the recomputed `tCStartTime / dHour / tCEndTime` for the single row. Honours the upstream `p_tPriorDateIN` so dependent rows don't start before their predecessor finished. INOUT `p_calPlanOrder` is incremented per processed step.

**Invocation:** Called by `Sp_Manufacture_SetTime_Employ` (per-employee recompute) and by `Sp_Manufacture_SetTime` (the main per-machine scheduler) — internal helper for the SetTime family. No gdsmodule hook, no form-master binding, no Java reference. Install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTime_process.sql`.
