← Back to API List

Work Order Material Status

POST ERP → MES
issue.wo.item.process

ERP notifies MES of work order material preparation status changes, used to update material preparation information in MES.

Basic Information

API Name
issue.wo.item.process
Method Name
issueWoItemProcess
Target Table
MODETAIL / SFT_WO_ISSUE
Data Direction
ERP → MES
Purpose
Work order material status sync

Request Parameters

FieldTypeRequiredDescription
enterprise_noStringRequiredCompany number
site_noStringRequiredSite number
wo_noStringRequiredWork order number
issue_statusStringRequiredMaterial preparation status
issue_dateDateOptionalMaterial preparation date
issue_qtyNumericOptionalMaterial preparation quantity

Material Preparation Status

Status CodeDescription
0Not prepared
1Partially prepared
2Fully prepared
3Preparation cancelled

Request Example

{
  "enterprise_no": "COMP01",
  "site_no": "SITE01",
  "wo_no": "5101-20260319001",
  "issue_status": "2",
  "issue_date": "2026-03-19",
  "issue_qty": "100"
}

Processing Logic

Material Status Update
This API is actively called by ERP to notify MES that the work order's material preparation status has changed. Upon receiving this notification, MES updates the material status field in the MODETAIL table, which may affect the work order's release eligibility.

Database Update SQL

Query Work Order

-- Combine work order number CMOID = wo_no
SELECT COUNT(1) FROM MODETAIL WHERE CMOID = N'{wo_no}'

UPDATE (Update Material Status)

UPDATE MODETAIL SET
    ISSUE_STATUS = :issue_status,
    ISSUE_DATE = :issue_date,
    ISSUE_QTY = :issue_qty,
    LASTMAINTAINUSER = :userid,
    LASTMAINTAINDATETIME = N'{current_time}'
WHERE CMOID = :wo_no

SFT_WO_ISSUE Linked Update (if exists)

-- If SFT_WO_ISSUE table exists, update it as well
UPDATE SFT_WO_ISSUE SET
    ISSUE_STATUS = :issue_status,
    ISSUE_DATE = :issue_date,
    ISSUE_QTY = :issue_qty
WHERE WO_NO = :wo_no