# `sp_add_elecustomer_to118_after` (procedure)

> 培训调用第三方接口（测试客户保存后，将客户信息插入118客户主表）请求后处理


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Training scaffold companion to `sp_add_elecustomer_to118`. Header says "培训调用第三方接口（测试客户保存后，将客户信息插入118客户主表）请求后处理" — the after-handler that processes the third-party API response (parses `code`/`msg`, optionally writes back). Demonstrates the response-handling half of the "post a customer to '118' external master" demo flow.

**What it does:** Validates that the request JSON `sRequestParam` is valid, extracts `$.code` and `$.msg` into `p_code`/`p_msg`; if `p_code < 0` sets `sCode = -1` + error message; otherwise sets `sCode = 1`. Body is all template scaffolding with comments — no real writeback statements are uncommented.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep). "培训" prefix marks it as a training/demo template paired with `sp_add_elecustomer_to118`. Candidate for the "training scaffolds" audit bucket.
