# `Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLoginId` | `varchar(100)` |
| 2 | IN | `sWorkCenterId` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | IN | `bFilter` | `varchar(5000)` |
| 6 | IN | `pageNum` | `int` |
| 7 | IN | `pageSize` | `int` |
| 8 | OUT | `totalCount` | `int` |
| 9 | IN | `countCloumn` | `varchar(5000)` |
| 10 | OUT | `countMapJson` | `longtext` |
| 11 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 12 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 13 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — outsourced-process variant of `Sp_Manufacture_ProductionPlanInfo_WorkCenter`. Drives the 顶部机台卡片 (top machine-card strip) for 工作中心 entries that represent 委外工序 (`Viw_OpsOutsideProcess`) — vendor-handled steps that still need to be tracked on the scheduling board.

**What it does:** Builds temp `p_TmpWorkCenter` rows by `INSERT INTO p_TmpWorkCenter SELECT O.sId, '1', P.sWorkCenterId, '已下达', W.sName, 0, O.iOrder FROM Viw_OpsOutsideProcess O JOIN eleprocess P ON O.sProcessId=P.sId JOIN sisworkcenter W ON P.sWorkCenterId=W.sId WHERE O.bCopyLimit=0 AND O.bCheck=1 AND O.bInstoreComplete=0 AND O.bInvalid=0 AND Abs(O.dAuxiliaryQty)-Abs(O.dInStoreAuxiliaryQty)>0` and tenant match. Then selects each card with a synthetic `sId` like `<type>_<machineId>_<tStartDate>` (special-cases 全部/未排/null) and per-card totals (`dHour`). Pages out through `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`.

**Invocation:** No `gdsconfigformmaster.sSqlStr` row in the live snapshot binds it, no other routine in `xlyweberp_saas_ai` calls it, no Java caller found. Install script: `xly-src/script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.sql`. Status: appears orphaned in this DB — likely an outsourcing extension to the 顶部机台卡片 strip that was wired up per tenant or pending activation; candidate for maintainer audit.
