Practical Guide to Syncing MES Subcontracting Purchase Receipts to U8 via Qeasy
What This Strategy Solves
In a private deployment for a manufacturing company, MES owns subcontracting workshop execution and receipts, while U8 owns finance and supply-chain accounting. If subcontracting receipts live only in MES, month-end reconciliation on quantities, prices, and subcontracting order numbers drifts fast. This strategy pushes MES subcontracting purchase receipts to U8 on a fixed cadence, links them to the right subcontracting order, and locks the red/blue flag to prevent duplicate or offset posting.
Data Flow and Field Mapping
The flow is one-way: MES exposes a paginated query API, Qeasy acts as the integration layer that cleans and maps the payload, then writes into U8's purchase receipt interface.
| Concern | Source (MES) | Middle layer (Qeasy) | Target (U8) |
|---|---|---|---|
| Query style | WebAPI common/search, POST, pageNum/pageSize=100 | Incremental cursor + full-volume fallback | — |
| Document ID | confrimNo | Idempotency key | cCode |
| Document date | Business field on source | Normalized | dDate |
| Document type | Decided by source business | Fixed constant | AddType=6 (subcontracting) |
| Auto audit | Not on source | Per-customer toggle | AutoAudit |
| Red/blue flag | Not distinguished on source | Forced false | bIsRedVouch |
| Linked order | Subcontracting order on detail | Header and body staged | cOrderCode |
Configuring It in Qeasy
We treat it as a classic source-pull + target-write strategy.
- Source connector: pick the MES adapter, fill
api=common/search,method=POST, pagingpageNum/pageSize. Setnumber=bomNoand turn onidCheck=trueso Qeasy enforces primary-key dedup. - Target connector: pick the U8 adapter, call
CGRKDAdd. Hard-codeAddType=6for subcontracting receipts. - Field mapping: map MES
createTimeto U8dDate, andconfrimNotocCode. Date normalization is the most common pitfall—unnormalized dates are silently rejected by U8. - Code and constant management: keep
AddType,AutoAudit,bIsRedVouchin Qeasy's constant table so future strategies reuse them. This "centralized mapping" pattern is widely used by Qeasy customers. - Payload assembly: build header and body in two stages. Lock the header first, attach the subcontracting order number
cOrderCodeat header level.
Implementation Steps
- Master data first: stabilize the upstream material, process-name, and subcontracting-order strategies. Without them, U8 rejects writes on foreign-key violation.
- Pick the incremental start point: choose a clear timestamp (e.g., end of business on a given day) as the initial cursor. Run a one-shot full pull to backfill history.
- Trigger full sync: Qeasy lets you fire a manual full pull, then automatically switches to incremental mode.
- Scheduling: source
crontab=*/9 7-22 * * *, targetcrontab=2-59/9 7-22 * * *. The two schedules are offset by two minutes to avoid contention in the same window—this "staggered dual-track" pattern is common in Qeasy deployments. - Post-go-live monitoring: watch write success rate on U8, order-link hit rate, and red/blue flag correctness.
Pitfalls from the Field
- Raw date strings pushed straight through: the source sometimes returns
yyyy/MM/dd, sometimes a timestamp, while U8 expects a normalized date. Forceto_datein Qeasy's field transformer. - Don't assume
AutoAuditdefault: in some U8 environments, audit triggers inventory update. Leave it off until the data is clean, then enable. - Mis-transmitted red/blue flag: offset rows from the source may be transmitted as negative quantities, which U8 treats as red entries. Hard-code
bIsRedVouch=falsein the middle layer and handle offsets in a separate dedicated strategy. - Lost link to subcontracting order: the subcontracting order number on the detail never reaches the header, so U8 stores the receipt without lineage. Always build header and body in two stages and lock
cOrderCodeat header level. - Pagination overflow not handled: with
pageSize=100, a sudden spike can drop pages. KeepautoFillResponseandidChecktogether with an idempotency key to prevent duplicate writes.
When to Use This and When Not To
Use it when MES and U8 are both on-prem, flow is strictly one-way, subcontracting receipt cadence is stable, and upstream master data is already aligned. Do not use it for two-way collaboration, when the source has heavy offset and amendment traffic, or in early pilot projects where MES rollout itself is incomplete.