Qeasy Cloud
Get Started

From Kingdee Inventory Profit to Wangdiantong Other Inbound: A Practical Breakdown of One Inventory Sync Strategy

· 谢锴斌· Integration Solutions· 11 views· 4 min read
WDTKingdee CloudInventory Sync供应链集成盘盈单轻易云

What This Strategy Solves

Inventory profit is a typical stock adjustment that occurs when physical count exceeds book quantity after a stocktake. In one of our retail projects, Kingdee Cosmic handled finance and inventory ledger, while Wangdiantong ran the front-end warehouse and store-side logistics. Profit documents were only generated on the Kingdee side. Without syncing them to Wangdiantong, the front-end warehouse could not register the extra physical stock into available inventory, which then blocked outbound picking, transfers, and replenishment. We used the Qeasy Data Integration Platform to bridge this gap, pushing Kingdee inventory profit documents to Wangdiantong's other-inbound documents following defined rules, keeping books and physical stock aligned and avoiding duplicate entry across both systems.

Data Flow and Field Mapping

The overall flow is B (Kingdee Cosmic) → Qeasy middleware layer → A (Wangdiantong). Headers and line items of profit documents are extracted from Kingdee, then cleaned, mapped, and validated before being written as Wangdiantong other-inbound documents.

Key field mapping reference:

Business meaningKingdee Cosmic (source)Qeasy middlewareWangdiantong (target)
Document numberFBillNosrc_bill_noexternal_bill_no
Document dateBusiness datebiz_dateorder_time
WarehouseReceiving warehousewh_code (warehouse mapping)warehouse_no
SKU codeMaterial codesku_code (item mapping)spec_no
QuantityActual count qtyqtynum
Batch / remarkRemarkremarkremark
Document typeInventory profitfixed_type = profittype = other_inbound

Two mappings are maintained centrally: warehouse code mapping and item code mapping. When the retail customer went live, both mappings were managed uniformly in Qeasy, so business changes only require a single update rather than touching every integration task.

How to Configure on Qeasy

First, the source side calls Kingdee Cosmic's inventory profit document query interface. The extraction filter is "audit status = audited AND document date >= incremental cursor", so only deltas are pulled, with no duplicates and no gaps.

Second, the middleware layer performs three jobs: field mapping and code conversion per the target system's requirements, splitting payloads into target-acceptable batch sizes to avoid timeouts, and pre-write field validation such as warehouse code exists in the mapping table and SKU code is valid.

Third, the target side calls Wangdiantong's other-inbound document creation interface, using the source Kingdee document number as the external bill number, which makes reverse lookup and reconciliation straightforward.

Fourth, configure exception branches in Qeasy: if the target creation fails, route the document to a manual queue or retry queue; persist the source cursor so that resume-from-breakpoint does not lose any document.

Implementation Steps

Roll out in three phases for stability.

Phase 1 — Set the incremental cursor. Use 23:59:59 of the day before go-live as the initial cursor, then run a small-batch trial push to confirm that documents and inventory flow are consistent on both sides.

Phase 2 — Full-volume replay and reconciliation. After the trial passes, replay historical profit documents by date in batches, comparing inventory balance changes on both systems batch by batch. Once full replay completes, switch to normal operation mode.

Phase 3 — Schedule frequency. In production, use a 15-minute incremental polling interval; during business low peaks, this can be relaxed to 30 minutes. Qeasy's scheduler uses cron expressions, and the source cursor advances based on the last successful timestamp. Header and line items are processed in stages: write the header first, get the target document number, then write the line items and submit. This way, if line-item writing fails, no half-baked document is left behind.

Lessons Learned

First, putting code mapping inside every task means each change ripples through the whole chain. The stable approach is to push warehouse and item mappings down into Qeasy's shared mapping table so all related strategies reuse the same definitions. The retail customer later treated this table as part of master data, synced to the business side.

Second, pushing the whole document in one shot and resubmitting the entire document on failure. A typical mistake is leaving a target document with a header but no line items. Recommended approach: commit header and line items in stages, and make failure re-entrant to avoid dirty data.

Third, sharing the same pipeline between incremental and full-volume. A typical mistake is replaying already-synced documents during full replay, which produces duplicate other-inbound documents in Wangdiantong. Recommended approach: use separate channels for incremental and full-volume; rely on src_bill_no on the target side for idempotency; merge the channels after full replay completes.

Fourth, when stocktake periods cross months, it is easy to push documents back into already-closed periods. The safe approach is to add a filter condition such as "document date <= last day of the current month AND business status = audited", and add a period check in Qeasy to protect closed-period data from being overwritten.

Fifth, Wangdiantong has length limits on the external bill number field, so passing the Kingdee source number directly may be truncated. Recommended approach: generate a short code in the Qeasy middleware that preserves traceability and fits the target field length.

Applicable and Non-applicable Scenarios

Applicable: cross-system inventory adjustment sync, such as inventory profit, inventory loss, transfer-inbound, and gain/loss adjustment, where document volume is moderate, the source is singular, and the target requires ledger entries or affects available inventory. Non-applicable: high-frequency real-time inventory queries (use a real-time inventory API instead), inter-company internal transfers (use inter-company settlement processes), and scenarios requiring secondary approval on the target system.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-kingdee-cloud-0874-ok-481f98bd

Comments