# `Sp_Process_CommonGtChar` (procedure) > 机台计划:排程甘特图 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sFlag` | `varchar(225)` | | 2 | IN | `sLoginId` | `varchar(100)` | | 3 | IN | `sState` | `varchar(10)` | | 4 | IN | `sBrId` | `varchar(100)` | | 5 | IN | `sSuId` | `varchar(100)` | | 6 | IN | `bFilter` | `varchar(5000)` | | 7 | IN | `sFilterOrderBy` | `varchar(5000)` | | 8 | IN | `sGroupby_select_sql` | `varchar(5000)` | | 9 | IN | `sGroupby_group_sql` | `varchar(5000)` | | 10 | OUT | `sCode` | `int` | | 11 | OUT | `sReturn` | `longtext` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Process_CommonGtChar`'`._ ## Narrative **Business context:** 生产管理 → 排程 → 机台计划 — Gantt-chart data builder for the per-machine scheduling view (proc COMMENT: "机台计划:排程甘特图"). Returns a JSON payload `{zoom, data, links}` consumed directly by the front-end Gantt component (dhtmlx-style task/dependency model). **What it does:** Splits the front-end `bFilter` JSON array into individual `bFilterName`/`bFilterValue` json objects via `Fn_json_extract`, harvesting `sMachineId`, `sProcessId`, `sWorkCenterId`, `tStartDate` selectors. Aborts with `sCode=-1, sReturn='请先选择机台'` when no machine. Counts `MftProductionPlanSlave` rows for that machine where `sState<>'5' AND dProcessQty-dProductionReportQty>0 AND bProductionReportComplete=0`; cursors each plan-slave row ordered by `iOrder`, building a JSON task per row (`id, text=sSrcNo+sPartsName+sDecompose, start_date, end_date=start+dHour min, duration=dHour, progress=dProductionReportQty/dProcessQty, sWorkOrderId, sMachineId, sWorkCenterId, sTable='MftProductionPlanSlave', iOrder, dHour, sHandleType='GT'`) appended to `p_dataArray`. Between adjacent rows it emits a `links` edge (`source=prev_id, target=this_id, type='0'`). Wraps in `{zoom:{scale:'Minutes',step:30}, data, links}`, runs the `"{` / `}"` un-escape passes, returns via `sReturn`. **Invocation:** Status: appears orphaned at the wiring level — no `gdsmodule.sProcName` binding, no `gdsconfigformmaster.sSqlStr/sConfigSqlStr` binding, no `gdsconfigcharmaster.sProcedureName` binding, no other-routine caller. Only install script `xly-src/script/标版/30100101/schedule/Sp_Process_CommonGtChar.sql` ships it. The signature (`bFilter`, `sGroupby_*_sql`) plus the JSON return shape suggests it was called from a Java controller assembling the Gantt page; the call site isn't reachable by name grep — verify with the front-end module config.