# `Sp_eleteststandardFeed_BeforeUpdate` (procedure)

> 进料检验规则单据校验


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `sData` | `longtext` |
| 3 | IN | `sAllData` | `longtext` |
| 4 | IN | `sFormGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `sReturn` | `varchar(4000)` |

## Body

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

## Narrative

**Business context:** 进料检验规则单据校验 — pre-save uniqueness guard for the 进料检验规则 (incoming-material inspection rule) document. Each 物料分类 (`eleteststandardobject.sTestObjectId`) may appear on at most one rule with `eleteststandard.sFormId='12012615914116374916774630'`; this proc blocks a save that would create a second rule covering the same classification.

**What it does:** Walks `sAllData` for the `eleteststandardobject` slave block. For each `handleType='add'` row with a non-empty `sParentId`, counts other `eleteststandard` rows on the 进料 form (`sFormId='12012615914116374916774630'`) sharing the same `sTestObjectId` but a different parent. On any hit, builds `sReturn='物料分类已在以下进料检验规则单据中存在:<sTestName list>'`, sets `sCode=-1`, and aborts. Otherwise `sCode=1`.

**Invocation:** Status: appears orphaned. Not bound to any `gdsmodule.sSaveProNameBefore`/`sSaveProName`, no form-master reference, no other routine references it, no xly-src reference. The naming and `sFormId` literal match the 进料检验规则 form (form sId `12012615914116374916774630`) — likely intended as that form's pre-save validator slot and never wired. Candidate for maintainer audit. (Sibling procs `Sp_eleteststandardFirst_BeforeUpdate`, `Sp_eleteststandardPatrol_BeforeUpdate`, `Sp_eleteststandardProduct_BeforeUpdate` share identical body shape for the 首检/巡检/成品 variants.)
