Qeasy Cloud
Get Started

Pushing Sales Outbound Orders from an E-commerce ERP into Kingdee Cloud: A Single-Strategy Tutorial

· Integration Solutions· 43 views· 4 min read

What This Strategy Solves

For a typical retail enterprise, the front-end order taking, review, and shipping workflows run in Wangdiantong, while financial accounting, inventory ledgers, and cost consolidation live in Kingdee Cloud. Sales outbound orders sit at the heart of this flow — when goods leave the warehouse, how many, to which customer, and from which warehouse must all land in Kingdee faithfully. This strategy pushes Wangdiantong sales outbound orders into Kingdee Cloud according to business rules, with minimal manual intervention.

Data Flow and Field Mapping

The flow has three stages: source (Wangdiantong Flagship) → Qeasy middleware (querying, transforming, lookups, building payloads) → target (Kingdee Cloud).

The source API is wdt.wms.stockout.sales.querywithdetail. Key header fields include order_no (outbound order number), consign_time (ship time), shop_no (shop number), warehouse_name, trade_no, src_trade_no, and goods_total_cost. The detail array details_list carries spec_no/goods_no (merchant code / product number), goods_count, sell_price, total_amount, tax_rate, gift_type, remark, and so on.

The target calls Kingdee's batchSave with FormId SAL_OUTSTOCK. The header receives FBillNo, FDate, FCustomerID, and so on, while details go through the FEntity array. Below is the core mapping.

Source FieldTarget FieldMapping TypeConversion RuleBusiness Meaning
order_noFBillNoDIRECT{{order_no}}Order number
consign_timeFDateTRANSFORM`{{consign_timedatetime}}`
shop_noFCustomerIDCOLLECTION_findCollection lookupShop-to-customer mapping
remarkFNoteDIRECT{{remark}}Order note
trade_noF_UBGN_LargeText1DIRECT{{trade_no}}Order code
src_trade_noF_UBGN_LargeTextDIRECT{{src_trade_no}}Source order number
details_listFEntityCOLLECTIONvalue=details_listDetail array reference

Typical detail mappings: spec_no/goods_no → FMaterialId (merchant code preferred), goods_count → FQty, sell_price → FPrice, total_amount → FAmount, tax_rate → FTaxRate (0~1 to percentage), gift_type → FGiftType (0 = normal, 1/2 = gift). Organization constants such as FSaleOrgId, FStockOrgId, FOwnerIdHead are fixed to 100, and FBillTypeID is fixed to XSCKD01_SYS.

Configuring in Qeasy

In the Qeasy data integration platform, one strategy equals one end-to-end pipeline, configured in three steps: source → mapping → target.

For the source, create a data source of type "Wangdiantong Flagship," pick the API wdt.wms.stockout.sales.querywithdetail, set the number field to order_no, the ID field to stockout_id, and enable idCheck=true and buildModel=true. For the initial incremental cursor, anchor on the last full outbound time, then use consign_time for incremental filtering.

For the target, create a Kingdee Cloud data source, choose batchSave with FormId SAL_OUTSTOCK, Operation Save, and turn on IsAutoSubmitAndAudit=true, IsVerifyBaseDataField=true, with SubSystemId=21.

The mapping layer is the heart of this strategy. Don't hard-code the customer field. Use _findCollection: query FNumber from the shop-to-customer scheme with F_UBGN_Text_qtr={{shop_no}} and write it to FCustomerID. Each token in the expression must be separated by a single English space; missing a space breaks the lookup. Organization constants can be set as literals directly in the strategy without any script. Watch out for the cost field: the source header uses goods_total_cost, but the target mapping sometimes references goods_cost — if the platform does not auto-alias, the field will be empty, so add a same-named field or a small alias script.

Implementation Steps

We usually split go-live into three scheduling phases to avoid hammering both systems with high-frequency full syncs from day one.

Phase 1: Align the incremental cursor. Run a source query with consign_time >= last sync cutoff to confirm both sides start from the same point; cross-check FBillNo against order_no in Kingdee to detect duplicates or gaps.

Phase 2: Trigger a full backfill. During a business off-peak window (for example, after 02:00), run a one-shot full backfill to cover historical outbound orders. Temporarily disable auto-audit on the target during this phase, and only re-enable it once the full reconciliation is clean.

Phase 3: Steady-state scheduling. Run the source on */40 * * * * (every 40 minutes) for incremental pulls, and the target on 16 2 * * * (daily at 02:16) for batch execution, with idCheck deduplication. Monitor for missing orders, duplicate orders, and audit failures for a week, then tighten or relax the cadence as needed.

Lessons from the Field

  1. A missing space in _findCollection. Each token must be separated by a single English space. Drop one space and the entire lookup returns empty; the customer code is blank and the save fails. A safe approach is to use a real shop number to dry-run the lookup before going live.
  2. Shop-to-customer master data not synced first. This strategy depends on "shop to customer" being already in place. If F_UBGN_Text_qtr is missing from the customer master, the lookup returns nothing and FCustomerID stays empty. Treat shop-to-customer as a prerequisite and verify it before opening this strategy.
  3. Inconsistent gift line tax handling. When gift_type=1/2, the unit price may be zero, but the tax rate still needs to be carried. If Kingdee treats zero-priced lines as zero-tax, the save can fail. Tag gift lines separately in the strategy so they don't get mixed with normal sales lines.
  4. Cost field name mismatch. If the target mapping uses {{goods_cost}} but the source only has goods_total_cost, the platform will not auto-alias and the cost field will always be empty. Either rename the field or add a small alias script.
  5. Incorrect detail array reference. The value of FEntity must point to the details_list array as a whole, not a single field inside it; otherwise only the first row is taken and the rest are dropped.

When to Use and When Not to

Use this when the e-commerce front end is in Wangdiantong, accounting and inventory are in Kingdee Cloud, and organization, customer, and item masters have already been synced into Kingdee through other strategies. Do not use it for cross-border multi-currency settlement, pharma or food industries that require strict batch/expiry validation, or scenarios where Kingdee requires manual confirmation or complex approval flows — those are better handled via an interim middleware than a direct push.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-kingdee-cloud-2161-n263874da-a4ea58d8

Comments