# `Sp_saleschanceToSop_BtnEventTodevelop` (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_saleschanceToSop_BtnEventTodevelop`'`._

## Narrative

**Business context:** 销售单据 / 商机机会 → 开发跟进 — toolbar-button handler that marks selected 商机机会产品 lines as 已开发 (sent to development), stamping the operator and timestamp. Forward action; the inverse is `Sp_saleschanceToSop_BtnEventDevelopBack`.

**What it does:** Validates `sProInParam` (rejects with `paramsErro` via `Sp_Sis_GetConst` if too short). Parses `$.changeValue.sDevelopMemo` and the `$.params[*].value[*].sSlaveId` JSON array. For each slave id, `UPDATE salsaleschanceproduct SET tDevelopDate=NOW(), sDevelopPerson=sMakePerson, bDevelop=1, sDevelopMemo=<memo>, sDevelopBackMemo='' WHERE sId=<sSlaveId> AND sBrandsId=sBrId AND sSubsidiaryId=sSuId` — turning on the develop flag with timestamp, stamping the operator, capturing the user's develop note, and clearing any previous roll-back memo.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 转开发 toolbar button on the 商机机会 / 开发跟进 grid names `Sp_saleschanceToSop_BtnEventTodevelop` as the action. Companion procs: `Sp_saleschanceToSop_BtnEventDevelopBack` (inverse), `Sp_saleschanceToSop_BtnEventDistribution`. Install script: `script/标版/30100101/Sp_saleschanceToSop_BtnEventTodevelop.sql`.
