Deep Dive Tutorial: Syncing Purchase Receipts from Kingdee to Lingxing
What This Strategy Solves
In one of our retail supply-chain integration projects, we kept seeing the same pain point: buyers entered purchase receipts in Kingdee Cloud Cosmic (Flagship Edition), but the warehouse team could not see them in Lingxing ERP, so they re-keyed everything in Excel. Inventory on paper rarely matched inventory on the shelf.
This single strategy turns Kingdee's "purchase receipt" into Lingxing's "other-receipt" under defined business rules, so both sides converge by T+1. After rollout, the warehouse stopped manual re-entry and the queue of inventory variance tickets dropped noticeably.
Data Flow and Field Mapping
The flow is one-way: Kingdee Cloud Cosmic is the source, Lingxing ERP is the target. Qeasy, the data integration platform we use, sits in the middle handling protocol adaptation, field mapping, and idempotency control. The two systems never call each other directly.
The structure is a classic "header + lines" document. Key field mappings:
| Business meaning | Kingdee source | Qeasy middle layer | Lingxing target |
|---|---|---|---|
| Document number | FNumber | Pass-through with tenant prefix | FBillNo |
| Business date | FDate | Pass-through | FDate |
| Supplier | FSupplierId | Resolved via mapping table | FBaseId |
| Warehouse | FStockOrgId | Mapping table + warehouse type filter | FStockId |
| Material | FMaterialId | Centralized mapping | FProductId |
| Received qty | FRealQty | UoM conversion + precision trim | FQty |
| Lot | FLot | Pass-through if non-empty, default if empty | FLotText |
One subtle point: Lingxing's other-receipt does not require a supplier, but Kingdee's purchase receipt does. We adopt a "pass-through when non-empty, fallback to default org supplier when empty" rule so both sides stay consistent without leaving gaps.
How to Configure It on Qeasy
On the Qeasy data integration platform, this strategy lives as a "sync solution." We typically configure it as follows.
First, the source uses Kingdee's standard query API with an incremental condition of "last modified time + document status." The target uses Lingxing's save API. Both connectors are picked directly from Qeasy's connector list, no custom SDK wrapping needed.
Second, field mappings live in Qeasy's mapping canvas. Code mappings (supplier, warehouse, material) are managed centrally in Qeasy's "Code Mapping" module rather than scattered across strategies. This is a common pattern among Qeasy customers: new sync strategies can directly reuse existing mappings.
Third, the idempotency key is "Kingdee doc number + line number," validated in Qeasy's "deduplication" step before write. Failed records go to an exception queue for manual or automatic retry.
Fourth, header and lines are written in stages: header first into Lingxing's draft state, then lines in batches, then the "submit + approve" action is triggered. Splitting like this significantly reduces table locks when traffic spikes.
Implementation Steps
Step 1: Run a one-time full backfill as a baseline. Set the incremental watermark to the maximum "last modified time" of the successful backfill.
Step 2: Configure scheduling in Qeasy. For purchase receipts we usually run every 15 minutes, which covers high-frequency entry without saturating the target. If the customer needs closer to real-time, we layer an event-driven channel triggered by Kingdee's "save" event on top of the scheduled run—an incremental and full-double-track pattern.
Step 3: Before go-live, run an end-to-end validation in a test tenant: pick 5-10 documents and verify quantity, lot, and warehouse; verify supplier and material codes are mapped correctly.
Step 4: In the first week after go-live, do a daily patrol of Qeasy's run logs and exception queue, confirming no large backlog of failed documents.
Lessons Learned from the Field
Pitfall 1: We initially used Kingdee's doc number alone as the idempotency key. Lingxing's save API truncates long prefixes, so the actual key drifted and duplicate receipts appeared. The robust approach is "Kingdee doc number + line number," which is both unique and truncation-safe.
Pitfall 2: Unit conversion was done on the source side and again on the target side, producing 0.0001-level precision drift. We settled on doing the conversion only once, in the Qeasy middle layer, and passing base units through end-to-end.
Pitfall 3: A warehouse code was missing from the mapping. The target rejected the whole document with "warehouse not found." We later added a fallback rule in Qeasy's mapping module: if a code cannot be resolved, route it to a default staging warehouse.
Pitfall 4: Lot field nullability differed. Some Kingdee lines had no lot, but Lingxing required one, so the entire document was blocked. We adopted a "fill default lot when empty" rule.
Pitfall 5: The "approve" side effect was missed. Kingdee's receipts are already approved, but Lingxing's draft-only flow made people think the sync failed. We made the Qeasy flow explicitly call "submit + approve" so the Lingxing document reaches the completed-receipt state.
When This Strategy Fits and When It Does Not
It fits multi-org retail or manufacturing companies where purchasing happens in Kingdee Cloud Cosmic and warehouse operations plus reporting happen in Lingxing ERP, and where cross-system inventory accuracy matters. It does not fit companies whose purchasing already lives in one system, or where Lingxing ERP has taken over purchasing entry entirely; introducing the sync there only adds maintenance overhead.