Qeasy Cloud
Get Started

Material Master Data Query Sync in Practice: Incremental Pull from Kingdee to Qeasy

· 钟家寿· Integration Solutions· 40 views· 4 min read
汤臣倍健营销云金蝶云星辰物料同步增量拉取轻易云基础资料供应链集成

What This Strategy Solves

Syncing material master data from an ERP to downstream systems looks like "pull a table," but if any of coding, units, or classification falls out of alignment, the business team will show up three months later with two mismatched sets of numbers. In a supply chain integration project for a retail enterprise, we separated "Query Material" into its own strategy: use Kingdee Cloud's standard material API for incremental pulls, aggregate into the Qeasy data integration platform (Qeasy), and let the platform distribute downstream. This article focuses only on the "source system → middle layer" leg.

Data Flow and Field Mapping

The data flow is straightforward: the source is Kingdee Cloud's material query API, the middle layer is Qeasy (datahub), and downstream writes are handled by other strategies.

The source API is GET /jdy/v2/bd/material, with pagination via page and page_size (default cap 100). The incremental window is controlled by modify_start_time and modify_end_time, both in milliseconds. The response uses id as the primary key and number as the business code—on Qeasy both fields must be flagged for uniqueness check.

RoleFieldTypeNote
Source - window startmodify_start_timestringPlaceholder {{LAST_SYNC_TIME}}000, ms
Source - window endmodify_end_timestringPlaceholder {{CURRENT_TIME}}000, ms
Source - pagingpage / page_sizestringDefault 1 / 100
Source - PKidstringGlobally unique in the platform
Source - business codenumberstringMaterial number
Source - classificationparent_namestringParent name for multi-level categories

The target side of this strategy is a Write Null Operation (POST, effect=EXECUTE). It is not meant to land business data; it acts as an acknowledgement receipt so subsequent strategies can be chained by sequence.

How to Configure on Qeasy

On the Qeasy strategy canvas, follow five steps:

  1. Source component: pick Kingdee Cloud V2, API /jdy/v2/bd/material, method=GET, effect=QUERY, mark id and number with idCheck=true.
  2. Incremental window: bind modify_start_time and modify_end_time to {{LAST_SYNC_TIME}}000 and {{CURRENT_TIME}}000 respectively. Mind the milliseconds.
  3. Target component: pick Qeasy (datahub), API "Write Null Operation" placeholder POST, mark sequence as B (following the module's dependency order), and enable idCheck so downstream strategies can deduplicate.
  4. Centralized code mapping: keep dictionary values such as material category, unit, and tax rate in Qeasy's Mapping Center. Any downstream strategy references the same dictionary to avoid one side per system.

Implementation Steps

We usually split go-live into three phases:

  • Incremental start: run a full pull the first time, then switch modify_start_time to the last successful CURRENT_TIME. The most common pitfall here is time zone—if the source returns a zoned timestamp, convert it inside Qeasy's field processor first.
  • Full reload trigger: add a "Full Reload" button bound to a one-shot crontab, normally disabled; only trigger manually when categories are reshuffled or coding systems change.
  • Schedule frequency: every 15 minutes during business hours (08:00–22:00), throttled at night to a single 23:02 run (the source files give crontab */15 8-22 * * * and 23 2 * * *). A common pattern among Qeasy customers is "high frequency during the day + nightly safety net."

Lessons Learned

  1. Mixed timestamp units: Kingdee's API here uses milliseconds, but some interfaces return seconds. Get the unit wrong and you either pull nothing or pull everything—Qeasy's tight schedule will hammer the source.
  2. page_size default trap: the raw config defaults to 10, not 100. Operators leave it alone and end up pulling one page per tick, queueing up latency.
  3. Material codes can't be edited twice: once a material number changes in the source, any downstream record keyed on the old code becomes orphaned. The safe pattern is to maintain a "code change history" table in Qeasy's Mapping Center and let downstream strategies consult history before syncing.
  4. Classification is a string, not an enum: parent_name is a name rather than an ID. When downstream needs to rebuild a tree, it must match by name. A typical mistake is to join directly on the name—duplicate names break the hierarchy. We usually ask the source to expose parent_number or build a name → code cache inside Qeasy.
  5. "Write Null Operation" gets deleted by ops: because the target writes nothing, ops often prunes it during cleanup and breaks the whole sequence chain. Tag these placeholders with "Master Data Sync - Placeholder" in Qeasy and disable bulk deletion.

When to Use and When Not to Use

Use when: pulling master data (materials, customers, vendors) from a single ERP into a middle layer for aggregation, with an incremental window supported by the source API. Do not use when: you need to write materials directly into multiple downstream systems (spin up separate distribution strategies); or when the source has no modification timestamp and only full reloads are possible—in that case, switch to binlog or database log replication instead of a time-window pull.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-p158a24-kingdee-cloud-4452-n1fef2b25-772af6fc

Comments