Qeasy Cloud
Get Started

Purchase Receipt Query to WMS Queue: Incremental Sync from Kingdee Cloud to WMS in Practice

· 高金凤· Integration Solutions· 9 views· 4 min read

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.

RoleSystem / ComponentKey ActionKey Fields
SourceKingdee CloudCall executeBillQuery to query purchase receipt documentsFBillNo (document number), F_UVQS_WMSBH (WMS number)
IntermediateQeasy Integration PlatformDeduplicate by FBillNo and enqueue, producing the WMS query queuenumber, id
TargetWrite-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

  1. Source configuration: select the executeBillQuery API, method POST, business object "Purchase Receipt". Set both number and id to FBillNo, and turn off idCheck and autoFillResponse — this step only queries, it does not write back.
  2. Request parameters: always pass Limit=2000, StartRow=0, TopRowCount=0 for pagination; use FBillNo and F_UVQS_WMSBH as the business filter conditions.
  3. Target configuration: use the "write-noop" RESTful endpoint as a placeholder, and turn idCheck on to ensure the same document is not enqueued twice.
  4. Code mapping: pass the Kingdee FBillNo straight through to Qeasy's number, 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.
  5. Script hook: attach a Python script after the source returns but before writing to the target, filtering out records where F_UVQS_WMSBH is 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 StartRow for pagination and Limit=2000 per 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_on and 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

  1. Forgetting to enable idCheck causes errors when rerunning the full load: when we first went live, the target-side idCheck was left off, so the same FBillNo was 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 enable idCheck and use FBillNo as the idempotency key.
  2. Empty F_UVQS_WMSBH still 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.
  3. No upper bound on the pagination parameter: if executeBillQuery is called without Limit, Kingdee returns every row in a single response, and a document with tens of thousands of lines will blow up memory. Always explicitly pass Limit=2000 and page through with StartRow.
  4. 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.
  5. TopRowCount not 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wms-kingdee-cloud-1787-wms-15bcd2b7

Comments