# `sp_add_elecustomer_to118` (procedure)

> 培训调用第三方接口（测试客户保存后，将客户信息插入118客户主表）组装报文


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sMakePerson` | `varchar(100)` |
| 2 | IN | `sSuId` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `p_sId` | `varchar(100)` |
| 5 | OUT | `sAfterIn` | `longtext` |
| 6 | OUT | `sCode` | `int` |
| 7 | OUT | `sReturn` | `longtext` |
| 8 | OUT | `sParam` | `longtext` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `sp_add_elecustomer_to118`'`._

## Narrative

**Business context:** Training scaffold for the 第三方接口 (third-party-interface) push-out feature. Header literally says "培训调用第三方接口（测试客户保存后，将客户信息插入118客户主表）组装报文" — a training-example procedure showing how a 按钮 (button) calc-proc can assemble a JSON request to push a freshly-saved `elecustomer` row into the "118" external customer master. The companion proc `sp_add_elecustomer_to118_after` handles the response.

**What it does:** Builds a JSON `sParam` payload (`name=master`, `sTable=elecustomer`, `column=[...]`) from one `elecustomer` row by `p_sId` + tenant `sBrandsId`/`sSubsidiaryId`; serialises 40+ customer fields into a JSON object; concatenates the id list into `sAfterIn` for the after-proc to use. Sets `sCode = -1` if id missing or payload empty, `sCode = 1` on success. No DB mutations — pure payload assembly.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep). The "培训" prefix in the header confirms this is a training/demo template intended to be cloned per real integration; not expected to be live-called itself. Candidate for the wiki's "training scaffolds" audit bucket rather than maintainer-fix.
