Syncing Kingdee Inventory Surplus to Wangdiantong Subcontract Inbound: Hands-on Configuration and Pitfall Review
What This Strategy Solves
After a stocktake, a retail enterprise generates several surplus documents in its ERP. These need to be pushed the same day to a specific cloud warehouse as subcontract inbound orders, so the warehouse can put stock away promptly and keep books aligned with reality. If the sync is slow, the warehouse accepts orders against stale inventory and discrepancies pile up; if it goes wrong, duplicate inbound entries appear. This strategy turns "surplus → subcontract inbound" into a traceable, re-runnable pipeline.
Data Flow and Field Mapping
The flow is unidirectional: the source ERP pushes to the middleware, which translates and validates only, and finally writes to the target warehouse platform. No business master data is persisted in the middleware.
Key field mapping:
| Business meaning | Source ERP | Middleware handling | Target warehouse platform |
|---|---|---|---|
| Document number | Document No. | Pass-through | External order No. |
| Warehouse | Receiving warehouse code | Translated via warehouse mapping | Warehouse code |
| Owner type | Owner dimension | Fixed value "subcontract" | Owner type |
| SKU | Material code | Translated via SKU mapping | Product code |
| Quantity | Actual counted qty | Only rows > 0 are sent | Inbound qty |
| Unit price | Standard cost | Default fallback | Unit price |
| Batch / production date | Batch No., production date | Concatenated | Batch remark |
| Creator | Creator code | Fixed to integration account | Operator |
Two fields are especially prone to mismatch: warehouse code and SKU. We keep both mapping tables in a centralized mapping module of Qeasy rather than hard-coding them in scripts.
How to Configure in Qeasy
In Qeasy Data Integration Platform, create a new sync strategy: source as the ERP, target as the warehouse platform, strategy type SYNC.
Three configuration points matter:
First, the source uses the ERP query API with filters: document type equals surplus, audit status equals audited, pulled incrementally by last-modified timestamp.
Second, the middleware performs three steps: call the code mapping to translate warehouse and SKU, use a JS expression to filter out rows with quantity ≤ 0, and unify the creator to the integration account.
Third, the target uses the warehouse platform's subcontract inbound create API. The idempotency key concatenates external document number with line number, so reruns update rather than duplicate.
Implementation Steps
On go-live day, we recommend a three-step rollout instead of flipping everything at once.
Step one: trigger a full load to flush all audited-but-not-pushed surplus documents once; run only the same-day backlog without enabling scheduling.
Step two: once the full load is verified clean, enable incremental scheduling, polling every 15 minutes by last-modified timestamp. Record the incremental watermark clearly in the strategy notes so it is not mistaken for "missing data" later.
Step three: split header and line processing into two phases; headers are committed first, lines are appended asynchronously. This avoids dirty states like "only some lines are inbound" when the target system occasionally times out.
Keep a three-day observation window. Spend the first two days only reading logs, and fine-tune mappings on day three based on the target system's acknowledgements.
Pitfall Review
First, a classic mistake is passing the source SKU code directly to the target. Because the two systems use different coding rules, errors appear on day one. The safe approach is to keep all mapping tables in Qeasy's centralized mapping module, so adding a new SKU means changing only one place.
Second, zero-quantity lines are pushed along with the rest. Surplus documents sometimes contain zero lines; without an explicit filter, the target writes an empty entry. A simple "greater than zero" check in the middleware is mandatory.
Third, the idempotency key is too simple — just the document number. When the downstream replays, it recreates an already-inbounded order. Switching to "document number + line number" stabilizes the flow.
Fourth, the target system occasionally returns a timeout but actually writes the record. If the integration treats timeout as failure, it keeps retrying. In Qeasy, we mark such acknowledgements as "soft success": log them without retrying.
Fifth, the incremental watermark is not recorded clearly, and three months later an audit finds a missing week of surplus documents. Always write the first incremental timestamp into the strategy description and reconcile periodically with the source system.
When to Use and When Not to
Use it for: discrepancy documents (surplus, shortage, transfer) that need real-time sync to the front warehouse, where book-to-physical consistency is critical.
Do not use it for: cross-entity or cross-tax-id complex transfers, or scenarios where the cost must first be settled in the ERP. In those cases, generate an intermediate document in the ERP first, then use a generic sync strategy.