# `Fun_Subsequent_process` (function)

> 获取后道工序


- **Type:** FUNCTION
- **Returns:** `longtext`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProductClassifyId` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** Quotation/工序选择 helper — for a given product-classify, returns the full nested JSON tree of process-classifies → processes → process-dynamic-parameters that the quotation editor uses to render the "select subsequent processes" picker. Header gloss: "获取后道工序" (get downstream processes).

**What it does:** Joins `sisprocessclassify`, `sisproductclassifyProcessClassify`, and `eleprocess` filtered by `sProductClassifyId`, building a nested `JSON_OBJECT` array with each process-classify's metadata, its default process, and (inner subquery) all quotable `eleprocess` rows for that classify plus each row's `eleprocessdynamic` parameter list. Returns one big JSON string.

**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller. Candidate for maintainer audit — the JSON output shape matches the quotation-template editor, so this was likely staged for that screen but never wired in.
