# `sp_do_order_get` (procedure)

> 测试获取电商订单组装报文


- **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_do_order_get`'`._

## Narrative

**Business context:** Interface-integration **template** — "测试获取电商订单组装报文" (sample for assembling an e-commerce order pull-request body). Demonstrates the param shape (`p_sId`, `sBrId`, `sSuId`, OUT `sAfterIn`/`sCode`/`sReturn`/`sParam`) that the ERP's outbound-interface dispatcher passes when it asks a proc to build the JSON payload for an external e-commerce API call.

**What it does:** Defaults every parameter to a safe empty/`1`/"操作成功". Aborts with `sCode=-1, sReturn='单据ID未传入,无法正确组装调用报文'` when `p_sId` is empty. Inside the `business:BEGIN` block, builds a sample `sParam` via `SELECT JSON_OBJECT('interfaceVerifyCode','un587nig6tr','orderHeaderId','FD00019','brandsPartyId','201611…')` with hard-coded literals — i.e. as-shipped it returns a fixed sample envelope, not real data. The body comments mark "// 业务数据组装开始/结束" as the spot where the tenant fills in the real JOINs against its order tables.

**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it, no xly-src grep hits at all. The "测试" in the title and the hard-coded sample values confirm this is documentation / a starter snippet for the outbound-interface "组装报文" hook — not a live runtime callee. Candidate for maintainer cleanup once real per-tenant variants exist.
