# `Sp_PlanListQualificat_BtnEventCheck` (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 | `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 PROCEDURE `Sp_PlanListQualificat_BtnEventCheck`'`._

## Narrative

**Business context:** 生产管理 → 计划、排程 → 计划列表 — qualification (合格证 / 合格审核) audit handler. Records that the 销售订单 (sales-order) backing this plan row has passed the 资质/合格 review. The "Qualificat" in the name is `Qualification` truncated; the audited field is `bCheckQualificat` on `salsalesordermaster`.

**What it does:** Parses `$.params[*].value[*].sId` (the front-end passes the `salsalesordermaster.sId` here). For each, `UPDATE salsalesordermaster SET bCheckQualificat=1, tCheckQualificatDate=now(), sCheckQualificatPerson=sMakePerson WHERE sId=p_sId`. The body also runs `SELECT sId INTO @p_sIdTmp FROM viw_salsalesdevplan WHERE sSlaveId=p_sId` but never uses `@p_sIdTmp` — vestigial, since the UPDATE keys directly off `p_sId`. Validates `sProInParam` length; emits `sCode=-1` + localised `paramsErro` from `Sp_Sis_GetConst` on bad input.

**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 合格审核 toolbar button on the 计划列表 grid names this proc. DB-only.
