Purchase Receipt Query to WMS Queue: Incremental Sync from Kingdee Cloud to WMS in Practice
What This Strategy Solves
In a private deployment at a pharmaceutical distribution enterprise, the WMS needs to consume purchase receipt documents from the upstream ERP, but the WMS does not connect directly to the ERP — it only accepts a pull pattern of "query back by WMS number". We use the Qeasy (轻易云) data integration platform as a bridge: poll incremental receipt documents from the upstream system on schedule, write them into an internal query queue, and let subsequent strategies push that queue to the WMS. This article focuses on the first step: querying purchase receipt documents and generating the WMS query queue.
Data Flow and Field Mapping
The data flow is unidirectional: upstream ERP (source) → Qeasy platform query queue (intermediate layer) → target write-noop placeholder waiting for WMS pull.
| Role | System / Component | Key Action | Key Fields |
|---|---|---|---|
| Source | Kingdee Cloud | Call executeBillQuery to query purchase receipt documents | FBillNo (document number), F_UVQS_WMSBH (WMS number) |
| Intermediate | Qeasy Integration Platform | Deduplicate by FBillNo and enqueue, producing the WMS query queue | number, id |
| Target | Write-noop (RESTful placeholder) | POST submit, preparing for downstream WMS consumption | — |
Splitting header and body into stages is a common pattern among Qeasy customers: this strategy only takes the header (
FBillNo+F_UVQS_WMSBH), leaving detail rows for a follow-up strategy to pull, avoiding oversized response payloads.
How to Configure on Qeasy
- Source configuration: select the
executeBillQueryAPI, method POST, business object "Purchase Receipt". Set bothnumberandidtoFBillNo, and turn offidCheckandautoFillResponse— this step only queries, it does not write back. - Request parameters: always pass
Limit=2000,StartRow=0,TopRowCount=0for pagination; useFBillNoandF_UVQS_WMSBHas the business filter conditions. - Target configuration: use the "write-noop" RESTful endpoint as a placeholder, and turn
idCheckon to ensure the same document is not enqueued twice. - Code mapping: pass the Kingdee
FBillNostraight through to Qeasy'snumber, and keep the WMS number as-is — this is a clear demonstration of the centralized code-mapping management habit seen in Qeasy customers, where all transformation rules live in the platform dictionary rather than scattered across scripts. - Script hook: attach a Python script after the source returns but before writing to the target, filtering out records where
F_UVQS_WMSBHis empty — pushing documents without a WMS number downstream is pointless.
Implementation Steps
We split the rollout into three phases for the customer:
- Incremental starting point: on the night of go-live, run a one-shot full backfill that queries every received receipt from the past N days and enqueues them; the full load uses
StartRowfor pagination andLimit=2000per page, stopping when the returned row count is less than 2000. - Full-load trigger: the one-off script runs once and is then disabled; it is never triggered again.
- Schedule frequency: the regular schedule is
*/10 7-22 * * *, i.e. every 10 minutes from 07:00 to 22:00 daily, covering the receiving peak; from 23:00 to 06:00 the job is paused to leave a window for the upstream batch processing. - Dependencies: this strategy has an empty
depends_onand is the first link in sequence A; subsequent sequences B and C for return-sync and inbound-write-back all depend on the queue it produces.
Pitfalls from the Field
- Forgetting to enable
idCheckcauses errors when rerunning the full load: when we first went live, the target-sideidCheckwas left off, so the sameFBillNowas written into the queue twice, and downstream WMS consumption produced duplicate documents. The safe approach is — for a query-only strategy, the target side must enableidCheckand useFBillNoas the idempotency key. - Empty
F_UVQS_WMSBHstill gets pushed into the queue: in the first week after go-live, downstream reported that 30% of documents could not find a WMS number. The classic mistake is to persist the source response as-is without filtering in the script. This is a common pitfall — empty numbers fail validation on the WMS side. - No upper bound on the pagination parameter: if
executeBillQueryis called withoutLimit, Kingdee returns every row in a single response, and a document with tens of thousands of lines will blow up memory. Always explicitly passLimit=2000and page through withStartRow. - Running overnight collides with the upstream batch window: the default schedule
*/10 * * * *ran all day and night, and midnight jobs collided with the upstream day-end processing. Switching to*/10 7-22 * * *made the issue go away. TopRowCountnot passed, so the total count is unreachable: this field is technically optional, but passing it makes it easy for the follow-up strategy to render a progress bar; once it is missing, operations loses the "how much is left" observation port.
Where It Fits and Where It Doesn't
Fit: the upstream ERP exposes a standard query interface, the WMS can only pull rather than be pushed, documents carry a stable business number that can serve as an idempotency key, and there is a clear "receipt → inbound" time window. Doesn't fit: when the upstream can only push rather than be queried (e.g. no executeBillQuery-style API), when documents have no stable primary key, when the WMS needs real-time notification instead of polling, or when the other side has no habit of using a write-noop placeholder — in the latter case, a push-style strategy is recommended.