Qeasy Cloud
Get Started

Syncing Jiandaoyun Miscellaneous Outbound to Kingdee Cosmos: A Single-Strategy Tutorial

· 系统管理员· Integration Solutions· 13 views· 5 min read
简道云Kingdee Cloud轻易云轻易云Qeasy其他出库单供应链集成

What This Strategy Solves

A retail enterprise runs its business frontend on Jiandaoyun and its back-end financial inventory on Kingdee Cosmos. Front-line stores enter a large volume of "miscellaneous outbound documents" (gifts, trial fittings, inventory losses, etc.) on Jiandaoyun every day. The challenge is to push these outbound documents—together with their subform line items—into Kingdee without adding headcount, so the inventory ledger gets updated promptly. The mapping looks simple at first glance, but if material codes, customer codes, and department codes are not designed carefully, the inventory ledgers on both sides will drift apart within three months, and auditors will be forced to redo the work. The core value of this integration strategy is to clarify "source field → target semantics" in one pass and to encode conditional branches, reducing long-term maintenance cost.

Data Flow and Field Mapping

Data flow: Jiandaoyun miscellaneous outbound document (header + outbound subform) → Qeasy middleware (field mapping and CASE transformation) → Kingdee Cosmos miscellaneous outbound document (STK_MisDelivery).

Key Field Mapping (Header):

Business SemanticSource Field (Jiandaoyun)Target Field (Kingdee)Mapping Type
Document number_widget_1689140117269FBillNoDirect
Outbound type_widget_1684312625901FBillTypeIDCASE branch
Inventory org_widget_1704939911499FStockOrgId / FPickOrgId / FOwnerIdHeadDirect (multi-field reuse)
Customer_widget_1704939860955 + _widget_1706801286378FCustIdCASE branch
Business date_widget_1602228805094FDateDate format
Issue department_widget_1704939860955 + _widget_1709285714485FDeptIdCASE branch
Note_widget_1682315028057FNoteDirect

Key Field Mapping (Line Items): source _widget_1602228805384 (outbound subform array) → target FEntity array, expanded row by row. Each line maps: material code → FMaterialId, outbound qty → FQty, warehouse code (_widget_1704938868835) → FStockId, owner → FOwnerId.

Constant fields: FStockDirect=GENERAL, FOwnerTypeIdHead=BD_OwnerOrg, FormId=STK_MisDelivery, IsAutoSubmitAndAudit=true, IsVerifyBaseDataField=true. These values come from the source and are configured as constants on the Qeasy target side.

How to Configure on Qeasy

We use the Qeasy Data Integration Platform to host this strategy. The configuration has three parts:

  1. Source dataset: pick the Jiandaoyun connector, with the API /api/v2/app/{app_id}/entry/{entry_id}/data. Configure header fields plus the subform field _widget_1602213743268 (or _widget_1602228805384, depending on the actual form structure).
  2. Field mapping and transformation: in Qeasy's "Field Mapping" panel, direct mapping uses {{field}}; conditional branches use _function CASE '{{outbound_type}}' WHEN 'Gift' THEN 'QTCKD13_SYS' WHEN 'TrialOutbound' THEN 'QTCKD16_SYS' WHEN 'Stocktaking' THEN 'QTCKD15_SYS' ELSE '' END to translate the outbound type into the Kingdee standard code. The customer and department fields use the same CASE pattern, checking whether the org code is MD000 or 004—internal orgs do not link to a customer but must link to a department.
  3. Target write: pick the Kingdee Cosmos connector. FormId is fixed at STK_MisDelivery, Operation=Save, IsAutoSubmitAndAudit=true, and negative stock is allowed via InterationFlags=STK_InvCheckResult.

Centralised encoding mapping is a common pattern among Qeasy customers: pull warehouse and material code mapping tables out into a dedicated "master data mapping" asset so other similar documents can reuse them, avoiding repeated configuration per strategy.

Implementation Steps

  1. Incremental start point: run a full sync first to backfill historical outbound documents into Kingdee; set the incremental start point to the last sync timestamp (the _widget_1602228805094 field). The Jiandaoyun API typically filters by modification time, so the start point must be precise to the second, otherwise the first batch will be incomplete.
  2. Header-then-line staging: tune the header mapping first (FBillNo, FBillTypeID, FStockOrgId, etc.) and confirm Save works; then handle the FEntity line-item loop; finally switch on IsAutoSubmitAndAudit. This staged approach makes troubleshooting far easier.
  3. Full sync and replay: provide a "manual replay" entry so that when the material mapping table is updated, a specific document can be re-sent by its document number rather than re-running the entire dataset.
  4. Schedule frequency: every 5–15 minutes for daily increments; during peak periods (month-end stocktaking) it can be temporarily tightened to 1 minute. Qeasy's scheduler supports cron expressions. Do not push the frequency to second-level polling, or the source side will rate-limit you.
  5. Monitoring and reconciliation: run an inventory-ledger comparison script once a day, comparing source outbound quantity with Kingdee FQty; automatically alert when the delta exceeds a threshold. This is essential for ongoing operations.

Lessons Learned

  1. Subform field reference mismatch: the actual outbound subform field on the source may be _widget_1602213743268, but the target configuration references _widget_1602228805384. This is a classic pitfall. The safe approach is to use Qeasy's "Field Preview" to confirm the subform array expands correctly before configuring line-level mapping.
  2. CASE branches written backwards: confusing the customer and department CASE logic, causing internal orgs to be linked to external customers instead of departments. A typical mistake is putting the customer value in the ELSE branch rather than an empty string. After configuration, run three sample records (Gift / Trial / Stocktaking) and manually verify FBillTypeID and FCustId.
  3. Turning on IsAutoSubmitAndAudit from day one: many integration engineers enable auto-audit to save effort. The problem is that when Kingdee master data validation fails, the document neither saves successfully nor returns a clear error, making investigation difficult. The safe approach is to disable auto-audit first, confirm Save works, then enable the audit switch separately.
  4. FStockDirect not configured: leaving it empty may route to a special inventory direction rather than a general one, distorting ledger semantics. The constant GENERAL must be set explicitly rather than relying on default behaviour.
  5. Incremental and full sync not separated: using the same scheduler entry for both the first sync and daily sync causes the full sync to overwrite the incremental start point and double-sync data. The "dual-track" pattern is common among Qeasy customers: full sync runs as a one-off job, incremental sync runs as a scheduled job, with separate entries to avoid mutual interference.

When This Fits and When It Does Not

Fits: business frontend on Jiandaoyun, financial inventory back-end on Kingdee Cosmos, with a need to sync gift, trial, stocktaking, and similar "miscellaneous outbound" documents to Kingdee in real or near-real time to trigger ledger updates; material, warehouse, and customer mappings already exist. Does not fit: cross-org transfers (which require a transfer document rather than a miscellaneous outbound document), scenarios requiring complex approval workflows (which Qeasy cannot replace in place of Kingdee's built-in approval flow), and the transition period when the source subform fields are changing frequently.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-pcdd5c6-kingdee-cloud-2364-n2752a69f-bb5e74bf

Comments