Qeasy Cloud
Get Started

Purchase Order Sync in Practice: An End-to-End Integration from Kingdee Cloud Cosmic to DingTalk

· 王浩宇· Integration Solutions· 5 views· 4 min read

What This Strategy Solves

For one manufacturing client, purchase orders were split across the ERP and a mobile approval app: business users issued orders in Kingdee Cloud Cosmic, while supplier-related information needed to reach and be approved quickly on DingTalk. Relying on staff to copy document numbers into group chats, four orders were missed in just three days. We used the Qeasy data integration platform to push purchase orders from the source system to the target system. The core value is threefold: real-time consistency of document status, precise delivery of approval notifications, and centralized maintenance of code mappings to reduce data drift between the two sides.

Data Flow and Field Mapping

The full chain is: Kingdee Cloud Cosmic (source) → Qeasy Integration Platform (middle layer) → DingTalk (target). The middle layer handles field cleansing, code mapping, and status tagging.

Business MeaningSource Field (Example)Middle Layer StandardizationTarget Field (Example)
Order NumberFBillNopo_bill_noDocument Number
Supplier CodeFSupplierIdsupplier_codeSupplier Code
Order DateFDateorder_dateDate
Order AmountFAllAmounttotal_amountAmount
Approval StatusFDocumentStatusapproval_status (0/1/2/3)Approval Result
Line ItemFPOOrderEntry.FMaterialIditem_codeMaterial Code
QuantityFPOOrderEntry.FQtyqtyQuantity

Note: The source status field is often a localized character enum. It must be converted to a unified code in the middle layer before being pushed to the target; otherwise, DingTalk approval callbacks cannot match. This is a typical scenario for centralized code mapping management.

How to Configure on Qeasy

In the Qeasy data integration platform, this strategy corresponds to a "Purchase Order ==> Kingdee—DingTalk" synchronization solution. Focus on four points during configuration:

  1. Source data extraction: Use Kingdee Cloud Cosmic's purchase order interface. Set the filter condition to "Audit Date >= Last Sync Time" to avoid re-fetching history every time.
  2. Middle layer mapping: In Qeasy's field mapping canvas, drag source fields to target fields. Use the "Lookup Table" component for one-to-one enum mapping instead of hardcoding in scripts — future maintenance only requires editing one table.
  3. Target system write: On the DingTalk side, use the approval flow template. Fill in "Document Number", "Amount", and "Line Items" as form fields. Approvers write back status through a callback URL.
  4. Exception handling: Qeasy's "Error Queue" classifies by business code. Field overflow, missing code, and illegal status each go through a separate manual compensation channel rather than piling up into a single alert.

Implementation Steps

We split this strategy into three-phase scheduling, which ran smoothly at the client site:

Phase 1: Incremental starting point initialization. Perform a one-time full pull of audited orders from the past three months, and land a baseline dataset in the middle layer as the comparison anchor for subsequent increments. This step only runs during initial go-live, then switches to incremental mode.

Phase 2: Incremental polling scheduling. Configure the Qeasy scheduler to trigger every 5 minutes. The source system fetches data using the condition "Last Modified Time > Last Cursor". The cursor is stored in Qeasy's strategy state table, with zero drift across instances.

Phase 3: Exception and retry. Orders that fail to write to DingTalk enter the retry queue and are pushed again after 15 minutes. After three failures, the case is escalated to manual handling. This safety net is mandatory; otherwise, missed approval messages are hard to trace.

Lessons Learned

Pitfall 1: Cursor based on "Audit Date" instead of "Last Modified Time". In one case, an order was rejected and resubmitted. The audit date did not change, but the content did, so the target system did not see the update. The safe approach is to select "Last Modified Time" as the cursor field and perform a content hash comparison in the middle layer so that only real changes are pushed.

Pitfall 2: Pushing header and lines in one go. DingTalk approval templates are sensitive to line item count; anything beyond 20 lines gets truncated. We later switched to a two-stage approach: "header first, lines in paged follow-up". Approval messages arrive within seconds, and details are filled in shortly after — staged pushing is critical in long-line scenarios.

Pitfall 3: Using ERP internal ID directly as supplier code. DingTalk's supplier records use a different system. Mismatched IDs trigger "supplier not found" errors. Maintain an "ERP ID ↔ DingTalk Record ID" mapping table in Qeasy's lookup component, so all encoding issues are resolved in one place.

Pitfall 4: No signature whitelist on the DingTalk callback URL. Early on, approval results were forged by external requests. We later enforced signature and timestamp verification at Qeasy's callback entry point, which eliminated the problem at the root.

Pitfall 5: Full and incremental sync sharing the same channel. The first full sync of tens of thousands of orders flooded directly into DingTalk, triggering an approval notification storm. We later added a "dual-track for full and incremental" mechanism: full sync uses silent writes (only lands in the target database without triggering approval notifications), while incremental sync uses the notification channel. The two queues are isolated from each other.

Applicable and Non-Applicable Scenarios

Applicable: Mid-sized enterprises where purchase orders need to be pushed from ERP to mobile approval with high notification demands; businesses with daily orders under a thousand and stable fields. Not applicable: Complex approval flows across multiple organizations and account sets; scenarios requiring bidirectional real-time write-back with end-to-end latency below seconds. The latter is better served by direct API connections rather than middle-layer synchronization.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-kingdee-cloud-dingtalk-9407-n82b7c5c4-bf9dc289

Comments