Qeasy Cloud
Get Started

MES Quality Inspection to Kingdee Other-Inbound Stock: A Practical Sync Strategy with Qeasy

· 何金辉· Integration Solutions· 15 views· 4 min read

What This Strategy Solves

On the shop floor of a discrete-manufacturing customer, the MES generates a quality-inspection record (inspectNo) after every process step is completed. But only when the process step has a real, non-empty number does that record actually mean "a finished or semi-finished good is now stockable." The problem: if these inspection records do not flow into the ERP in near real time, financial cost, inventory books and shop-floor reporting all fall out of sync. In Kingdee Cloud, this kind of business is posted as an "Other-Inbound Stock" document. We deliver this with the Qeasy data-integration platform: a single strategy that filters on the MES side for non-empty process steps and turns inspection records into Kingdee Other-Inbound Stock documents, closing the loop with an inspection-driven inbound flow.

Data Flow and Field Mapping

The overall direction is: Sihua MES (WEB) → Qeasy intermediate layer → Kingdee Cloud.

The source (MES, WebAPI common/search, POST, QUERY semantics) uses inspectNo as the business document number and id as the primary key, with pagination and parameters such as wsId and queryKey. The target (Kingdee Cloud, batchSave, EXECUTE semantics) uses the standard Other-Inbound document type FBillTypeID=QTRKD01_SYS.

Key field mapping (excerpt):

Business meaningMES source field (example)Kingdee target fieldNotes
Business document no.inspectNoFBillNoTemplated as {{checkNo}}
Inventory org—FStockOrgIdConstant on the target side
Pick org—FPickOrgIdConstant on the target side
Owner type—FOwnerTypeIdHeadBD_OwnerOrg
Owner—FOwnerIdHeadPaired with owner type
Material codematerialCodeFMaterialIdVia code mapping
QuantityqtyFQtyOne row per line
Process stepprocessNoFEntryNote / remarkUsed for traceability

Code mapping (material, org, warehouse, owner) is where this strategy tends to break, so we manage it centrally in Qeasy rather than scattering it across strategies.

How to Configure It on Qeasy

In the Qeasy strategy canvas, the strategy is a three-stage pipeline: source query → field mapping/filter → target write.

  1. Source node: pick WebAPI, common/search, POST, and turn on autoFillResponse so the response structure is parsed automatically. Set pageSize to 100 and drive pageNum with an expression that increments from the context. Mark inspectNo as the number field, id as the id field, and set idCheck=true for idempotent de-duplication.
  2. Filter node: add a "process step not empty" predicate, allowing only records where processNo is not null and not a blank string. Empty records go to statistics, not to the target.
  3. Mapping node: fill header fields with constants or expressions ({{checkNo}} for the source document number). Expand the body row by row, replace material codes via the mapping table to Kingdee's FMaterialId, and fill quantity, batch, remark and stock status accordingly.
  4. Target node: Kingdee batchSave, buildModel=true so Qeasy validates required fields against the Kingdee model. Hard errors such as a missing FBillTypeID are returned immediately.
  5. Exception handling: turn on retry and alerting, and route failed documents to a dead-letter queue for later re-push.

Implementation Steps

We break the rollout into three stages.

  • Incremental starting point: before going live, define a starting inspectNo — for example, the process records completed in the last 7 days — and use it as the minimum initial data set to confirm the target side can actually create the document.
  • Full-volume trigger: once the incremental is clean, manually trigger a full backfill and loop through pages until the source side has no more new data. Watch Kingdee's message center during this step and confirm every document is in the expected state, e.g. "Approved" or an intermediate state you have agreed on.
  • Schedule: the strategy's crontab is * 7-22 * * *, polling every minute between 07:00 and 22:00. This matches the production rhythm — high frequency during the day, stopped at night — to reduce pressure on the source system. Header and body are pushed in phases: header first, then body, so a body failure never leaves behind a half-empty document.

Pitfall Recap

  1. Ingesting records with empty process steps. We initially synced everything, and Kingdee ended up with several Other-Inbound documents whose FEntryNote was empty — traced back to process records that had no process number. The safe approach is to enforce a hard constraint in the filter node: not only non-null, but also a valid process number present in the code table.
  2. Scattered code mapping, drift after three months. Material, org and warehouse mapping originally lived inside each strategy; once we changed it in one place we forgot the others. The pattern we now follow is central management of code mapping in Qeasy's mapping center, referenced by every strategy.
  3. Wrong FBillTypeID, posted as an outbound. Kingdee's inbound, outbound and adjustment document codes look very similar (QTRKD01_SYS / QTCKD01_SYS); a single wrong character has the opposite effect. As a safeguard, add a "document-type self-check" step and write both the target document type and the final posting status back to the log.
  4. Pagination skipping pages. With pageSize=100 on the source, we once hard-coded pageNum=1 in the expression and only ever pulled the first page. After we split header and body into phases, the body re-fetch by source document number revealed the bug.
  5. Wrong idempotency key. The source id is the right idempotency key; inspectNo is a business number and should not be reused as one. We let idCheck=true work on the source primary key, while inspectNo is used only for FBillNo and traceability.

When It Fits and When It Does Not

Fit: discrete manufacturing where process-based reporting plus completion inspection drives inbound, and you want inspection results to be the source of truth for the Kingdee Other-Inbound document, with short reconciliation cycles and per-process traceability. Not fit: process industries that auto-receive by batch without per-step traceability, or where inspection is only used for judgement and does not need to be posted to the books.

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

Comments