Sp_Sis_GetConst.md 1.71 KB

Sp_Sis_GetConst (procedure)

获取常量存储过程

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

Parameters

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

Body

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

Narrative

Business context: 系统工具 — i18n constant lookup. Resolves a logical message key (sStr) to the localised string the caller should surface to the user. Procedure twin of the function Fun_Sis_GetConst; widely used by audit/check/btn-event procs to emit translated error / status messages ("请选择数据", "Working", "paramsErro", …).

What it does: Reads SysSystemSettings.CbxLanguage (defaulting to sChinese) for the tenant, builds a dynamic SELECT <lang_column> INTO @sReturnValue FROM gdsformconst WHERE 1=1 [AND sParentId='sGuid'] [AND sName='sStr'] LIMIT 1, executes via PREPARE/EXECUTE, then returns @sReturnValue in sReturn. Falls back to the raw sStr if no row matches. sGuid scopes the lookup to a particular constant namespace; passing '' is normalised to '100'.

Invocation: Called via CALL Sp_Sis_GetConst(...) from 488 other DB routines (sample: Sp_AfterPost_sQtt, Sp_Bill_Used, Sp_BtnEventCalculatewages, Sp_BtnEventDepartSure_New, every Sp_Supply_* btn-handler, Sp_Sis_CopeEventList, etc.). Not directly invoked from xly-src Java — the Java layer uses the function Fun_Sis_GetConst for the same purpose. Status: live core utility.