Qeasy Cloud
Get Started

Delivery Note Sync from Xiekeyun to MeiYun ZhiShu — A Qeasy Strategy Deep Dive

· 钟家寿· Integration Solutions· 9 views· 5 min read

What This Strategy Solves

A retail enterprise uses Xiekeyun for store-level delivery collaboration, while the back-end ERP/manufacturing execution side runs on MeiYun ZhiShu to manage delivery notes centrally. Both systems need delivery records, but the business action originates only in Xiekeyun. The goal is simple: once a delivery note is finalized in Xiekeyun, push it to MeiYun ZhiShu so that finance and warehousing stop reconciling between two systems.

In the Qeasy data integration platform, this pattern of "fetch detail by document number, then push" is one of the most classic A→B sync strategies, well suited as an enterprise integration backbone.

Data Flow and Field Mapping

The chain has three segments: source system (Xiekeyun) → middleware (Qeasy) → target system (MeiYun ZhiShu).

The source side is a query-style WebAPI: the delivery note detail endpoint, POST method. The request body carries two key parameters: erpCode identifying which business entity the data belongs to, and deliveryNo — the delivery document number. The response includes fields the downstream actually consumes: document number, vendor code, vendor name, delivery date, status, remarks, plus line-item details.

The target side is an execute-style WebAPI: the delivery note add/update endpoint, also POST. It expects a full delivery view — header fields such as deliveryNo, innerVendorCode, innerVendorName, deliveryDate (int timestamp), status, remark, and the line items.

The middleware in Qeasy reorganizes the flat source fields according to the target contract. Below is the field mapping table we refined on a real project:

Business meaningSource field (Xiekeyun)Target field (MeiYun ZhiShu)Handling notes
Business entityerpCodewritten into request contextcarried via platform variable, not as a raw payload field
Delivery numberdeliveryNodeliveryNoprimary key, basis for idempotency
Vendor codevendorCodeinnerVendorCodecentrally managed code mapping, see below
Vendor namevendorNameinnerVendorNamefollows code mapping, no hard-coding
Delivery datedeliveryDatedeliveryDatesource is string, target is int, unify to timestamp
Document statusstatusstatuspass through; enum values must be agreed on both sides
Remarksremarkremarkpass through
Line itemsdetails[]items[]header and body processed in stages, see pitfalls

How to Configure It in Qeasy

We assemble this on Qeasy's strategy canvas with three core nodes: source query, field mapper, target executor.

1. Source — Query WebAPI node

  • Pick the delivery detail endpoint, effect = QUERY.
  • Method = POST. Set erpCode as a constant and deliveryNo as a variable injected by the upstream strategy or trigger.
  • Turn on "auto-fill response" so every returned field is brought into the strategy; trim later as needed. This avoids downstream errors caused by missing fields.

2. Field mapper

  • Centralized code mapping: cross-system semantic fields such as vendor code and unit code are most prone to breaking — keep them in Qeasy's mapping set, not scattered across strategies. A common pattern we see is "central mapping + strategy reference," so onboarding a new vendor means editing one place.
  • Date and timestamp: if the source emits a string date, write an expression in the mapper to convert it to an int second-level timestamp for the target.
  • Header and body in stages: build the header first, then loop the body. Body-level fields such as material code, unit, price, and quantity live in a sub-mapper for easy maintenance.

3. Target — Execute WebAPI node

  • Pick the delivery note add/update endpoint, effect = EXECUTE.
  • Assemble the request body per the target contract; use the deliveryNo primary key as the idempotency key.
  • Failure retry and alerts: in Qeasy, wire the "write failed" event to a retry queue plus DingTalk/WeCom alerts. This is one of the biggest time savers in enterprise integrations.

Implementation Steps

We roll out in three phases.

Step 1 — Incremental seed: make one record work. Pick a real delivery note and manually trigger the strategy in Qeasy. Confirm the source returns data, the mapping has no missing fields, and the target accepts the write. This baseline anchors everything that follows.

Step 2 — Full backfill: replay history. If historical delivery notes must also be brought over, temporarily switch this strategy to full mode and replay by document number. A common pattern is the "dual-track" approach: full sync runs as a one-shot task and is shut down once complete; incremental sync runs on its own schedule to avoid interference.

Step 3 — Schedule cadence: lock the rhythm. Don't schedule the source strategy too aggressively. A typical pattern is to have an upstream list strategy scan for changed document numbers at a fixed cadence (e.g., every few minutes), then feed those numbers into this detail sync strategy. The target execution cadence depends on volume — in this case, a reference configuration of once every 3 minutes during the daytime working window, with reduced frequency or paused overnight.

Pitfalls and Lessons

Pitfall 1 — Code mapping embedded in the strategy, forgotten three months later. The classic mistake is hard-coding vendor and unit mappings inside one strategy's field map; by the fourth business unit going live, everything falls apart. The safe pattern is keeping all cross-system code mappings in Qeasy's mapping set and only referencing them from strategies.

Pitfall 2 — Inconsistent date types get you paged at midnight. The source returns "2025-01-15 10:30:00," the target wants a 10-digit timestamp. The first strategy forgot the conversion; data wrote successfully but downstream reports came back full of NULLs. Recommendation: add a fixed "date normalization" expression in the mapper so every date goes through one transformation.

Pitfall 3 — Header succeeds, body rows are dropped. The target contract expects the body as an array, but the mapper didn't use a loop node correctly, so the header landed while only one body row was written. A common remediation is to separate header and body processing — body lives in its own sub-mapper and is expanded row-by-row inside the loop context.

Pitfall 4 — No idempotency key, duplicates turn into dirty data. On a network hiccup, the same note got pushed twice. The target did not upsert on deliveryNo, so an extra row appeared. The safe approach is to mark deliveryNo explicitly as the idempotency key on the target node and enable "skip duplicates on re-write" in Qeasy.

Pitfall 5 — Schedule too aggressive, source rate-limited. The detail endpoint is query-style and rate-limited. We once saw a strategy running every 30 seconds and tripping the source's QPS limit. The safe pattern is to let a list strategy perform "document-number convergence" first, then trigger the detail strategy only on changes — frequency naturally drops.

When to Use, When Not to Use

Use it when: both systems carry delivery notes, sync must be real-time or near-real-time by document number, reconciliation rules are strict, and the deployment is on a private environment.

Do not use it when: business volume demands streaming, the source can only provide change-event streams (no per-number query capability), or the target contract changes frequently without versioning.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-pde37f0-pd690b8-9568-n2e0d0366-61f3e15c

Comments