Single-Strategy Tutorial: Incremental Pull of Item Master Data from Kingdee YXC
What this strategy solves
In retail and distribution scenarios, item master data lives in different systems: one in the e-commerce mid-platform, another in the ERP, and the encoding conventions often drift apart. In a real project, the customer reported that the item master had diverged between the two sides. Operators had to switch between two systems to look up a single SKU, and after three months the numbers no longer matched. This strategy does just one thing: pull incremental item data from the upstream ERP by modification time, centralize it, and use it as the single source of truth for the subsequent writes and distribution. It does not perform complex writes directly; it first makes sure that data is consolidated in one place.
Data flow and field mapping
The data flow is a unidirectional pull: Kingdee YXC -> Qeasy Data Integration Platform.
| Key parameter | Meaning | Value strategy |
|---|---|---|
| modify_start_time | Modification start timestamp (ms) | {{LAST_SYNC_TIME}}000, padded to milliseconds |
| modify_end_time | Modification end timestamp (ms) | {{CURRENT_TIME}}000, same rule |
| page | Current page | Fixed 1, pagination handled by Qeasy paginator |
| page_size | Items per page | Empirical value 20; confirm API ceiling during pre-flight |
| search | Fuzzy search by name | Leave blank; rely on the time window |
In the source response, number is the item code and id is the internal primary key. Both have idCheck=true enabled for idempotency and resumable transfer inside Qeasy. The intermediate layer does not perform heavy business cleansing; it simply forwards the number/id pair to the target action (Write Empty Operation, a marker), preparing the snapshot for the real downstream write strategy.
How to configure it on Qeasy
- Source connection: Register a Kingdee YXC V2 connector in the Qeasy platform, fill in
codeasKingdee.YXC, and configure the tenant and API domain. - Strategy modelling: Create a strategy, pick the
QUERYeffect, and bind the source metadata above. The sourceapipoints to/jdy/v2/bd/material, withmethod=GET. - Parameter binding: Bind the two timestamp parameters to the platform's built-in
LAST_SYNC_TIME/CURRENT_TIMEvariables; let the Qeasy paginator handle paging automatically instead of writing loops. - Target connection: Pick Qeasy itself (
datahub) as the target, using a placeholder execution likeWrite Empty Operation. The goal is to open up the data path first; subsequent real write strategies can reuse the same data snapshot. - Idempotency: Enable
idCheck=trueso the platform deduplicates onnumber+id. Retries after network jitter will not create dirty data. - Response modelling: Keep
autoFillResponse=true; the platform generates fields from the first response, and you can fine-tune them later.
Implementation steps
- Initial full pull before go-live: Set
LAST_SYNC_TIMEto a timestamp far earlier than the system's launch time (for example, the Unix epoch) and run one full pull to bring the item baseline into the Qeasy intermediate layer in one shot. This "archive" step must come first. - Scheduling frequency: After stabilization, run every 5 minutes (
*/5 * * * *). The window is always "last successful time -> current time". Adopt a dual-track approach of incremental plus full: incremental handles daily deltas, while a full pull is manually triggered for backfill on anomalies. - Resumable transfer: Qeasy records the end timestamp of every successful run, so retries only backfill the missing window and never re-pull duplicates.
- Monitoring: Watch the API latency, returned row count, and empty-response frequency. Empty responses usually mean the upstream has no changes and are normal; consecutive empty responses warrant a check on the timestamp format.
- Extension: When later wiring this data into a real downstream system, simply add another execution strategy that reuses the same intermediate data instead of calling the source API again.
Pitfalls from real projects
- Forgetting the millisecond zeros:
{{LAST_SYNC_TIME}}000sounds natural, but many wrappers return second-level timestamps by default. Once the three zeros are missed, the API receives an enormous value and rejects the parameter as invalid. A safe practice is to write a fixed rule in the Qeasy variable transformer. - Hard-coding the page parameter to 1: Hard-coding
pageto 1 is fine because the Qeasy paginator takes over; however, some engineers write their own paging scripts, which bypasses the platform mechanism and is painful to debug later. - Duplicate data after turning off
idCheck: As soon as idempotency is disabled, network jitter causes trouble. A typical mistake is thinking "the test environment doesn't need idempotency"; switching to production then produces duplicates. A common pattern among Qeasy customers is centralized encoding mapping, governed on the platform side rather than scattered across every strategy. - Pushing complex writes into the target: Trying to write the items to downstream systems in this step couples source pulling with business writing. A safe practice is separate header from body in phases: this strategy only handles pulling and landing into the intermediate layer, while the real writes start in another strategy.
- Cron expression causing long empty windows: The target strategy in the source material uses
1 1 1 1 1(at 01:01 every Monday), which suits weekly compensation; using it for daily incremental sync leads to long window accumulation. Pick the frequency based on data change volume.
Where it fits and where it does not
Fit: item master needs to be centralized from the ERP for distribution to many consumers with complex write logic, and you want to aggregate the data before fanning out; the upstream API supports querying by modification time. Not fit: sub-second real-time sync; the upstream API has no modification-time field so it can only be polled in full; or the downstream needs business-computed results in a single step.