# `Sp_System_ReplyCheckMsg` (procedure) - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sMsgGuid` | `varchar(100)` | | 2 | IN | `sBillGuid` | `varchar(100)` | | 3 | IN | `iReply` | `int` | | 4 | IN | `sReply` | `varchar(500)` | | 5 | OUT | `sReturn` | `varchar(100)` | | 6 | IN | `sLoginId` | `varchar(100)` | | 7 | IN | `sBrId` | `varchar(100)` | | 8 | IN | `sSuId` | `varchar(100)` | | 9 | OUT | `sCode` | `int` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_System_ReplyCheckMsg`'`._ ## Narrative **Business context:** 系统 → 审核流 (approval workflow) — handler for an approver replying to a 审核留言 (review-message) on any 业务单据 sent through the workflow engine. Writes the approver's decision (同意/不批准) into `sysbillcheckresult`, marks the inbox message read in `sysmsguser`, and advances the workflow stage when the current phase has gathered enough approvers. **What it does:** Resolves the logged-in user via `Fun_GetLoginUser`, flags `sysmsguser.bIsView=1` for this message. Reads `sysmsg` for `sMakePerson`/`sCheckModelId`/title/content; if the message no longer exists returns "单据送审流程已结束,无需操作,请忽略". Locates the current `sCheckPhaseId` in `sysbillcheckresult` ordered by `elecheckmodelphase.iOrder`. Branches on `iReply`: when `0` (不批准) it writes `sResult=0, sReplyContent=sReply`, sets all related `sysmsguser.bReply=1`, and stops the flow; when `1` (同意当前阶段) or `2` (同意通过) it tallies how many approvers have signed against the phase's `dNeedPeople` quorum and, if quorum is met, either advances to the next `sysbillcheckphase` (creating new `sysmsg`+`sysmsguser` rows for the next-phase reviewers) or finalises the bill (updates the source `sBillTableName` `bCheck=1, sCheckPerson, tCheckDate`). All updates wrapped in defensive `IFNULL` and constant-lookup error messages via `Sp_Sis_GetConst`. **Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match, no xly-src Java caller, no xly-src match beyond `script/标版/30100101/Sp_System_ReplyCheckMsg.sql` install script. Given the parameter shape (`sMsgGuid`, `sBillGuid`, `iReply`, `sReply`, `sLoginId`) it's clearly the back-end of the 待办审核 reply action — but the dispatch may be hidden behind a non-grep-able indirection (e.g. a `sName`-keyed lookup table). Candidate for maintainer audit of the message-centre service.