Sp_Check_eleteststandardPatrol.md 1.6 KB

Sp_Check_eleteststandardPatrol (procedure)

生产巡检规则保存之前数据校验

  • Type: PROCEDURE
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

# Mode Name Type
1 IN sTableName varchar(100)
2 IN sGuid varchar(100)
3 IN sFormGuid varchar(100)
4 IN sLoginId varchar(100)
5 IN sBrId varchar(100)
6 IN sSuId varchar(100)
7 IN iFlag int
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 PROCEDURESpCheck_eleteststandardPatrol'._

Narrative

Business context: 生产巡检规则单据 → 质检规则设定 → 质量管理 — before saving a production patrol-inspection (巡检) rule, prevent the same process from being registered in more than one active rule so the patrol engine picks an unambiguous standard.

What it does: Cursors eleteststandardobject rows under sGuid (the rule being saved), and for each sTestObjectId (process), counts other eleteststandard rows in form 12012615914116374914703890 (生产巡检规则单据) carrying the same object. If any exist, sets sReturn to the localised sStandardHaveProcess message plus the conflicting rule names and returns sCode = -1. Also rejects duplicate processes within sGuid itself.

Invocation: Save-time check on form 生产巡检规则单据 — invoked via the Sp_Check_* dispatcher from the Sp_Calc_* save procedure for that form's sCode.