Sp_afterSave_sPmd.md 1.66 KB

Sp_afterSave_sPmd (procedure)

生产领料存后反写数量

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

Parameters

# Mode Name Type
1 IN sGuid varchar(2000)
2 IN sBrId varchar(100)
3 IN sSuId varchar(100)
4 OUT sCode int
5 OUT sReturn varchar(4000)

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpafterSave_sPmd'._

Narrative

Business context: 1/1 新增生产补料 / 生产领料单据 / 来料入库单据 → 物料领用流程 → KPI流程操作菜单 — header says 生产领料存后反写数量. Thin save-phase 反写 wrapper in the Sp_afterSave_s<Code> family that delegates the actual qty back-write to Sp_saveReturn_sPmd.

What it does: Wraps sGuid in double-quotes if not already quoted and, when sGuid is non-empty, calls Sp_saveReturn_sPmd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn) (iFlag=2 = "after save" phase). Does not propagate the inner @sCode/@sReturn back to its own OUT params.

Invocation: Reached on two paths. (1) Sp_Check_sPmd (the save-commit dispatch proc bound via gdsmodule.sSaveProName on 1/1 新增生产补料 + 生产领料单据 + 来料入库单据) calls this proc near the tail of a successful save. (2) Sp_Invalid_backwriting dispatches to this proc on 作废/取消作废 of forms 192116810113315226492535760 (生产领料), 192116810113315222184074940 (1/1 新增生产补料) and 101251240115015878867179910 (来料入库), itself triggered from Java CheckmodelServiceImpl via Sp_Invalidation.