# `Sp_interface_additems_adv_before` (procedure)

> 调用接口前参数组装


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Integration before-hook for the Infor SyteLine `SLJobTrans/additems/adv/` REST endpoint — assembles the JSON body for the work-order add-items POST that mirrors a local 工单 (`mftworkordermaster`) into the SyteLine `ArtEstInterfaces` queue (printing-industry estimation hand-off).

**What it does:** Defaults the OUT params and assigns `sParam` to a hard-coded JSON template of the form `[{ "Action": 1, "ItemId": "PBT=[ArtEstInterfaces]", "Properties": [...] }]` with placeholder property values (ID, etc.). The body shows the procedure was started as a parameter-assembly scaffold against the work-order id (`sWorkOrderId`) but the dynamic property substitution from local tables has not been filled in. The CSDN URL in the proc comment points at the SyteLine `MGRestService` IDO documentation.

**Invocation:** Wired into the SyteLine work-order push as the pre-call hook (paired with `Sp_interface_additems_adv_after`). Dispatcher pattern mirrors `JdInterfaceServiceImpl.JDUDFVOUCHER()`: a SyteLine interface service calls `procedureService.getDoProMap()` + `getCallPro()` to build the HTTP request, POSTs to the URL captured in OUT `sHttpUrl` (parameter name retained even though it is missing here), then invokes the `_after` hook with the response body. Install script `script/标版/upgrade/20211115接口对接功能/Sp_interface_additems_adv_before.sql`. No live Java caller found in xly-src — feature appears stubbed.
