Sales Order Sync from Kingdee Cosmos to Fenxsiangkefu: A Single-Strategy Tutorial
What This Strategy Solves
In a sales outbound scenario, Kingdee Cosmos is the system of record for orders and inventory, while Fenxsiangkefu carries frontline collaboration and acknowledgements. Once a sales outbound bill is generated in Kingdee, store and field sales staff need to see the delivery status in Fenxsiangkefu. Manual export-import quickly accumulates errors, omissions, and duplicates that blow up at month-end reconciliation. This strategy turns the "Kingdee Cosmos sales outbound bill → Fenxsiangkefu delivery bill" path from manual to automated, keeping both sides consistent on shipping facts.
Data Flow and Field Mapping
The overall flow is Kingdee Cosmos (B) → Qeasy middle layer → Fenxsiangkefu (A). The B side pulls the sales outbound header and entry tables within an incremental time window; the middle layer handles code mapping, field cleansing, and header-body assembly; the A side writes the delivery bill object.
Key field mapping:
| Business Meaning | Kingdee Source Field | Fenxsiangkefu Target Field | Handling Notes |
|---|---|---|---|
| Document No. | FBillNo | bill_no | Direct map; enforce uniqueness |
| Customer Code | FCustId.FNumber | customer_code | Centralize via Qeasy mapping |
| Warehouse Code | FStockId.FNumber | warehouse_code | Same as above |
| Material Code | FMaterialId.FNumber | product_code | Per-line body mapping |
| Quantity | FQty | quantity | Two decimals; force string→number |
| Outbound Date | FDate | outbound_date | Convert to yyyy-MM-dd |
| Document Status | FDocumentStatus | status | Enum dictionary translation |
Header and body splitting is typically done in two stages in Qeasy: pull the outbound header first, then pull the entries by FBillNo and assemble them into a nested JSON before pushing to the A side.
How to Configure in Qeasy
We used the Qeasy Data Integration Platform to host this chain. Configuration breaks down into four parts.
First, data source access: register Kingdee Cosmos's organization code, app ID, and API authorization in Qeasy's "Integration Sources". For Fenxsiangkefu, register the open-platform AppKey/AK and store them in Qeasy's credential vault — never let them leak into scripts.
Second, data integration (ETL flow): on the source side, use Kingdee Cosmos's queryOnlineBill API and pull by FDate + FModifyTime. In Qeasy's transformation node, attach a "code mapping" component to translate customer, warehouse, and material codes uniformly. On the target side, call Fenxsiangkefu's delivery bill creation API.
Third, scheduling and dependencies: register this strategy as "B→A Order Fact Sync" with sequence set to C (after material create/update), depending on the two basic-data sync tasks so codes are ready when the order goes out.
Fourth, exceptions and replay: Qeasy's run logs surface the request and response for every bill. Failed bills flow into a retry queue; before retry, the latest field snapshot is replayed so no half-baked data pollutes the target.
Implementation Steps
In real projects we proceed in three phases: "incremental anchor → full backfill → steady-state scheduling".
Phase 1: Incremental anchor. Configure the source cursor as FModifyTime >= last success - 5 min in Qeasy. The 5-minute overlap window protects against in-flight transactions. A common pattern among Qeasy customers is the "dual-track" approach — keep both incremental and full loads: incremental runs every interval, while a weekly full load sweeps up any orphans.
Phase 2: Full backfill. Run a one-time historical backfill before go-live. Pagination is set in Qeasy's "paging component" at 200 records per page. Pull header and body separately using the same page key to avoid misalignment.
Phase 3: Scheduling cadence. Sales outbound is time-sensitive; Qeasy usually schedules every 15 minutes, throttling to hourly off-hours. Higher frequency isn't always better — source API rate limits and middle-layer write pressure both need accounting.
Lessons from the Field
- Pulling header and body together, then getting misaligned. A classic mistake is to grab header and detail in one shot; source pagination can split rows of the same FBillNo across pages. The safe pattern is to page the header first, then fetch the body per bill number.
- Code mapping scattered in scripts. We started by inlining customer/warehouse/material mappings in transformation scripts. Three months later, a retail client added new stores and we couldn't locate the mapping. After moving to Qeasy's centralized "code mapping" component, every change takes effect across the chain from a single point.
- Wrong incremental key. Someone used FDate as the incremental key for convenience; back-dated entries were all missed. Incremental keys must be audit fields like FModifyTime.
- Hard-coded status strings. Pushing "Approved" as a literal broke the moment the enum changed on Fenxsiangkefu. Build a status dictionary in Qeasy with version notes; maintenance becomes trivial.
- No replay led to dirty data. Any mid-chain hiccup leaves "A-side bill written but status wrong" artifacts. Qeasy's failed retry plus field-snapshot replay is the safety net.
Where This Fits and Where It Doesn't
Fits: ERP (e.g., Kingdee Cosmos) as order system of record, with CRM/collaboration platforms (e.g., Fenxsiangkefu) needing delivery acknowledgement, where field sales follows up per bill.
Doesn't fit: Sub-second latency (use message queues + CDC instead of scheduled pulls), source schema undergoing major redesigns, or when the target is a heterogeneous data warehouse rather than a business-document system.