# `Sp_Calc_sMpt` (procedure) > 产品工艺卡 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `iFlag` | `int` | | 2 | IN | `iTmpCheck` | `int` | | 3 | IN | `sFormGuid` | `varchar(100)` | | 4 | IN | `sGuid` | `varchar(100)` | | 5 | IN | `sLoginId` | `varchar(100)` | | 6 | OUT | `sReturn` | `varchar(4000)` | | 7 | IN | `sBrId` | `varchar(100)` | | 8 | IN | `sSuId` | `varchar(100)` | | 9 | OUT | `sCode` | `int` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Calc_sMpt`'`._ ## Narrative **Business context:** Multi-form product process-card (产品工艺卡) audit / un-audit on `MftProductMaster`/`mftproductslave`. Used by nearly every product-recipe variant in the catalogue — 轮转/丝印/膜类/套装 工艺卡, 材料工艺卡, 预设产品工艺卡, the SOP-side 产品工艺卡, the legacy 产品工艺卡(兼容停用), and the PLM-side 工艺模板预设单. Auditing a 工艺卡 freezes the recipe (process steps, std times, materials) so production work-orders can copy it without seeing in-flight edits, and pushes the active flag into the related sales/dev/control snapshots. **What it does:** Validates `sGuid`, branches on `iFlag`. On `iFlag=1` flips `MftProductMaster.bCheck=1` and `mftproductslave` rows, `Update mftproductcontrol` to refresh the per-product control flags, `Insert INTO EleProduct` (with `update eleproduct` upsert) to materialise the active product snapshot, and back-writes the active recipe onto `salsaleschanceproduct` and `salsalesdevplanmaster` rows so the sales/dev side can quote against the new approval. `iFlag=0` reverses each. **Invocation:** Bound to `gdsmodule.sProcName` on **nine** sibling modules across 产品管理单据, 产品档案及SOP, and PLM单据 (轮转工艺卡 sId `101251240115015886014143310`; 丝印工艺卡 `101251240115015923024910330`; 膜类工艺卡 `101251240115016046551448370`; 预设产品工艺卡 `101251240115016081864262840`; 产品工艺卡 `101251240115016082594412050`; 材料工艺卡 `101251240115016088585774590`; 工艺模板预设单 `101251240115016124309963040`; 套装工艺卡 `12012615914116361116650540`; legacy 产品工艺卡(兼容停用) `19211681019715613574532820`). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships install + optimize scripts under `script/标版/`.