Sales Reissue Delivery Order Sync in Practice: A Deep Dive into a Single Strategy from Jky to Kingdee Cloud
What this strategy solves
In a retailer's supply chain integration scenario, the business side generates two types of sales delivery orders every day: regular shipping orders and reissue orders. The characteristic of a reissue order is "the order has shipped, the goods arrive later." Although its frequency is lower than regular orders, each document involves high amounts and high customer sensitivity—the warehouse picks by document, finance reconciles by document, and stores settle by document.
If these documents are entered manually across two systems, the common cost is: reissue documents lag 2–4 hours behind on the day of reissue, and reconciliation differences concentrate in the reissue category at month-end. Turning it into an automated sync strategy, the core value is "letting reissue documents appear in the target system on the nearest scheduling round after they occur," compressing reconciliation differences from batch-level to document-level.
We use the Qeasy data integration platform to host this single strategy, aiming to push reissue order data from the source system to the target system at the pace of business occurrence, achieving "a document on the source side, a document on the target side."
Data flow and field mapping
The whole chain is divided into three segments: source system (Jky) → Qeasy middleware → target system (Kingdee Cloud). The middleware handles code mapping, field conversion, archive lookup, and idempotency control.
Key field mapping:
| Business meaning | Source field | Middleware handling | Target field | Note |
|---|---|---|---|---|
| Sales order number | tradeNo | Pass-through | FBillNo | Idempotency key |
| Delivery time | consignTime | Pass-through | FDate | Required |
| Document type | Business identifier | Hard-coded | FBillTypeID | XSCKD07_SYS |
| Sales organization | shopCode | _findCollection lookup | FSaleOrgID | Lookup by store code |
| Customer | shopCode | Same lookup, different field | FCustomerID | Same source, different target |
One detail is worth expanding: both the sales organization and the customer start from the same shopCode and look up different fields in the same archive table. This is Qeasy's common "one lookup, dual-field consumption" pattern, avoiding two requests to the archive service.
How to configure on Qeasy
First, configure the source system interface. The source side uses a POST-type query interface with pagination parameters in the request body. The incremental start uses modified_begin / modified_end, the full-volume fallback uses startModified / endModified, and the two cannot both be empty. It is recommended to limit the incremental window to within 7 days—this is a hard constraint on the source system side; exceeding it will directly report an error.
Second, configure the target system interface. The target side uses the batch save interface batchSave, with the document type hard-coded. The document type code corresponding to the reissue order must be verified against the values in the customer's actual account set and cannot be copied verbatim.
Third, handle the archive lookup. Both FSaleOrgID and FCustomerID use the _findCollection expression, looking up the internal codes of the corresponding organization and customer by store code from the customer archive set. This step is the most error-prone part of the entire strategy; it will be discussed separately in the pitfall section.
Fourth, enable idempotency control. The source side uses tradeNo as the idempotency key, and the target side uses the id field for idempotency check, ensuring that the same reissue order will not be written repeatedly to the database across multiple scheduling rounds.
Implementation steps
We split the rollout into three phases to avoid turning on full-volume scheduling at the start and breaking the data.
Phase one: full-volume initialization. At the customer site, first use the "last modified time + manually specified window" method to trace back 7 days by day window and run a full-volume catch-up. In this phase, only observe and do not write to the production account set; first run the field mapping and archive lookup through in the test account set.
Phase two: incremental start switch. After full-volume is complete, switch the incremental start to the cutoff time of the first full-volume run. Set the scheduling frequency on the source side to "every 18 minutes" and the target-side write to "every 20 minutes." The two frequencies are deliberately staggered to prevent the target side from pulling the next round before the source side has finished writing the just-queried data to the intermediate table.
Phase three: stable operation observation. Run continuously for 3–5 business days, focusing on three metrics: missing document count (source has but target does not), archive lookup hit rate (the hit rate of _findCollection should be close to 100%), and idempotency hit ratio (under normal circumstances it should stabilize above 30%, meaning many documents are correctly deduplicated).
Pitfall review
Pitfall one: archive lookup expression missing filter conditions. During the first configuration, the _findCollection expression only wrote textField_l2iazxvw={{shopCode}} without limiting the organization scope, resulting in customers with the same name under multiple organizations being looked up, and the target side reporting "customer does not belong to this sales organization" when writing. The safe approach is: archive lookup must carry both organization and code as conditions.
Pitfall two: reissue document's modification time was manually changed. The customer manually adjusted the delivery time of a reissue order in the source system, causing the document's modification time to jump into the future interval, and incremental scheduling actually missed it. The typical mistake is trusting only the modification time, not the document status. The safe approach is: in addition to the incremental condition, add a business filter of "document status = shipped."
Pitfall three: wrong idempotency key. Initially the source system's internal tradeId was used as the idempotency key, but the result was that when the same reissue order was modified multiple times on the source side, tradeId remained unchanged while tradeNo changed, leading to duplicate documents on the target side. The safe approach is: use the business order number tradeNo as the idempotency key, not the internal ID.
Pitfall four: hard-coded document type inconsistent with the account set. The document type XSCKD07_SYS was copied from one account set and simply did not exist in the customer's private deployment, returning "invalid document type" on save. The safe approach is: before going live, use Qeasy's "archive probe" capability to enumerate all available document types in the current account set before hard-coding.
Pitfall five: scheduling frequency mismatch causing missed orders. The source side every 18 minutes, the target side every 20 minutes—seemingly reasonable staggering, but in actual operation it was found that: if a single source-side query takes more than 5 minutes, the target side's next round of scheduling will start before the source side has finished writing the intermediate table, reading stale data. The safe approach is: add a "source side's most recent successful execution" dependency condition to the target-side scheduling, and do not write if it has not succeeded.
Applicable and non-applicable scenarios
This strategy applies to: scenarios where reissue orders need to be synced in real-time or near-real-time to downstream finance and warehouse systems, and the source system supports incremental query by modification time and the target system supports batch save.
It does not apply to: scenarios where reissue documents require secondary business confirmation on the source side (such as finance review before pushing)—in this case, it is recommended to split into a two-step strategy, the first step pushes pending review and the second step pushes approved, rather than using a single strategy to hard-carry. It also does not apply to scenarios with extremely large document volumes (over 100,000 per day); such volumes require separate evaluation of pagination parameters and batch size, and direct reuse of this strategy is not recommended.