Transfer Order Sync in Practice: Consignment Transfer (Outbound) from Wangdiantong to Kingdee Cloud
What This Strategy Solves
A multi-warehouse retailer generates a large volume of transfer orders every day between stores and between consignment warehouses and self-operated warehouses. The source commerce ERP records the originating transfer, while the target finance-and-operations suite needs to derive the corresponding stock ledger and accounting documents from those transfers. It looks like a simple document hand-off, but small drifts in document type (direct transfer, consignment outbound, consignment inbound), transfer direction, organization, and warehouse mapping quickly break reconciliation. The core of this strategy is to land Wangdiantong transfer orders into Kingdee Cloud with correct business semantics, and to wrap incremental start, full re-trigger, and replay into an observable engineering pipeline.
Data Flow and Field Mapping
The data flow has three stages: Wangdiantong (source) → Qeasy Data Integration Platform (middleware) → Kingdee Cloud (target). The middleware owns the incremental watermark, deduplication, field mapping, and exception routing.
The source (Wangdiantong·Qimen) pulls transfer orders through wdt.stock.transfer.query over a time window. Key inputs include start_time, end_time, status (set to 90 for completed transfers), and type.
The target (Kingdee Cloud) writes the document through batchSave. Key inputs include FBillNo, FBillTypeID, FBizType, FTransferDirect, FTransferBizType, FSaleOrgId, and others.
Key field mapping (excerpt):
| Business Meaning | Wangdiantong Field | Kingdee Cloud Field | Handling |
|---|---|---|---|
| Document number | transfer_no | FBillNo | Direct mapping |
| Source warehouse code | from_warehouse_no | Used in FBillTypeID branch | JS ⇒ consignment outbound |
| Target warehouse code | to_warehouse_no | Used in FBillTypeID branch | JS ⇒ consignment inbound |
| Document type | implicit | FBillTypeID | Function expression on warehouse name |
| Business type | implicit | FBizType | Fixed to NORMAL |
| Transfer direction | implicit | FTransferDirect | Fixed to GENERAL |
| Transfer type | implicit | FTransferBizType | Fixed to ZJDB07_SYS |
| Sales organization | implicit | FSaleOrgId | Lookup from org mapping table |
A common pattern we follow is to keep warehouse-vs-document-type branching inside a single function expression at the middleware layer, instead of scattering it across fields. When warehouses are renamed or new consignment warehouses come online, only one place needs to change.
Configuring on Qeasy
On the Qeasy Data Integration Platform, the strategy lives under an integration-strategy node. The typical configuration steps are:
- Register the data sources: select Wangdiantong·Qimen as the source and Kingdee Cloud as the target, and bind the platform-managed credentials. Secrets are never stored in plaintext inside the strategy.
- Load metadata: load the request structures for
wdt.stock.transfer.queryandbatchSave. The platform auto-generates a drag-and-drop field tree. - Field mapping: drag source fields to target fields on the canvas. For computed fields such as FBillTypeID, use the embedded function editor with a
case when ... then ... endexpression. - Centralize code mappings: warehouse, organization, and item codes should live in a shared code-mapping table rather than being hard-coded into a single strategy. The same table can then be reused by sales-out, purchase-inbound, and other strategies.
- Validation and deduplication: enable document-number dedup using
transfer_noas the idempotency key. SetidCheck=trueon the target so duplicates are rejected before write. - Exception routing: split network timeouts, empty values, and over-length fields into separate alert channels so on-call engineers can see the failure category at a glance.
Implementation Steps
We recommend a three-phase rollout instead of running a full historical backfill from day one.
Phase 1: Align the incremental start
- Confirm the source timestamp is reliable, and initialize
start_timeto an explicit point (e.g. 00:00:00 on go-live day) so historical dirty data does not leak in. - Run a 1–2 hour smoke window to verify that the expected transfer statuses are returned.
Phase 2: Full re-trigger and backfill
- Manually trigger a full backfill covering a recent window (e.g. the last 30 days) on Qeasy, validating the mapping and target-side validation logic.
- After the backfill, switch the cron to incremental mode at
*/10 * * * *.
Phase 3: Schedule frequency and resilience
- During peak periods (e-commerce promotions, month-end closing), a 10-minute cadence is sufficient. Aggressively compressing it to one minute usually just hits source-side rate limits.
- Pair this with Qeasy's failed-retry and dead-letter queue so a single failure does not block subsequent batches, and consecutive failures automatically alert the on-call channel.
Lessons from the Field
- Loose status filtering: not passing
statusreturns every status, so drafts ("editing", "pending approval") also flow into Kingdee and trigger downstream reversals. We eventually pin the status to90(completed). Tightening the status filter is the safer default. - Inconsistent warehouse naming: the
JSsubstring check onfrom_warehouse_no/to_warehouse_nodecides the consignment branch, but real warehouse names are messy. We recommend maintaining an explicit business-type column in the mapping table instead of relying on string matching. - Drifting incremental watermark: while
start_time = LAST_SYNC_TIMEis correct, service restarts or timezone changes can rewind the watermark. Persist the timestamp on Qeasy and add a max-rewind protection. - Empty organization on the target: if
FSaleOrgIdis empty, Kingdee rejects the save. Always fill the organization at the mapping layer and add a non-null guard. - Wrong idempotency key: using
transfer_idas the idempotency key once caused duplicates because target-sidebatchSavededuplicates onFBillNo. Using the business document number as the idempotency key on both sides is the stable choice.
When to Use and When Not to Use
Use when: an e-commerce or chain retail business runs consignment-heavy stock transfers between Wangdiantong-class SaaS ERPs and Kingdee Cloud, the transfer status is clearly "completed", and 10-minute latency is acceptable.
Do not use when: you need sub-second intra-warehouse sync, a reverse direction (Kingdee → Wangdiantong), or cross-company transfers spanning multiple ledgers and organizations — those should be split into separate dedicated strategies.