# `Sp_BtnUpdate_RevSupply` (procedure)

> 供应商评审提交打分


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sUserId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_BtnUpdate_RevSupply`'`._

## Narrative

**Business context:** 供应商评审 / 供应商评审提交打分 — supplier-rating workflow: toggles the "score submitted" flag on a `revsupplymaster` (supplier evaluation header) once a reviewer has finalised their scorecard.

**What it does:** Parses `$.params[*].value[*].sId` and for each master row whose `bCheck=0` (note the WHERE column is `bCheck`, not the toggled `bSubCheck`), sets `bSubCheck` to its toggle (CASE 1↔0), stamps `tSubCheckDate=NOW()`, `sSubCheckPerson=sMakePerson`. Reads `$.changeValue.textareaValue` but does not persist it.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar "提交打分" button on the 供应商评审 grid. No callers in DB metadata or xly-src grep for this DB instance.

Flag: WHERE-clause column mismatch — guards on `bCheck=0` (final-check) but mutates `bSubCheck` (sub-check). Once the parent evaluation is checked, the score-submit toggle can no longer fire even if the score itself was never recorded. Likely a copy-paste bug from the OnPurOrder template.
