Authoritative Tutorial on the Kingdee Cloud Warehouse Information Query Interface
What This Interface Solves
In supply chain integration scenarios between Jushuitan and Kingdee Cloud, warehouse master data is the reference foundation for all inbound, outbound, and transfer documents. This interface directly reads Kingdee warehouse basic data (form BD_STOCK) through executeBillQuery, used for cross-system warehouse mapping, code mapping maintenance, and warehouse field validation before downstream document sync, avoiding document write failures caused by missing master data.
Interface Capability Overview
- Authentication: Standard signature authentication for Kingdee Cloud WebAPI, typically combining app secret with user credentials.
- Request Method: POST to
executeBillQuery, with FormId fixed asBD_STOCK. - Request Structure: Includes
FormId,FilterString,Limit(default 2000),StartRow(default 0),FieldKeys, andrequest/otherRequestcondition blocks. - Response Structure: Returns a JSON array where each record is a warehouse basic data object, with
FStockIdas the primary key. - Pagination Mode: Offset-based pagination using
StartRow+Limit, with defaultLimit=2000per page; cycles through pages when records exceed this limit. - Incremental Mode:
FilterStringdefaults toFAuditDate>='{{LAST_SYNC_TIME|dateTime}}' and FDocumentStatus='C', performing incremental sync by audit date and syncing only approved warehouses. - Scheduling Strategy: crontab
3-59/5 7-23 * * *, polling every 5 minutes during business hours. - Strategy Type: QUERY only, Target configured as a no-op, no data written downstream.
Typical Field Mapping
| Field Name | Type | Meaning | Practical Notes |
|---|---|---|---|
| FStockId | string | Unique warehouse primary key | metadata.id maps to this field, the unique anchor for cross-system deduplication |
| FNumber | string | Warehouse business code | metadata.number maps to this field, unique within the organization, reference for document warehouse fields |
| FName | string | Full warehouse name | For manual identification, not used as primary key |
| FGroup | string | Warehouse group code | Used for grouping by region/type, requires combined judgment with FUseOrgId during cross-org mapping |
| FUseOrgId | string | Usage organization | In multi-org architecture, filter by passing FUseOrgId.FNumber organization code |
| F_POKM_JSTSTOCKNUMBER | string | Jushuitan warehouse mapping code | Custom extension field, one-to-one cross-system warehouse mapping |
| F_POKM_JSTSTOCKNUMBER2 | string | Jushuitan sub-warehouse mapping code | Fine-grained sub-warehouse mapping, required for Jushuitan logical sub-warehouse scenarios |
How to Configure on Qeasy
On the Qeasy data integration platform, this kind of Kingdee Cloud query interface is typically connected directly through the built-in "Kingdee Cloud adapter". During configuration, we fill FormId as BD_STOCK, map the primary key field to FStockId, and the code field to FNumber. The platform automatically constructs the executeBillQuery request and handles pagination loops.
The field mapper directly expands custom-prefix fields like F_POKM_JSTSTOCKNUMBER and F_POKM_JSTSTOCKNUMBER2 in the response into target system standard fields, without requiring additional scripting. The {{LAST_SYNC_TIME|dateTime}} in FilterString is automatically maintained by Qeasy's incremental cursor manager, requiring no manual reset between scheduled runs.
Since the strategy type is QUERY, the Target side is configured on Qeasy as a "no-op adapter", only landing data into the intermediate database for subsequent strategy consumption, without triggering write actions to downstream systems.
Cross-Scenario Practical Points
- Extension fields are key to cross-system integration: The custom fields
F_POKM_JSTSTOCKNUMBERandF_POKM_JSTSTOCKNUMBER2in Kingdee warehouse master data carry the actual cross-system mapping; prioritize verifying their maintenance when building mappings. - Multi-org must filter by FUseOrgId.FNumber: In Kingdee's multi-org architecture, pulling without an organization condition returns warehouses across the entire group, leading to severe mapping confusion downstream.
- Only sync approved warehouses:
FDocumentStatus='C'is a hard constraint; unapproved warehouses will be rejected when referenced in downstream documents. - Incremental cursor by audit date:
FAuditDateis the incremental field; do not misuseFCreateDate, otherwise new unapproved records will be missed or pulled repeatedly. - Limit=2000 is the platform default: In scenarios with warehouse counts exceeding tens of thousands, always confirm pagination loops correctly, otherwise tail-end data loss is extremely hard to detect.
- Pure query strategy writes no target: Target=no-op, after data enters the Qeasy intermediate database, subsequent sync strategies consume it by
FStockIdassociation.
Troubleshooting Review
- Pitfall: Wrong incremental field causes data loss: In one integration,
FAuditDatewas mistakenly configured asFCreateDate, resulting in new warehouses syncing successfully initially but never entering downstream after approval, causing inventory mismatches. The reliable approach: the incremental field must align with the business state-change field; always useFAuditDatefor approval scenarios. - Pitfall: Missing extension fields cause null pointer exceptions: If the custom field
F_POKM_JSTSTOCKNUMBERis not enabled on the Kingdee side, the field returns null in the response, causing direct errors in downstream mapping. We recommend setting default value fallbacks in the Qeasy field mapper and pre-sync log warnings. - Pitfall: Pagination not looping causes warehouse truncation: When warehouse count exceeds 2000 but pagination loops are not configured, only the first page is fetched, and new warehouses fail to sync later. We recommend explicitly defining pagination parameters and enabling the "auto-paginate" toggle on Qeasy.
- Pitfall: Wrong hierarchy in organization filter:
FUseOrgIdcannot directly accept organization code; it must acceptFUseOrgId.FNumber, otherwise the server-side ignores the condition. - Pitfall: Unapproved warehouses being consumed:
FDocumentStatus='C'is omitted from FilterString, draft-state warehouses are pushed downstream, causing subsequent inbound/outbound document write failures. We recommend configuring the approved filter as a default mandatory condition in the Qeasy request template.
When to Use This Interface
Applicable scenarios: initialization and continuous sync of warehouse master data between Jushuitan and Kingdee Cloud, as well as any cross-system document flow prerequisite that depends on warehouse code mapping. Boundaries: only applicable to Kingdee Cloud private deployment, where customers must enable custom extension fields F_POKM_JSTSTOCKNUMBER and F_POKM_JSTSTOCKNUMBER2; not suitable for lightweight ERP scenarios lacking organizational dimensions.