Qeasy Cloud
Get Started

Material Master Data Sync in Practice: Implementing a Query Strategy from Jky to Kingdee Cloud

· 冯潇· Integration Solutions· 23 views· 4 min read
吉客云Kingdee Cloud物料同步供应链集成Incremental Sync轻易云

What This Strategy Solves

In a supply chain integration project for a retail enterprise, we often see a very common requirement: the front-end business system (such as an e-commerce or order management platform) holds the operational view of material master data, while the back-end financial and supply chain system (such as an enterprise resource planning suite) holds the official record. If maintained manually, the material codes, units of measure, and categories in both systems begin to drift within three months, and purchasing, inventory, and accounting all fall out of sync. This strategy does only one thing: it pulls material master records from the source platform paginated by creation time, performs a lightweight transformation in the Qeasy (轻易云) integration platform, and then batch-writes them into the target platform. It does not handle sales orders or inventory; it stabilizes only the master data layer.

Data Flow and Field Mapping

The overall flow is unidirectional: Source platform → Qeasy middle layer → Target platform.

On the source side, we call a WebAPI named erp.storage.goodslist, using POST, with the effect set to QUERY. Five fields in the request body are the key to this synchronization:

Source FieldMeaningValue Source
pageIndexPage indexStarts from 0, increments by 1 each round
pageSizePage sizeFixed at 100
startDateModifiedGoodsStart time of creation window`{{LAST_SYNC_TIME
endDateModifiedGoodsEnd time of creation window`{{CURRENT_TIME
isPackageGoodWhether it is a bundle/kitFixed at 0; bundles are excluded

The target side uses batchSave on the target platform, POST, with the effect set to EXECUTE, and idCheck enabled. This means the platform performs uniqueness validation on the code when writing; duplicate codes are rejected directly. This dictates that we must lock down the code mapping rules in the middle layer before writing.

The Qeasy middle layer does three things: maps the source goodsNo to the target material code; maintains a lookup table for units of measure, categories, and specifications; and sets aside bundles (isPackageGood=1) to be handled by a separate strategy rather than this one.

How to Configure on Qeasy

In Qeasy (轻易云), this strategy is typically configured as a pair: a source query scheme plus a target execution scheme.

Source-side essentials: type=WebAPI, effect=QUERY, method=POST are fixed; both number and id are set to goodsNo, because the source platform does not have a dedicated primary-key field—the business key is the material code; idCheck is disabled and autoFillResponse is enabled, so the platform automatically fills the response into the dataset.

Target-side essentials: api=batchSave, idCheck must be enabled; both number and id are set to 0, because the target platform's batch save API does not rely on externally transmitted codes and generates its own identifiers internally.

Scheduling configuration: the source crontab is */15 * * * *, running once every 15 minutes; the target placeholder is 1 1 1 1 1, but in practice it is driven by the chain triggered from the source and does not run independently.

Implementation Steps

Phase 1: Align the incremental starting point. First, confirm the baseline for startDateModifiedGoods. A common practice is to take "the last 30 days" as the time window for the initial full sync, to avoid pulling a full dump all at once and overwhelming the target system. On the very first run, LAST_SYNC_TIME is set to the current time minus 30 days.

Phase 2: Trigger the full sync. After the first full run completes, switch the window to normal operation: every 15 minutes, pull an incremental batch from LAST_SYNC_TIME to CURRENT_TIME. At the same time, configure a one-off "catch-up" task in Qeasy to backfill historical data.

Phase 3: Adjust the schedule frequency. Keep a 15-minute cadence during daytime business peaks, and relax to once per hour at night, but always keep a fallback full-sync strategy running once a week on Sunday early morning to catch any missed records.

Lessons from the Field

1. Crossing time window boundaries. The boundaries between startDateModifiedGoods and endDateModifiedGoods are where things most often go wrong: if the current time is 14:55 and the window ends at 14:56, the next round starts from 14:56 and may miss a material created at 14:55:30. The safe approach is to overlap the window by 1–2 minutes.

2. Bundles being pulled in by mistake. The isPackageGood=0 filter must be hard-coded. We have been bitten by this before: the parent and child codes of bundles follow different logic, and writing them directly into the target system triggers validation failures, taking half a day to troubleshoot.

3. idCheck not enabled. When idCheck is disabled on the target's batchSave, the platform does not validate code uniqueness, and duplicate materials can quietly slip into the database. We only noticed this during a later inventory reconciliation, and cleaning up the duplicates was very painful.

4. Centralized code mapping management. The source platform's material code and the target platform's code rules are often inconsistent (for example, one side has a category prefix while the other does not). A common practice is to keep the mapping table in Qeasy's dedicated "code mapping" module, rather than scattering it across individual strategies; otherwise, one change is easily forgotten.

5. Phasing header and line items. Material sync only touches the header (master data); fields such as units of measure and auxiliary attributes belong to a second independent strategy, to avoid hitting field-length validations on the target platform with a single large write.

Applicable and Non-Applicable Scenarios

Applicable: One-way synchronization of material master data from an ERP or e-commerce front end to a financial back end, with stable code rules and a data volume from tens of thousands to hundreds of thousands of records.

Not applicable: Bi-directional sync (where target-side materials must also flow back to the source); bundles and multi-level BOMs; scenarios requiring real-time (second-level) triggers—this strategy's 15-minute cadence cannot meet that.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p2ea595-kingdee-cloud-5924-n483a2b19-38e4d425

Comments