# `Sp_MobileStart_BtnEventFinished` (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_MobileStart_BtnEventFinished`'`._ ## Narrative **Business context:** 生产管理 → 生产计划 → 开工 (mobile) — machine-side "开工" (start-work) action on the mobile app. The operator at a machine starts the job by tapping a plan-slave row. The proc enforces single-job-per-machine: a machine can only have one started-but-not-reported job at a time. **What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each plan-slave id, reads `sMachineId` from `mftproductionplanslave`; counts other rows on that machine where `bStartComplete=1 AND bProductionReportComplete=0 AND dProductionReportQty<=0`. If any exist, returns the localised `sMobileStartWorkStart` ("已开工,请勿重复开工") via `Fun_Sis_GetConst` — without aborting (it just sets `sReturn`, the loop still iterates). Otherwise `UPDATE mftproductionplanslave SET bStartComplete = 1, tStartDate = NOW() WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. **Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 开工 button on the mobile app's machine task list names `Sp_MobileStart_BtnEventFinished` as the action. xly-src ships `script/标版/30100101/Sp_MobileStart_BtnEventFinished.sql` (install script). Successor: `Sp_MobileAdjust_BtnEventFinished` (调机完成), which uses the `tStartDate` written here to compute setup duration.