Sales Order Sync from MES to Yonyou U8: A Single-Strategy Integration Tutorial
What This Strategy Solves
In a supply chain integration project for a manufacturing enterprise, the sales order is the bridge connecting the front line: orders are entered in MES, and the order header and line details must quickly land in Yonyou U8 to drive finished-goods outbound, receivables, and planning. It looks like "just placing one order," but MES order numbers, customer codes, and inventory codes usually do not match U8's. Without proper mapping and a well-tuned trigger cadence, the numbers on both sides drift apart within a month or two. We use the Qeasy Data Integration Platform to host this MES → U8 sales order sync strategy and push orders from the source system in a stable way.
Data Flow and Field Mapping
The overall flow is: Source (MES WebAPI) → Qeasy middle layer → Target (Yonyou U8 sales order interface). The source side calls a common/search-style query API, paging through results (100 records per page) to pull order headers and lines; the target side invokes a U8 sales-order creation interface (such as XSDDAdd) and writes orders one by one.
Key field mapping:
| Semantic | Source field | Middle-layer handling | Target field |
|---|---|---|---|
| Order number | bomNo | Pass-through | cSOCode |
| Order date | createTime | Formatted to U8 date | dDate |
| Customer code | MES customer code | Lookup in mapping table | cCusCode |
| Business type | — | Constant fill | cBusType (Normal Sales) |
| Auto-audit | — | Constant true | AutoAudit |
| Add type | — | Constant 0 | AddType |
| Line inventory/qty | Source line items | Mapping + aggregation | U8 line fields |
The mapping dictionary is the lifeblood of this table. A common pattern among Qeasy customers is to maintain MES customer codes, inventory codes, and warehouse codes in one shared mapping table that downstream strategies can reuse, rather than writing a separate mapping inside every interface.
How to Configure on Qeasy
On the Qeasy Data Integration Platform, this strategy is represented as a single "integration strategy" card. Typical configuration points are:
- Source connector: Choose the MES platform. Pick
common/searchas the API, method POST, disable automatic model building, and fill in fields such asparams,pageNum=1,pageSize=100. EnableidCheckand usebomNoas the dedup key. - Target connector: Choose the U8 platform. Pick a sales-order API such as
XSDDAdd, method POST, disablebuildModel, and fill in fields likeAddType,AutoAudit,cBusType,dDate,cSOCode, andcCusCode. - Field mapping: Use variable expressions in the middle layer to reference source return values. For example,
cSOCode = {{bomNo}},dDate = {{createTime}}formatted to U8 requirements. Customer codes go through a lookup component: hit the mapping table first, then write to U8; misses go to an exception queue for manual mapping. - Dedup and idempotency: Use source
bomNoas the business key in the middle layer to deduplicate and prevent duplicate order creation. - Exception handling: Orders that fail to land in U8 enter a retry queue; after exceeding the limit, they go to manual handling. The unified log dashboard in Qeasy lets you pinpoint exactly which line is stuck.
Implementation Steps
We usually recommend a three-stage rollout: "get it running, then stress-test, then put it into normal operation."
- Preparation: Check whether MES and U8 master data for customers, inventory, and warehouses have already been synced (this typically depends on an earlier "material sync" strategy in the same plan); prepare the mapping table and confirm that
bomNois reliably returned in pagination. - Incremental starting point: On go-live day, take a specific timestamp as the watermark. First, run a one-time full backfill for historical orders; then switch to incremental mode, pulling by the source update time window.
- Schedule frequency: In production, set source polling to
*/7 7-22 * * *(every 7 minutes during business hours) and target writing to2-59/7 7-22 * * *, offset by half a beat to avoid the next source poll firing before the previous U8 write completes. - Go-live verification: During the first week after launch, reconcile daily—compare U8 order totals and amounts with MES—and trace every exception through Qeasy logs.
- Steady state: Once the reconciliation difference drops below the threshold, switch to weekly spot-checks.
Lessons Learned
This strategy looks like just "one order," but there are several places where it tends to fail in practice:
- Typical mistake: treating source
bomNoas a line-item number. It is actually an order header number. If you use it to deduplicate line items, lines from the same order will collapse together. The safer approach is to dedupe in the middle layer using a composite key of "order number + line number." - Passing customer codes through directly. MES and U8 customer primary keys follow different rules; without a mapping, collisions are inevitable. A common Qeasy customer pattern is to centralize mappings in a dictionary table, requiring any new customer to be mapped before orders are placed.
- Leaving
AutoAudit=trueon by default. It feels convenient, but once a sales order is auto-audited, downstream processes begin preparation immediately. If upstream data is wrong, fixing it becomes costly. The safer path is to keep itfalsefor the first two weeks and only enable it after the data is confirmed stable. - Schedule collisions causing missed orders. When source polling and target writing share the same cadence and U8 writes are slow, the next source round may already have paged forward with no buffering. The recommended pattern is to offset the two schedules and let the middle layer provide message backpressure.
- Missing the last pagination page. With
pageSize=100and apageNumloop, the final page with fewer than 100 records is easy to mistake as "no data." The robust approach is to compute total pages strictly based on the returned total count, and only stop paging oncepageNumexceeds it.
Applicable and Non-Applicable Scenarios
Applicable: Single organization, daily order volume at the ten-thousand level or below, relatively stable encoding systems between MES and U8, and sales order sync that does not require cross-legal-entity handling. Not applicable: Multi-organization distribution, orders that need manual review and approval before landing in U8, or complex distribution scenarios where a single order must be split into multiple U8 documents.
Boundary Notes (Supplement)
If MES-side orders are still being revised frequently, it is recommended to filter for "approved" orders using a status field before syncing, so that invalid orders do not impact U8.