Qeasy Cloud
Get Started

Date Range Reports → Other Receivables II: A Deep Dive into a Single Sync Strategy

· Integration Solutions· 12 views· 4 min read

What This Strategy Solves

A retail enterprise runs its operations on a JiJia-style ERP while keeping financial books in a Kingdee-style cloud suite. At the end of each accounting period, the operations side produces fee/allocation reports keyed by date range. These documents need to land as "Other Receivables II" in the financial system, serving as the basis for receivables and invoicing. We use the Qeasy integration platform to own this chain. The goal is to turn "pull by date window, compose by fee type, batch write" into a schedulable, rerunnable, traceable strategy.

Data Flow and Field Mapping

The source is a WebAPI POST /finance/asset/dateRangeReports/page (effect = QUERY). The key filter dimensions in the request body are purchaseStartDate and purchaseEndDate, which are bound to the platform built-in variables {{LAST_SYNC_TIME|date}} and {{CURRENT_TIME|date}} so the scheduler computes the window automatically; queryDateType set to 0 means market time. The target is the Kingdee batchSave API (POST, EXECUTE), which batch-inserts "Other Receivables II".

The middle layer on Qeasy handles three things: paginated fetching, deduplication by business key, and field composition. Key field mappings:

Business meaningSource (JiJia)Target (Kingdee)Qeasy expression
Unique bill numberid + feeType + marketNameFHvtThirdSrcBillNo{{id}}-{{feeType}}-{{marketName}}
Third-party platform bill ididFHvtThirdSrcBillId{{id}}
Source systemliteralFHvtThirdSrcTypeliteral GERPGO
Custom notefeeTypeFHvtThirdCustomNote{{feeType}}
Bill numbergenerated by targetFBillNoleft blank, filled by Kingdee

Both sides' id is composed via the {{id}}-{{feeType}}-{{marketName}} rule, which later becomes the idempotency key.

How to Configure on Qeasy

  1. Source collector: Create a source platform of JiJia ERP, pick API /finance/asset/dateRangeReports/page, method = POST, effect = QUERY. Fill in page, pagesize, purchaseStartDate, purchaseEndDate, queryDateType, orderType; bind the date fields to the built-in time variables directly.
  2. Middle-layer processing: Open Qeasy's mapping panel and map the fields from the table above. Enable "centralized code mapping" and place constants like GERPGO in the platform's dictionary so other similar strategies can reuse them instead of scattering literals across strategies.
  3. Target executor: Target platform = Kingdee, API = batchSave, method = POST, effect = EXECUTE. Pass FHvtThirdSrcBillNo as the idempotency key; leave FBillNo blank so Kingdee fills it.
  4. Idempotency and dedup: Qeasy defaults to idCheck on id, combined with FHvtThirdSrcBillNo for idempotent writes on the Kingdee side; rerunning the same window will not produce duplicate documents.

Implementation Steps

  1. Set the incremental starting point: For first-time go-live, manually trigger once with LAST_SYNC_TIME set to 00:00 the day before cutover (market time), so historical data is not mistakenly pulled as "incremental".
  2. Full backfill: On go-live day, run an independent full backfill to validate mappings and Kingdee's posting rules; this pass only cares about correctness, not speed.
  3. Switch to incremental scheduling: Source crontab = 7 20-23,0-9 * * * (cross-night execution, covering records generated around 00:00); target crontab = 30 2 * * * (batch write in early morning, aggregating all windows collected during the day). The two crontabs are offset so the target always runs after the source.
  4. Monitoring and rerun: Qeasy run logs expose a full-chain ID for each record from pull to write; failed tasks can be rerun from the UI and will automatically replay the same window.

Lessons Learned

  1. Do not mix "market time" with "UTC time". queryDateType=0 is market time; in cross-timezone businesses it is easy to write 1 by mistake, causing one segment to be dropped or duplicated daily. The safe approach: pin this value as a constant in Qeasy and disallow per-strategy overrides.
  2. Do not guess pagesize. The sample default is 10; 100 is reasonable in production. Going higher may trigger rate limits on the source; going lower causes Qeasy to flip pages too often and slows throughput.
  3. Compose FHvtThirdSrcBillNo fully. Using only {{id}} as the idempotency key collides when multiple feeType/marketName coexist. Always use the composite key id+feeType+marketName.
  4. Stagger source and target crontabs. When the two crontabs sit too close, the target batch may start before the source has finished paging, producing "incomplete windows". Safe practice: source runs at minutes 7 across 20-23 and 0-9, target fixed at 02:30, with buffer in between.
  5. Do not run the first full backfill on the live schedule. Initial backfill volume usually exceeds expectations; manually trigger it on Qeasy with rate limiting, then switch back to the scheduled job once it is green.

When to Use and When Not to Use

Use for: cross-system date-window fee/allocation documents that need idempotency, staggered scheduling, and rerunnability. Do not use for: sub-second real-time requirements, strong transactional consistency, or scenarios where the source has no stable date window field (only event/state filters apply). Those belong on event-driven or state-machine strategies.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-erp-kingdee-cloud-1306-ne0d41210-bde993d0

Comments