# `Sp_cpjy_cpwgrk` (procedure) > 1/3 研发成品检验->成品外购入库-wx-2025-08-27 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `tStartDate` | `datetime` | | 2 | IN | `tEndDate` | `datetime` | | 3 | IN | `iType` | `varchar(100)` | | 4 | IN | `sLoginId` | `varchar(100)` | | 5 | IN | `sBrId` | `varchar(100)` | | 6 | IN | `sSuId` | `varchar(100)` | | 7 | IN | `bFilter` | `longtext` | | 8 | IN | `pageNum` | `int` | | 9 | IN | `pageSize` | `int` | | 10 | OUT | `totalCount` | `int` | | 11 | IN | `countCloumn` | `longtext` | | 12 | OUT | `countMapJson` | `longtext` | | 13 | IN | `sFilterOrderBy` | `longtext` | | 14 | IN | `sGroupby_select_sql` | `longtext` | | 15 | IN | `sGroupby_group_sql` | `longtext` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_cpjy_cpwgrk`'`._ ## Narrative **Business context:** Custom flow (label `cpjy_cpwgrk` = 成品检验→成品外购入库) — paged report listing 研发申请 (R&D-application, `YFSQ`-prefixed orderNo) outsourced rows ready for 成品外购入库 (finished-product purchase inbound). COMMENT marks it as "1/3 研发成品检验->成品外购入库-wx-2025-08-27" — first step of a customer-flagged three-stage upgrade. **What it does:** Filters `Viw_OpsOutsideProcess` × `eleproduct` against `sFormId='192116810113315234963208090'` for `bCheck=1`, `bInstoreComplete=0`, `bInvalid=0` and `LEFT(sOrderNo,4)='YFSQ'`. For QC type ≠3 it uses `dCheckQty − dInStoreQty > 0`; for type=3 (免检/exempt) `dAuxiliaryQty − dInStoreQty > 0`. Pivots through `TmpSalSalesCheck_sum`, enriches with `qlyproducttestmaster` and `eleproductstock`, and hands the assembled rows to the standard pagination wrapper. **Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster.sSqlStr` binding, other-routine caller, or xly-src hit. The dated COMMENT and `wx-2025-08-27` tag identify this as an in-progress customer extension (likely tenant-specific code under wx-prefixed naming); the matching form-master binding has not been deployed in this environment. Candidate for maintainer audit.