# `Sp_interface_SLJobTrans_before` (procedure)

> 报工推送


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Infor SyteLine 报工推送 integration before-hook. Mirrors the last 24 hours of local 生产报工 (`mftproductionreportmaster`/`mftproductionreportslave`) into a JSON list that an external SyteLine MGRestService endpoint accepts as `SLJobTrans/additems/adv/` items (`Job, Suffix, TransType, TransDate, QtyComplete, QtyScrapped, OperNum, AHrs, NextOper, EmpNum, DerStartTimeMin, DerEndTimeMin, PayRate, QtyMoved, Whse, PrRate, JobRate, Shift, Wc, RESID, LotManufacturedDate`).

**What it does:** Hard-codes `sHttpUrl` to `http://192.168.8.113/IDORequestService/MGRestService.svc/json/SLJobTrans/additems/adv/?refresh=ALL&props=…`. Builds temp tables `p_mftproductionreportmaster_tmp` / `p_mftproductionreportslave_tmp` populated from `mftproductionreportmaster` rows newer than `DATE_ADD(NOW(), INTERVAL -24 HOUR)`. Aggregates `dProcessQty` per slave back onto the master via `UPDATE p_mftproductionreportmaster_tmp`. Walks `mftproductionplanslave` to capture the plan-side `dProcessQty` for delta calculation. Emits the assembled rows as a JSON array in OUT `sParam`. After the SyteLine HTTP POST returns, the caller updates `mftproductionplanslave` to mark the rows as pushed.

**Invocation:** Wired as the SyteLine 报工 (production-report) push pre-hook. The dispatcher follows the same `procedureService.getDoProMap()`/`getCallPro()` pattern as `JdInterfaceServiceImpl.JDUDFVOUCHER()`. No Java grep hit in xly-src today — install script not shipped under `script/标版/`, so the proc lives only in the live database. Status: appears to be a customer-specific integration kept warm for re-activation, not part of the standard release.
