Practical Tutorial: Syncing Wangdiantong Sales Outbound Orders to Kingdee Cloud (Store Dimension)
What This Strategy Solves
In one retail scenario, e-commerce orders are fulfilled in Wangdiantong, but finance and supply-chain analytics rely on Kingdee Cloud's sales outbound documents. We need to push Wangdiantong outbound orders into Kingdee on a store dimension, where they become the source documents for downstream accounting and inventory. The strategy looks like simple document transport, but the real pain is that outbound orders carry a header plus line items, and org/customer/item codes are completely different across the two systems. If mapping isn't designed well, you end up three months later wondering why the numbers don't match.
Data Flow and Field Mapping
The end-to-end flow is: Wangdiantong (source) → Qeasy intermediate layer → Kingdee Cloud (target).
The source calls wdt.stockout.order.query.trade (POST, QUERY), using start_time / end_time as the incremental window and order_no as the idempotency key. The target calls Kingdee's batchSave (POST, EXECUTE), using id as the idempotency key.
Key field mapping (typical):
| Business meaning | Wangdiantong (source) | Intermediate | Kingdee Cloud (target) |
|---|---|---|---|
| Document number | order_no | Pass through | FBillNo |
| Outbound time | consign_time | Format to yyyy-MM-dd HH:mm:ss | FDate |
| Store name | shop_name | Lookup in org map | FSaleOrgId (reverse lookup by FName) |
| Customer | shop_name | Reuse store as customer | FCustomerID |
| Document type | — | Constant | FBillTypeID (XSCKD01_SYS) |
Note FSaleOrgId uses _findCollection — a reverse lookup of store name → sales org code. This lookup is centrally maintained in Qeasy, so adding or removing stores later only requires a change in one place.
How to Configure on Qeasy
In the Qeasy data integration platform, create a new strategy: source = Wangdiantong·Qimen, target = Kingdee Cloud, business module = Sales Order Sync.
- Source configuration: Fill in the API and request fields. Set
start_timeto{{HOURE_AGO_3|datetime}}andend_timeto{{CURRENT_TIME|datetime}}. EnableidCheck=trueand useorder_nofor deduplication. - Intermediate mapping: Use the visual mapper to map source fields to target fields. Org and customer go through lookup tables, dates through format conversion, and constant fields are written directly.
- Target configuration: Choose
batchSaveas the target API, enableidCheck=truefor idempotency to avoid duplicate writes. - Runtime mode: For the source, recommend
buildModel=falseso fields are read dynamically from the source schema, reducing configuration churn when the source system adds new fields.
Implementation Steps
A three-phase rollout works well in practice:
- Phase 1 · Full initialization: Run a one-time script to push all outbound orders from the recent N days with status 95 / 110 (shipped / completed), validating mappings and code lookups.
- Phase 2 · Incremental start: Use the full-load cut-off time as
start_time. Poll increments every 15 minutes (*/15 * * * *) on the source and write every 20 minutes (*/20 * * * *) on the target. Source runs faster than target, leaving a processing buffer. - Phase 3 · Steady state: Monitor daily sync counts, failed retries, and idempotency hits. Gradually widen the status filter (e.g., include abnormal shipment status 113).
Recommended schedules: source */15, target */20. The offset avoids hammering both ends at the same second.
Pitfalls and Lessons Learned
- Store as customer: In Kingdee, the customer master is usually not the same as a store. Some projects maintain a separate "store customer" profile, with org and customer kept in two different lookup tables rather than collapsed into a single
shop_name. - Time zone and time format: It is easy to miss records near the second boundary. The safe approach is to add a 1-minute overlap on
end_timeand rely on intermediate-layer deduplication as a safety net. - Status filtering: When the source
statusis empty, the API returns everything. On the first run, always limit to 95 / 110; otherwise cancelled orders slip through too. - Idempotency key collisions: Kingdee's
FBillNois unique, so sourceorder_nomust be guaranteed non-duplicating. If the source system supports editing-then-repushing, use a composite key such asorder_no + consign_timefor deduplication. - Org mapping changes: When stores are opened, closed, or renamed, keep the lookup table centrally managed in Qeasy. Don't scatter it across multiple tables; otherwise three months later the numbers won't match and root-causing becomes extremely time-consuming.
When This Fits and When It Doesn't
Fits: Multi-store retail where e-commerce orders must enter financial accounting, and org / customer / item code mappings already exist on the Kingdee side.
Doesn't fit: Scenarios where Kingdee does not need a sales outbound document, or where Kingdee uses a different document type (e.g., transfer order) to receive the data. Also not yet suitable for complex multi-legal-entity, multi-book organizational structures.