# `Sp_Manufacture_SetTime_BB` (procedure)

> @author:钱豹
							@date:20210530 封存
							@describe: 按当前机台的排单次序,重算开始时间，耗时，结束时间，考虑因素有 单双休，工作时间
							条件为： 已排程 或 已下达 的未撤单记录


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

## Narrative

**Business context:** 生产管理 → 机台作业任务执行 — third variant in the `Sp_Manufacture_SetTime*` family (the "_BB" suffix is the author's working copy). Same intent as `Sp_Manufacture_SetTime` — per-machine 排单次序 schedule recompute — but populates an additional staging table `MftProductionPlanSlave_Tmp_div` while running, suggesting it was a step toward the splitting/sub-row logic that `Sp_Manufacture_SetTimeDivRow` later isolated.

**What it does:** Same JSON-param contract. Loops the machine's 排程/已下达 (未撤单) rows in `mftproductionplanslave`, calls `Sp_System_ReplaceField` for dynamic column updates, `INSERT INTO MftProductionPlanSlave_Tmp_div` for the per-row decomposition, then `UPDATE mftproductionplanslave`, `UPDATE mftworkordermaterials`, and `update elemachine` to commit machine state.

**Invocation:** No caller found in any channel — no gdsmodule binding, no form-master ref, no other proc CALLing it, no xly-src reference. Author 钱豹, marked 封存. Status: appears orphaned — an in-progress branch of the SetTime family superseded by the production `Sp_Manufacture_SetTime` and the row-split `Sp_Manufacture_SetTimeDivRow`. Candidate for maintainer audit.
