Qeasy Cloud
Get Started

Sync Kingdee Assembly Bill Finished-Goods Receipt to Wangdiantong Other Stock-In Order: A Single-Strategy Practical Tutorial

· 王浩宇· Integration Solutions· 1 views· 4 min read

What this strategy solves

A retail or manufacturing enterprise uses Kingdee QJB as its financial and supply-chain ledger of record, while Wangdiantong flagship edition runs the physical warehouse. Floor staff need every assembly-line finished-goods receipt visible inside Wangdiantong so picking, shipping, and on-hand inventory stay consistent. Manual re-entry is slow and error-prone, so the team needs the Kingdee "assembly bill – finished-goods receipt" automatically replicated to a Wangdiantong "other stock-in order."

Data flow and field mapping

Direction: Kingdee QJB (assembly bill finished-goods receipt lines) → Qeasy (Qingyiyun Data Integration Platform) middleware layer → Wangdiantong flagship (other stock-in order).

Key field mapping:

Business meaningKingdee fieldMiddlewareWangdiantong field
Document numberbillnoouter_noouter_no
Warehouse codebillentry.warehouse_numberwarehouse_nowarehouse_no
Line remarkbillentry.entrycommentremarkremark
Goods listbillentrygoods_listgoods_list
Check flag—is_checkis_check (fixed "1", already checked)
In/out reasonbillentry.reasonreasonreason
Primary keyidid0 (external doc, no internal id)

The source API is /kapi/v2/dtog/im/im_assembbill/getList (POST, paginated). The target API is wms.stockin.Other.createOtherOrder (POST, write execution).

How to configure it in Qeasy

Step 1: Register credentials for both platforms (Kingdee endpoint + token; Wangdiantong shop key + secret). Platform codes are Kingdee.QJB and WangdiantongQJB.

Step 2: Import the source and target metadata JSONs. The source is a QUERY type with pageSize 10, using billno as the document number and id as the idempotency key, with autoFillResponse enabled so response fields auto-fill. The target is an EXECUTE type: outer_no references {{billno}}, goods_list references the whole billentry, and is_check is hard-coded to the string "1".

Step 3: Build field mappings. A pattern we frequently deploy at customer sites is "centralised code mapping"—warehouse codes, SKU codes, and reason dictionaries live in a single mapping table. Header (document-level) fields are handled by one mapping, body (line-level) fields by another. This two-stage header/body split avoids the line-level loops from clobbering header values.

Step 4: Enable the error branch. On a Wangdiantong failure, dump the raw payload into an error_log table and trigger a corporate WeCom alert so the on-call engineer can triage quickly.

Implementation steps

Phase 1: incremental kickoff. We usually start from Kingdee's modifydate as the increment cursor. First, run all assembly bills that have been checked today end-to-end and confirm header fields land correctly.

Phase 2: full-volume backfill. Replay the last 90 days of history, sorted ascending by document number, 100 documents per batch. Wangdiantong is idempotent on outer_no by default, so replaying is safe.

Phase 3: schedule cadence. Set the source cron to 10-59/20 7-23 * * * (every 20 minutes starting 07:xx) and the target to 15-59/20 7-23 * * *, offset by 5 minutes. The two tracks must not hit the Kingdee API at the same second. This "dual-track staggered" mode is what we ship to most customers.

Phase 4: go-live monitoring. Watch three signals: pulled count, written-success count, and document-number dedup hits. After 48 hours of green, drop manual on-call.

Pitfall debrief

  1. Warehouse code mismatch is the #1 stumble. Kingdee's warehouse_number is an internal code; Wangdiantong expects its warehouse dictionary. The names look identical but the systems differ. Always go through a mapping table—never inline if/else in the script.
  2. Split header and body mappings. Early on we stuffed everything into a single mapping, and the line-level loop overwrote header values. Splitting into "header mapping + body mapping" fixed it cleanly.
  3. Don't forget the checked flag. Kingdee already has "checked" on the source side, but Wangdiantong's is_check is the string "1", not a boolean. Passing 0 leaves the stock-in order pending review; overnight nothing gets checked and the morning shift is in chaos.
  4. pageSize 10 is too small for backfill. Ninety days of history with many lines per bill can drag for hours at page size 10. The safe move is to temporarily raise pageSize to 50 for the first backfill, then drop it back to 10.
  5. Staggering is not optional. If source and target fire in the same second, a transient Kingdee rate-limit will stall the whole pipeline. A 5-minute gap is the safety margin we've verified across multiple deployments.

When to use this strategy (and when not to)

Use it when finished goods have a fixed BOM, the assembly line runs on Kingdee, and physical receiving runs on Wangdiantong, with daily volume in the low thousands and 20-minute latency acceptable.

Do not use it for cross-organisation transfer-in (which needs a transfer document, not an other-stock-in), or for cases where line items carry serial/lot numbers and require real-time return. The latter needs a line-by-line API and exceeds what a single strategy can carry.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-wdt-p110c26-0304-ok-ad55f615

Comments