# `Sp_BtnEvent_LogAheadComfirm` (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_BtnEvent_LogAheadComfirm`'`._

## Narrative

**Business context:** 物流 / 物流单 — button-click handler that toggles 预审核 (pre-confirm / ahead-complete) flag on selected `logisticsordermaster` rows. The "Comfirm" misspelling is consistent across the family. Used by warehouse-dispatch to mark a logistics note as preliminarily ready before final confirmation.

**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, deduplicates via a `p_sAllId` running list (`LOCATE` guard), and per unique id `UPDATE logisticsordermaster SET bAheadComplete = (CASE WHEN bAheadComplete=1 THEN 0 ELSE 1 END), tAheadDate=NOW(), sAheadPerson=sMakePerson` — toggles, not sets.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 物流单 grid's 预审核 toolbar button names `Sp_BtnEvent_LogAheadComfirm` as the action. Companion of `Sp_BtnEvent_LogisticsComfirm` (final confirm).
