# `Sp_Ai_AddCommonAfterNew` (procedure) > AI_调用下单 插入订单 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sBrId` | `varchar(100)` | | 2 | IN | `sSuId` | `varchar(100)` | | 3 | IN | `sLoginId` | `varchar(100)` | | 4 | IN | `sToolId` | `varchar(100)` | | 5 | IN | `sSrcFormId` | `varchar(100)` | | 6 | IN | `sControlName` | `varchar(100)` | | 7 | IN | `sData` | `longtext` | | 8 | IN | `sRowData` | `longtext` | | 9 | OUT | `sBillId` | `varchar(100)` | | 10 | OUT | `sReturn` | `longtext` | | 11 | OUT | `sCode` | `int` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Ai_AddCommonAfterNew`'`._ ## Narrative **Business context:** AI-assistant order-insertion handler, generic-form variant — header says `AI_调用下单 插入订单`. Newer revision of `Sp_Ai_AddCommonAfter` that derives `p_sTableName`/`p_sFormId` dynamically from `gdsconfigformslave` keyed on the AI-provided `sControlName`, then reads `sSlaveId` + `operateType` out of the JSON `sData` payload. Adds an OUT `sBillId` so the caller can chain follow-up actions on the inserted row. **What it does:** Validates `sSrcFormId`/`sControlName` non-empty. Looks up the target-form `sActiveId`/`sTbName`/`sChinese` via `gdsconfigformslave` JOIN `gdsconfigformmaster` filtered by the AI-provided `sChinese` button name. Parses `sSlaveId` and `operateType` from the JSON payload. The rest of the body (the actual INSERT/UPDATE branches keyed on `operateType`) is largely commented out — this is scaffolding for an AI-driven generic-create flow. **Invocation:** Status: appears orphaned. No `gdsconfigformslave` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src`. Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant `sBrandsId='1111111111'`.