# `Sp_Manufacture_ProductionArrange` (procedure)

> 生产计划看板(无排程)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sCustomerName` | `varchar(255)` |
| 2 | IN | `tStartDate` | `datetime` |
| 3 | IN | `tEndDate` | `datetime` |
| 4 | IN | `sWorkOrderNos` | `varchar(255)` |
| 5 | IN | `sLoginId` | `varchar(4000)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | IN | `bFilter` | `varchar(5000)` |
| 9 | IN | `pageNum` | `int` |
| 10 | IN | `pageSize` | `int` |
| 11 | OUT | `totalCount` | `int` |
| 12 | IN | `countCloumn` | `varchar(5000)` |
| 13 | OUT | `countMapJson` | `longtext` |
| 14 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 15 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 16 | 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_ProductionArrange`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产计划看板 (无排程 variant — the un-scheduled board). One-row-per-工单 list filtered by customer / date / work-order numbers, used as the customer-and-due-date board on the 生产看板. Header label "生产计划看板(无排程)" distinguishes it from `Sp_Manufacture_ProductionArrange2` which is the page-tree-driven scheduled version.

**What it does:** Builds temp tables `p_TempTable`, `p_MftWorkOrderProcess`, `p_TempTable_work`, `p_viw_mftproductionreport`. Inserts work-orders from `MftWorkOrderSlave` joined with `mftworkorderprocess` / `viw_mitproductionmaterials` / `mftproductionreportmaster`, filtered by `sCustomerName`, `tStartDate..tEndDate`, `sWorkOrderNos`, `sLoginId`. Computes per-工单 progress (planned vs. reported), rolls process status up, then `CALL Sp_Do_UpdateByPageSizeBefore` to apply standard paging and returns the rows via `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`.

**Invocation:** Bound as the data-source of 生产看板 and 大屏看板 forms via `gdsconfigformmaster.sSqlStr` — including `15905732950005954209191860345000` (生产看板, under 生产管理 → 生产计划管理 → 生产计划看板) and a fleet of `101251240115016087744...` 大屏看板 variants. Also `gfm 101251240115016111296520860` (生产计划甘特图). Loaded when the user opens any of those boards. Install script: `xly-src/script/标版/30100101/Sp_Manufacture_ProductionArrange.sql` plus upgrade and customer-specific overrides (千彩, 嘉诚).
