# `Fun_AnalysisListJsonTwo` (function)

> 根据 JSON字符串LIST类型解析函数


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_json` | `longtext` |
| 2 | IN | `cloumnNames` | `varchar(255)` |
| 3 | IN | `cloumnNames1` | `varchar(255)` |
| 4 | IN | `iColorOrder` | `int` |
| 5 | IN | `splitNames` | `varchar(10)` |

## Body

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

## Narrative

**Business context:** Color-count accumulator used during work-order product-standard cost calculation. Walks a JSON array of color rows, splitting them into "process colors" (CMYK + composite `C+M+Y+K`) versus "spot colors" depending on `iColorOrder`, and sums the matching quantity column.

**What it does:** for each row, extracts a name from `cloumnNames` and a quantity from `cloumnNames1`. If `iColorOrder=1` adds the quantity when the name matches one of `C`, `M`, `Y`, `K`, `C+M+Y+K`; otherwise adds the quantity when it does not. Returns the integer total (signature returns `int` even though intermediate is decimal). Despite the shared name, this is *not* a string-list flattener like the sibling functions — only the loop shape is shared.

**Invocation:** called only by `Sp_WorkOrder_CalcDataPackProductStd` — the data-pack cost calculator for packaging product standards.
