# `Sp_Manufacture_SetTime_Employ` (procedure)

> 计算时间,计算锁定数据时间


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

## Parameters

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

## Body

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

## Narrative

**Business context:** 生产管理 → 机台作业任务执行 — per-employee variant of the schedule recompute (header: "计算时间,计算锁定数据时间"). Walks the locked rows for one operator/machine, calls the per-process worker for each, and returns the running end-time so the outer scheduler can chain rows.

**What it does:** Truncates the helper staging `DELETE FROM p_mftproductionplanslave_Employ`, then for each row associated with `p_sMachineId` calls `Sp_Manufacture_SetTime_process` to recompute the one work-step, advancing `p_tEndDateOut` and `p_tPriorDateOut` along the way. INOUT `p_calPlanOrder` tracks the in-place sort cursor. Also `CALL Sp_Manufacture_SetTime_Employ` recursively for nested dependent rows.

**Invocation:** Called by `Sp_Manufacture_SetTime` (the main scheduler) — appears in its CALL graph. No direct gdsmodule hook, no form-master binding, no Java reference; install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTime_Employ.sql`. Internal helper inside the SetTime family.
