Qeasy Cloud
Get Started

MES Production Return → U8 Material Outbound (Red Voucher) Sync: A Field Guide

· 钟家寿· Integration Solutions· 14 views· 4 min read
四化智造MES(WEB)用友U8MES到U8集成红字出库生产退料轻易云实战供应链同步私有化部署

What This Strategy Solves (Scenario & Value)

Every shift on a shop floor produces "return-to-stock" events: workers over-pulled, used the wrong spec, or reworked a step. MES captures the operational truth; U8 owns the financial and inventory books. In U8, production returns must be posted as red-voucher material-outbound documents, otherwise inventory and cost accounting drift apart. The volume is modest, but the freshness requirement is high — anything delayed past shift-end breaks daily reconciliation. We use Qeasy (轻易云) to push MES return records into U8 as red vouchers, so the books close on the same shift.

Data Flow & Field Mapping

Flow: MES (WebAPI common/search QUERY) → Qeasy middle layer (filter, transform, map) → U8 (WebAPI CLCKDAdd EXECUTE red voucher).

Business meaningMES sourceQeasy middleU8 target
Document datecreateTimepass-throughdDate
MES return numberconfrimNoused as U8 doc numbercCode
Red/blue flagbusinessType="return"coerce to booleanbIsRedVouch = true
Document typebusiness parammapping dictAddType
Auto-approvestrategy paramdefault trueAutoAudit
Linked PO numberbusiness fieldpass-through (nullable)cOrderCode
Item/qty/batchbody rowsline transformchild table fields

The red flag is not cosmetic — it is the core of U8's posting direction. Default AutoAudit on, but during gray release keep it off for one week of manual checks.

How to Configure in Qeasy

  1. Source metadata: WebAPI POST, paginated, pageSize=100, scope by wsId, queryKey identifies the business type (return).
  2. Target metadata: WebAPI POST to CLCKDAdd, header plus body array in one call.
  3. Centralized code mapping: items, units, warehouses, and transaction classes are cross-system masters — keep them in Qeasy's mapping center so every strategy shares one source of truth. Especially separate the red-voucher transaction class from the normal outbound class.
  4. Header before body, in stages: return documents usually have multiple lines. Get the header right first, then add body rows. Capture U8's returned internal ID for each line so you can trace back later.
  5. Incremental + full both ways: daily incremental by lastModifiedTime; first go-live or after incidents, switch to full re-run (source pulled by time window).

Implementation Steps

  • Phase 1: environment & credentials. Register both platforms in the on-prem Qeasy environment, confirm the U8 account has CLCKDAdd permission, and add IPs to the whitelist.
  • Phase 2: mapping & trial run. Push 3–5 real return records through Qeasy's "trial run", then check the red voucher number, direction, and inventory impact in U8.
  • Phase 3: gray scheduling. Keep auto-approve off; run at 7–15 minute intervals (source */7 7-22 * * *, target 2-59/7 7-22 * * *, offset to avoid peak overlap) for one week.
  • Phase 4: turn on auto-approve and go live. Once finance confirms, flip AutoAudit to true and move to production schedule.
  • Phase 5: monitoring & reconciliation. Watch success rate and error distribution on the Qeasy dashboard. Before daily close, reconcile the count and amount against U8's material-outbound (red) summary.

Pitfall Recap

  • Forgot the red flag. bIsRedVouch omitted or sent as the string "true" instead of a boolean — U8 treats it as a blue voucher and inventory goes the wrong way. Force-coerce to boolean in Qeasy's field transform.
  • Duplicate document number. Reusing the MES return number as U8 cCode collides with manually keyed vouchers. Add a "U8-side dedup" check in Qeasy and prefix on collision.
  • Auto-approve too early. Turning AutoAudit=true from day one means errors are already booked; cleanup is expensive. The pragmatic path is manual review for one week, then enable.
  • Body quantity direction. Returns are "negative consumption" — quantity stays positive in the source, and stays positive in U8 red-voucher body (the red flag handles direction). Passing a negative number is rejected by U8.
  • Cross-shift gaps. The 7–22 schedule covers day shift; night-shift returns get missed the next day because createTime crosses midnight. Either widen the source window by 1–2 hours or switch the cursor to lastModifiedTime.

When to Use, When Not To

Use when: a discrete manufacturer runs MES and U8 side by side, has frequent production returns (a few to a few dozen per day), and needs the inventory book to reflect them the same shift. Do not use when: the whole process lives in a single system, or returns require a multi-level approval workflow that MES does not record as an operational fact — in that case, the approval is better initiated on the U8 side.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-web-u8-0201-mes-u8-898d6d85

Comments