Date Range Reports → Other Receivables II: A Deep Dive into a Single Sync Strategy
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 meaning | Source (JiJia) | Target (Kingdee) | Qeasy expression |
|---|---|---|---|
| Unique bill number | id + feeType + marketName | FHvtThirdSrcBillNo | {{id}}-{{feeType}}-{{marketName}} |
| Third-party platform bill id | id | FHvtThirdSrcBillId | {{id}} |
| Source system | literal | FHvtThirdSrcType | literal GERPGO |
| Custom note | feeType | FHvtThirdCustomNote | {{feeType}} |
| Bill number | generated by target | FBillNo | left 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
- Source collector: Create a source platform of JiJia ERP, pick API
/finance/asset/dateRangeReports/page, method = POST, effect = QUERY. Fill inpage,pagesize,purchaseStartDate,purchaseEndDate,queryDateType,orderType; bind the date fields to the built-in time variables directly. - Middle-layer processing: Open Qeasy's mapping panel and map the fields from the table above. Enable "centralized code mapping" and place constants like
GERPGOin the platform's dictionary so other similar strategies can reuse them instead of scattering literals across strategies. - Target executor: Target platform = Kingdee, API =
batchSave, method = POST, effect = EXECUTE. PassFHvtThirdSrcBillNoas the idempotency key; leaveFBillNoblank so Kingdee fills it. - Idempotency and dedup: Qeasy defaults to
idCheckonid, combined withFHvtThirdSrcBillNofor idempotent writes on the Kingdee side; rerunning the same window will not produce duplicate documents.
Implementation Steps
- Set the incremental starting point: For first-time go-live, manually trigger once with
LAST_SYNC_TIMEset to 00:00 the day before cutover (market time), so historical data is not mistakenly pulled as "incremental". - 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.
- Switch to incremental scheduling: Source
crontab = 7 20-23,0-9 * * *(cross-night execution, covering records generated around 00:00); targetcrontab = 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. - 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
- Do not mix "market time" with "UTC time".
queryDateType=0is market time; in cross-timezone businesses it is easy to write1by 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. - 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. - Compose
FHvtThirdSrcBillNofully. Using only{{id}}as the idempotency key collides when multiplefeeType/marketNamecoexist. Always use the composite keyid+feeType+marketName. - 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.
- 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.