Qeasy Cloud
Get Started

Transfer Order Sync in Practice: Consignment Transfer (Outbound) from Wangdiantong to Kingdee Cloud

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

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 MeaningWangdiantong FieldKingdee Cloud FieldHandling
Document numbertransfer_noFBillNoDirect mapping
Source warehouse codefrom_warehouse_noUsed in FBillTypeID branchJS ⇒ consignment outbound
Target warehouse codeto_warehouse_noUsed in FBillTypeID branchJS ⇒ consignment inbound
Document typeimplicitFBillTypeIDFunction expression on warehouse name
Business typeimplicitFBizTypeFixed to NORMAL
Transfer directionimplicitFTransferDirectFixed to GENERAL
Transfer typeimplicitFTransferBizTypeFixed to ZJDB07_SYS
Sales organizationimplicitFSaleOrgIdLookup 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:

  1. 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.
  2. Load metadata: load the request structures for wdt.stock.transfer.query and batchSave. The platform auto-generates a drag-and-drop field tree.
  3. 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 ... end expression.
  4. 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.
  5. Validation and deduplication: enable document-number dedup using transfer_no as the idempotency key. Set idCheck=true on the target so duplicates are rejected before write.
  6. 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_time to 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

  1. Loose status filtering: not passing status returns every status, so drafts ("editing", "pending approval") also flow into Kingdee and trigger downstream reversals. We eventually pin the status to 90 (completed). Tightening the status filter is the safer default.
  2. Inconsistent warehouse naming: the JS substring check on from_warehouse_no/to_warehouse_no decides 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.
  3. Drifting incremental watermark: while start_time = LAST_SYNC_TIME is correct, service restarts or timezone changes can rewind the watermark. Persist the timestamp on Qeasy and add a max-rewind protection.
  4. Empty organization on the target: if FSaleOrgId is empty, Kingdee rejects the save. Always fill the organization at the mapping layer and add a non-null guard.
  5. Wrong idempotency key: using transfer_id as the idempotency key once caused duplicates because target-side batchSave deduplicates on FBillNo. 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.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-kingdee-cloud-1956-js-898c7b62

Comments