Qeasy Cloud
Get Started

Sales Return-to-Warehouse → Sales Outbound (Cancel Goods Receipt) Sync: A Practical Walkthrough from Jushuitan to Kingdee Cloud Cosmic

· 何金辉· Integration Solutions· 17 views· 4 min read

What This Strategy Solves

In a multi-channel retail setup, a common headache is "the goods are already returned to the cloud warehouse, yet the sales outbound document is stuck in a goods-received state." When Jushuitan generates a sales return-to-warehouse document, Kingdee Cloud Cosmic needs the matching sales outbound document set to "cancel goods receipt" so that inventory occupation is released and the financial reconciliation matches. In one real project, we used the Qeasy Data Integration Platform to carry this link. The core goal is to chain "return-to-warehouse trigger → status write-back → inventory release" into an automated, observable, replayable, and traceable pipeline.

Data Flow and Field Mapping

Data flow: Jushuitan·Qimen (sales return-to-warehouse document) → Qeasy Data Integration Platform (as the middleware layer handling transformation and mapping) → Kingdee Cloud Cosmic (sales outbound document, cloud warehouse, status set to cancel goods receipt).

Key field mapping (source → middleware → target, listing only the fields that bite you in practice):

Business meaningJushuitan source fieldQeasy middlewareKingdee Cloud Cosmic target field
Document numberio_id / return doc no.Unified doc number (with prefix)FBillNo
WarehouseReturn-in warehouse codeWarehouse mapping table → cloud warehouse codeFStockId / FStockPlaceId
CustomerBuyer / distributor codeCustomer master key mappingFCustomerID
Material codeSKUMaterial mapping (centrally maintained)FMaterialId
QuantityReturn-to-warehouse qtyUnchangedFQty
Document statusReturn completedStatus translation: "cancel goods receipt"FBillStatus / corresponding status field
TimestampModified timeIncremental cursorFBizDate / FModifyTime

Note: Actual field names depend on the target system's current version. When implementing, always pull fresh metadata from Kingdee Cloud Cosmic instead of reusing historical solution notes.

How to Configure in Qeasy

In the Qeasy Data Integration Platform, we usually split this strategy into a three-stage "source → middleware → target" configuration:

  1. Source (Jushuitan·Qimen): Use Qeasy's Jushuitan adapter to pull sales return-to-warehouse documents, filtering by "last modified time + document status." Place the incremental cursor in a Qeasy global variable so checkpoint recovery is covered.
  2. Middleware (Qeasy): This is the pivotal stage. Two common patterns from Qeasy customers: centralized code mapping management — keep warehouse, customer, and material code mappings as a "lookup table + cache," so any mapping change is a one-place edit; and header / body staged processing — commit headers first, then commit body rows asynchronously, so a failed row only retries itself and does not roll back the rest.
  3. Target (Kingdee Cloud Cosmic): Call the sales outbound document save / submit API, translating the status into "cancel goods receipt." In Qeasy, this is usually a status-mapping script that converts Jushuitan's "return completed" semantic into the Kingdee Cloud Cosmic status value.

A robust pattern: for every batch, write Jushuitan document number, target document number, run time, and result status into a log table so you can trace back by document number when something breaks.

Implementation Steps

On customer sites we usually walk through four steps:

  1. Preparation (run a one-off full load to validate mappings): Use historical return documents for a one-time full load and walk every code mapping and status translation through. In Qeasy, configure this as "manual trigger" or "one-shot schedule." Don't switch on automation until this passes.
  2. Incremental starting point (take the incremental cursor): Take "last modified time" from the moment the full load ends as the incremental starting point. This is the easiest place to crash — too early causes a re-run, too late causes lost documents. The safe move is to roll back 2-5 minutes for redundancy.
  3. Schedule frequency: Jushuitan return documents usually tick at minute-level granularity, while Kingdee Cloud Cosmic has concurrency limits on writes. We typically set the schedule at every 3-5 minutes, staggered during peak hours so it does not collide with material sync or inventory sync.
  4. Incremental / full dual-track: For the first two weeks after going live, run incremental and full in parallel; reconcile daily by document number + quantity + status, and only retire the full track after things stabilize.

Pitfall Recap

Here are the recurring crash sites we have hit across projects:

  1. Hard-coding warehouse codes from day one: On one engagement the customer did not ask for a mapping table, so the "cloud warehouse code" was hard-coded into the script. Three months later when warehouses changed, the whole pipeline had to be re-shipped. The robust approach is to manage it via a Qeasy mapping table.
  2. Inverting the status translation semantics: Jushuitan's "return completed" and Kingdee Cloud Cosmic's "cancel goods receipt" are not literal translations — there is a semantic check on "whether to release inventory" in between. We guarded this with an explicit conditional in the script.
  3. Wrong incremental starting point: Right after the full load, we set "current time" as the incremental starting point and lost a batch of in-flight documents. The robust move is to roll back a few minutes for redundancy and add a "catch-up task" in Qeasy.
  4. Body-row failure rolling back the whole document: Once, a 50-row document failed at row 30 because of an abnormal quantity, and the entire document was rolled back. The robust approach is to stage header and body separately so single-row failure retry does not affect other rows.
  5. Kingdee Cloud Cosmic concurrency ceiling tripped: Running material sync and return-to-warehouse sync in parallel triggered target system throttling. The robust move is to stagger schedules in Qeasy and add backoff retries.

Applicable and Non-applicable Scenarios

Applicable: Multi-channel retail / distribution setups where Jushuitan is the front-end transaction hub and Kingdee Cloud Cosmic is the back-end ERP, and the business needs a closed reconciliation loop between "return-to-warehouse" and "cancel goods receipt" at the cloud warehouse level. Not applicable: Offline direct-shipment scenarios (no cloud warehouse transit), scenarios where Jushuitan and Kingdee Cloud Cosmic share a single set of documents within one organization, and scenarios where return-to-warehouse documents must go through a complex approval workflow — these scenarios cannot be covered by a single sync strategy and require a dedicated return process.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-jushuitan-kingdee-cloud-2514-n88499f37-5f1e66ca

Comments