sp_OEE_loading.md 1.75 KB

sp_OEE_loading (procedure)

@author:钱豹 @date:20210908 封存 @describe: OEE登录成功时: 1、更新班组上岗标记 2、更新本机台 当前班组号

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

Parameters

# Mode Name Type
1 IN sMachineId varchar(100)
2 IN sTeamId 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 PROCEDUREspOEE_loading'._

Narrative

Business context: OEE管理 — "上岗/登录" (sign-on) hook fired when a 班组 (shift team) logs into an OEE machine workstation. Stamps the team-number onto the machine's PLC value slot so downstream PLC reads can attribute production to the right team, and flips the team's bWorking flag on.

What it does: SELECT sTeamNo INTO p_sTeamNo FROM eleteam WHERE sId = sTeamId …, then UPDATE plc_currentmachinevalue SET sPlcsStatusValue = p_sTeamNo WHERE sParentId = sMachineId AND iOrder = '1' (slot 1 = current team on this machine), and UPDATE eleteam SET bWorking = 1 WHERE sId = sTeamId …. Header comment @author:钱豹 @date:20210908 封存 marks it as archived/legacy.

Invocation: Called by PlcXmzServiceImpl.callSp_OEE_loading(sMachineId, sTeamId, sBrId, sSuId) (and the PlcXmz2022ServiceImpl / PlcXmzServiceImplOld twins) — the Java wrapper builds the same {CALL sp_OEE_loading(...)} template inline (it does not share the generic doOeePro helper used by start/end-of-work). Reached from the PLC dispatch path on team sign-on.