Inventory Calibration in Practice: Syncing Kingdee Cloud Stock Positions to Wangdian Tong·Qimen
What This Strategy Solves
In retail and distribution, position-level stock numbers drive allocation, shipping, and reconciliation. When Kingdee Cloud stock drifts away from Wangdian Tong·Qimen, the front end starts overselling, running out, or assigning the wrong position. The strategy we dissect here—"Inventory Calibration – Kingdee with Stock Positions – 1"—periodically pushes Kingdee Cloud's warehouse-and-material inventory into Wangdian Tong·Qimen, where it is used to build stocktaking documents or align on-hand quantity. It sits at sequence=B in the broader supply-chain pipeline and only becomes stable once sequence=A (material master sync) is in place.
Data Flow and Field Mapping
The flow is B (Kingdee Cloud) → middleware (Qeasy Data Integration Platform) → A (Wangdian Tong·Qimen). The source uses executeBillQuery to read the inventory view; the target calls wdt.stock.sync.by.pd to create stocktaking documents. Key field mappings:
| Meaning | Kingdee Cloud (source) | Wangdian Tong·Qimen (target) | Notes |
|---|---|---|---|
| Warehouse | FStockId / FStockId_FNumber | warehouse_no | Resolve FStockId to code before sending |
| Material | FMaterialId / FMaterialId_FNumber | spec_no (typical) | Depends on sequence=A material sync |
| On-hand | FBaseQty | qty | Use base-unit quantity |
| Available | FBaseAVBQty | reference field | Used to decide whether to trigger |
| Lot | FLot | lot_no | Required when lot-managed |
In practice, warehouse and material codes never line up by themselves—you depend on the code table produced by the previous stage.
How to Configure It on Qeasy
Create the "Inventory Calibration – Kingdee with Stock Positions – 1" strategy in Qeasy Data Integration Platform and configure as follows:
- Source connection: Choose Kingdee Cloud, configure the private-deployment credentials and IP whitelist; note that
executeBillQueryuses POST. - Target connection: Choose Wangdian Tong·Qimen, select
wdt.stock.sync.by.pd, and turn onidCheck=truefor idempotency. - Field mapping: Bind
FStockId_FNumberandFMaterialId_FNumbervia template variables intowarehouse_noandspec_no; setmode=1for position-level counting. - Centralized code mapping: Maintain warehouse and material code mappings in Qeasy's mapping table rather than scattering them across strategies—this is one of the patterns we have applied on customer projects.
- Strict mode and audit:
is_check=1enables auto-audit;is_post_errorcontrols strict mode—one missing spec_no fails the whole document. - Idempotency key: Use
api_outer_noas the external document number so retries do not produce duplicate stocktaking documents. - Exception handling: Turn on Qeasy's alert channel for 4xx/5xx errors with automatic retry and manual intervention hooks.
Implementation Steps
- Phase 1: Baseline. On the go-live day, run a full pull once to push every position-level stock record from Kingdee Cloud into Wangdian Tong·Qimen as the baseline.
- Phase 2: Staggered scheduling. Source crontab
*/5 * * * *, target1-59/5 * * * *. Stagger the two ends by 1–4 minutes to avoid resource contention. - Phase 3: Frequency tuning. Keep 5-minute intervals for the first two weeks while you observe stability, then move to 10–15 minutes based on peak/valley patterns.
- Phase 4: Monitoring and reconciliation. Configure a reconciliation dashboard in Qeasy that compares FBaseQty with successfully pushed qty; alert when the gap exceeds a threshold.
- Phase 5: Incremental plus full reload. Run incremental in daily operations, but trigger a full reload when new lots arrive or operators request it—this is the second common pattern we use for Qeasy customers.
Pitfall Recap
- Material master not yet synced. If sequence=A's "cp_KQM Material Sync" is not stable when you start pushing inventory, every spec_no fails and the whole document is rejected. A must come before B.
- Sending FStockId directly. Kingdee's FStockId is a numeric primary key; Wangdian Tong·Qimen expects a code string. Translate it in the mapping layer, otherwise warehouses end up created incorrectly.
- Missing lot info. In position+lot inventory scenarios, sending availability as on-hand when
FLotis empty produces the "total matches, lots don't" mystery. - Strict mode flipped on too early. Starting with
is_post_error=1causes the entire stocktaking document to fail whenever a single new material appears, delaying a lot of inventory data. Stabilize on non-strict mode first, then flip. - Duplicate pushes create dirty documents. If
api_outer_nois empty or random, Qeasy's retry mechanism will spawn multiple stocktaking documents on the Wangdian Tong side. A stable composite key (source ID + warehouse + material) is the safe pattern.
When to Use and When Not to
Use this when Kingdee Cloud is the inventory source of truth and Wangdian Tong·Qimen is the front-end fulfillment system, in mid-to-large retail or distribution businesses with stable warehouse positions and an established material mapping. Do not use it when: material master data is not yet synced, Kingdee has no position dimension, you need sub-second real-time inventory (use a message queue instead of polling), or warehouse positions change too frequently.