# `Sp_Check_SaveOeeReportCheck` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** 生产管理 → OEE 产量上报审核 — audit-time OEE back-fill counterpart to `Sp_Check_SaveOeeReport`. Re-derives the same OEE-input columns on `mftproductionreportslave` but scoped to one document (`sId=sGuid`) and tenant pair, so the values are fresh at 审核 time.

**What it does:** Cursors `viw_mftproductionreport` filtered by `sId=sGuid, sBrandsId=sBrId, sSubsidiaryId=sSuId`, then per slave pulls `plc_machinedata` between the previous report's `tCreateDate` and now, computes `dAdjustableQty/dAdjustableHour/dHour/tStartDate/tEndDate/dOtherHour/dAllHour/dEmpHour`, and writes them back to `mftproductionreportslave`. Also propagates the standard `dStdHour/dStdAdjustHour` from `mftproductionplanslave`.

**Invocation:** Called from `Sp_Calc_sPpr` (产量上报 audit/un-audit handler) during the audit branch — see [`Sp_Calc_sPpr`](Sp_Calc_sPpr.md). Not bound as a gdsmodule hook directly.
