# `Sp_Calc_sSdp` (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(5000)` |
| 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_sSdp`'`._

## Narrative

**Business context:** 销售管理 → 开发计划 / 印前任务计划 / 项目立项单据 (development plan / prepress-task plan / project initiation — `salsalesdevplanmaster`) audit / un-audit. The 开发计划 schedules prepress/dev tasks against an 开发申请; on audit it freezes the plan rows, locks the originating 开发申请 line, and writes process-version refs onto `mftproductprocess` for any product being developed.

**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesdevplanmaster`; writes-back to the originating `salsalesdevmaster` (audit qty on the development application) and updates `mftproductprocess` to record process versions; reads `viw_salsalesdevplan` for context. `iFlag=0` reverses the chain.

**Invocation:** Bound to `gdsmodule.sProcName` on:
- `开发计划` (sId `101251240115016044841089590`)
- `印前任务计划` (sId `101251240115016054411974580`)
- `项目立项单据` (sId `101251240115016147549171140`)

Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the standard `Sp_Calc_s<Code>` slot.
