Syncing Sales Outbound Orders from Jushuitan to Kingdee Cloud Cosmos: Incremental Scheduling on Qeasy
What This Strategy Solves
For retail businesses, moving e-commerce outbound orders from Jushuitan to Kingdee Cloud Cosmos for financial posting and inventory accounting looks like simple "document transport." But if the incremental window, status filter, and shop-to-customer mapping are not designed carefully, the two systems drift apart within three months and month-end reconciliation becomes an incident.
This strategy addresses one specific scenario: pull Confirmed sales-outbound orders from Jushuitan daily by modification time, and write them as standard sales-outbound documents (XSCKD01_SYS) into Kingdee Cloud Cosmos, pinned to sales organization 101, with customers mapped from shops.
Data Flow and Field Mapping
Data Flow: Jushuitan (source) → Qeasy data integration platform (middleware, with transformation and mapping) → Kingdee Cloud Cosmos (target).
Key Field Mapping Table (desensitized from the source material):
| Business Meaning | Source Field (Jushuitan) | Target Field (Kingdee) | Handling Notes |
|---|---|---|---|
| Document number | io_id | FBillNo | Direct carry-over, recommended as idempotency key |
| Outbound date | io_date | FDate | Normalize to yyyy-MM-dd |
| Customer / shop | shop_id | FCustomerID | Go through encoding mapping, one-to-one between shop and customer master |
| Document type | fixed | FBillTypeID | Hardcode XSCKD01_SYS |
| Sales organization | fixed | FSaleOrgId | Hardcode 101 |
| Document status | status | — | Only sync Confirmed; filter WaitConfirm/Cancelled at source |
| Line items | items[] | FEntity | Process header first, then lines in batches |
How to Configure It on Qeasy
On the Qeasy data integration platform, this strategy is typically configured with two nodes — source and target:
- Source node (Jushuitan · Qimen): API is
jushuitan.saleout.list.query, POST. Pagination withpage_indexandpage_size(max 50). Incremental window usesstart_time/end_time, start with{{LAST_SYNC_TIME}}, end with{{CURRENT_TIME}}, with the interval not exceeding 7 days. Status filter is hardcoded toConfirmed. - Target node (Kingdee Cloud Cosmos): API is
batchSave, document typeXSCKD01_SYS, sales organization101. EnableidCheckwithio_idas the idempotency number to prevent duplicate writes. - Middleware mapping layer: The shop-to-customer encoding map should be maintained centrally in a single mapping table rather than hardcoded inside each strategy. A common Qeasy customer pattern is to process the header first, then submit the line-item body in a second phase.
Implementation Steps
We tend to push an incremental strategy through three phases:
Phase 1: Confirm the incremental starting point. Before the first go-live, manually set a start_time (e.g., 00:00 on the go-live day) and initialize LAST_SYNC_TIME to this value to avoid missing data.
Phase 2: Full backfill trigger (once, on go-live day). Use a temporary task to pull all Confirmed orders from the past N days. Since the window must be ≤ 7 days, slice into 7-day loops. Once the full backfill completes, snap the cursor to "current time" immediately.
Phase 3: Steady-state incremental scheduling. Schedule the source at 0 22 * * * (every day at 22:00, pulling the previous full day), and the target at 0 1 * * * (writing at 01:00 the next day). The two time points are staggered to leave margin for the source pull and to avoid peak hours on the Kingdee side. A common Qeasy customer pattern is the dual-track of incremental and full: keep the full script available but disabled by default, only enabling it manually during breakpoint recovery.
Lessons from the Field
- Silent failure when the window exceeds 7 days. The Jushuitan interface returns an error when
start_timetoend_timeexceeds 7 days, but the error message is not prominent. The safe approach is to add "automatic window slicing" logic in the Qeasy scheduler script. - Shop ID does not match the customer master. A typical issue seen on customer sites is that after a new shop is opened in Jushuitan, the customer master has not been created on the Kingdee side, and
batchSavethen fails. It is recommended to add a "master pre-validation" step before the mapping layer — write missing entries into a todo queue rather than throwing an error directly. - WaitConfirm orders leak in. The source-side status filter must be hardcoded to
Confirmed, otherwise orders that have not actually shipped will enter the financial system, causing inventory mismatches at month-end. - Using FBillNo alone is not enough for idempotency. The same document number with different modification times causes duplicate writes. The recommended idempotency key combination is
io_id + io_modified_time. - Timezone drift. Jushuitan timestamps are UTC+8, but when Kingdee parses them in local time, cross-day data may be lost. The middleware layer should uniformly force +08:00 handling.
Applicable and Non-Applicable Scenarios
Applicable: E-commerce retail, where shipping immediately posts to the books, with Jushuitan as the front-end OMS and Kingdee Cloud Cosmos as the back-end ERP — typically small to mid-sized merchants. Not applicable: B2B bulk outbound, multi-level sales orders requiring approval flows, and scenarios where Kingdee has a custom document type (other than XSCKD01_SYS) — the latter requires redoing the document type and field mapping.