# `Sp_mftworkorder_BtnServiceconfirm` (procedure)

> @author:zhucx 
		     @date: 
				 @describe:


- **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_mftworkorder_BtnServiceconfirm`'`._

## Narrative

**Business context:** 生产管理 → 生产工单 — toolbar 业务确认 (sales/service-confirm) action on a work-order line. The 业务 (sales-side) operator confirms the line is ready for the customer-confirmation step. First leg of the two-phase 业务→客户 confirmation: this proc precedes `Sp_mftworkorder_Btncustomerconfirm`.

**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each line id, `UPDATE mftworkorderslave SET bServiceStatus = 1, tServiceStatus = SYSDATE(), sServiceStatus = sMakePerson WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. Single-flag latch, no master-side write — the master flag flips on the downstream 客户确认 click.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 业务确认 button on the 生产工单 line grid names `Sp_mftworkorder_BtnServiceconfirm` as the action. Reset path is the combined `Sp_mftworkorder_BtnReturncustomerconfirm` which also clears `bServiceStatus`.
