Qeasy Cloud
Get Started

Practical Tutorial: Syncing MES Inspection Records (with Process Steps) to Kingdee Other-Inbound Documents

· Integration Solutions· 14 views· 5 min read

What This Strategy Solves (Scenario and Value)

In one discrete manufacturing scenario, the on-site QC process in MES issues inspection sheets. When an inspection sheet carries a clear process attribution—e.g., "Injection Molding" or "Machining"—the QC result triggers the movement of material from the inspection area to the qualified goods warehouse, and a corresponding "Other-Inbound Document" must be created in Kingdee Cloud Galaxy so the inventory is recorded on the ERP side.

On the surface this is just "document forwarding." But anyone who has been through the trenches knows: inspection sheets with empty process fields should NOT generate inbound documents (that material is still in inspection status); misaligned fields cause Kingdee to reject the document; and latency leads to inventory discrepancies. So the real point of this strategy is not "can we push it," but "push only what should be pushed, with fields, timing, batch, and inventory organization all aligned."

Data Flow and Field Mapping (Source → Middle Layer → Target)

The data flow is straightforward: MES (WebAPI) → Qeasy middle layer → Kingdee Cloud Galaxy (batchSave). The source side uses the POST common/search API to pull the inspection list; the target side writes through batchSave.

Key field mapping:

SemanticSource (MES)Middle LayerTarget (Kingdee Other-Inbound)
Inspection No.inspectNoDedup keyFBillNo = {{checkNo}}
Doc Type—Constant mappingFBillTypeID = QTRKD01_SYS (Standard Other-Inbound)
Inventory Org—Map from source org codeFStockOrgId = 100
Pick Org—Same as inventory orgFPickOrgId = 100
Owner Type—ConstantFOwnerTypeIdHead = BD_OwnerOrg
Process Non-empty CheckBusiness fieldFilter conditionOnly non-empty process inspections sync
PaginationpageNum / pageSizeDefault 1 / 100—
Interface IDswsId / queryKeySource tenant + query key—

The middle layer must do three things: 1) filter "process non-empty"; 2) map codes (material, org, warehouse, owner); 3) assemble header and body in two phases.

How to Configure in Qeasy

We use the Qeasy Data Integration Platform to host this strategy. Key configuration points:

  1. Source component: Select the "MES (WebAPI)" connector, API common/search, method POST. Configure wsId, queryKey, pageNum, and pageSize as request parameters. Map the primary key to inspectNo and enable idCheck = true to prevent duplicate pushes.
  2. Data filtering: In the middle layer, add a "process non-empty" filter. Empty values are discarded and never enter the target side. Be careful: the check should be on the actual business field that represents the process step, not a generic null check.
  3. Code mapping: Material codes, inventory org, warehouse, and owner all require mapping. Qeasy supports centralizing mapping tables in the "Data Dictionary"—this is the most common pattern we recommend to Qeasy customers: centralized code mapping, so a single change propagates across all strategies.
  4. Target component: Select the "Kingdee Cloud Galaxy" connector, API batchSave, set FBillTypeID to constant QTRKD01_SYS, FStockOrgId / FPickOrgId to the local org code, and reference FBillNo via the variable {{checkNo}} from the source inspection number.
  5. Header-body two-phase: Write the header first, then the body lines (FEntity) in a separate phase, to avoid dirty data from partial commits.
  6. Schedule: Both sides use the cron expression * 7-22 * * *, covering production hours from 7 AM to 10 PM, polling hourly.

Implementation Steps

Three steps for a stable rollout:

  • Step 1 — Full-trigger (initialization). Do not enable incremental on first run. Instead, full-load historical inspections within a time window to verify mapping rules, field alignment, and org codes. Full-load first exposes missing codes and wrong doc types early.
  • Step 2 — Switch incremental origin. After full-load validation passes, set the incremental origin to the last successful sync timestamp; thereafter only sync new and changed records. Combine source idCheck = true with the middle-layer dedup key (inspection number) as double insurance.
  • Step 3 — Routine scheduling and monitoring. Run hourly per * 7-22 * * *. Use the Qeasy console to monitor success/failure/retry counts; failed tasks go to the manual intervention queue. The incremental + full-load dual track keeps incremental as daily operation and full-load as the safety-net rerun for quarterly/annual reconciliation.

Pitfalls and Lessons Learned

  1. Typical mistake: no process non-empty check, all inspections get pushed. Inspections still in QC have no process attribution; pushing them creates orphan inbound records in Kingdee, and three months later the inventory ledger will not reconcile. Safe practice: explicitly add Process IS NOT NULL at the source pull or middle-layer filter.
  2. Wrong document type. Kingdee Other-Inbound has 5 types (standard, asset, VMI, expense, inventory adjustment). QTRKD01_SYS is standard other-inbound. Picking QTCKD01_SYS (other-outbound) or QTRKD05_SYS (inventory adjustment) reverses the inventory direction. Safe practice: write FBillTypeID as a "constant + comment" in the Qeasy target component, not an ad-hoc manual entry.
  3. Scattered code mappings. The first launch prioritized speed and embedded material, org, and warehouse mappings directly inside one strategy's script. Three months later, the business added a new plant, requiring changes to 14 strategies. Safe practice: centralize code mappings in Qeasy's "Data Dictionary" so one change affects everything.
  4. Header-body atomic submit partially rolled back. Kingdee's batchSave may partially commit when body lines fail, leaving "half-baked documents." Safe practice: write the header and body in two phases; confirm the header first, then write the body.
  5. Ignoring time zones and production windows. Different time zones between MES and Kingdee cause records written between midnight and 7 AM to land on the next day's inventory. Safe practice: the schedule (* 7-22 * * *) covers production hours and both systems are aligned to the same time zone.

Applicable and Non-applicable Scenarios

Applicable: Process-driven discrete manufacturing where QC results are tightly bound to specific processes, and qualified goods must move from inspection area to the ERP inventory org. Batch QC, hourly volume within hundreds.

Not applicable: Continuous-process industries without explicit process steps; scenarios requiring sub-second real-time feedback (this strategy polls hourly); cases where Kingdee requires complex approval workflows (should be triggered manually in ERP).

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-web-kingdee-cloud-6248-mes-4512b346

Comments