← Back to API List

Mold/Fixture Master Data

GET ERP → MES
mold.fixture.get

Synchronizes mold/fixture master data from ERP to MES MoldInfo and MoldStatus tables.

Basic Information

API Name
mold.fixture.get
Method Name
upMoldInfoCROSS
Target Table
MoldInfo / MoldStatus
JSON Node
mold_fixture_data
Primary Key
moldId (mold_fixture_no)
Code Location
RegularESB.java:3728

Response Fields

ERP FieldMES FieldDescription
mold_fixture_nomoldIdMold number (Primary Key)
mold_fixture_namemoldNameMold name
remarkremarkRemark
belongings_nobelongingsBelongings number
supplier_noproductionLineProduction line number
statusstatusStatus
tran_statusTRAN_STATUSTransaction status

Response Example

{
  "mold_fixture_data": [
    {
      "mold_fixture_no": "MOLD001",
      "mold_fixture_name": "Injection Mold A",
      "remark": "For precision plastic parts",
      "belongings_no": "BELONG01",
      "supplier_no": "WS001",
      "status": "1",
      "modify_no": "USER001",
      "tran_status": "AU"
    }
  ]
}

MoldStatus Default Values

When adding a mold, a MoldStatus record is created simultaneously:

FieldDefault ValueDescription
fail2Failure count
produced0Produced quantity
moldState1Mold state

Database Update SQL

Check Insert or Update

SELECT COUNT(1) FROM MoldInfo WHERE moldId = N'{mold_fixture_no}'
-- count > 0 → UPDATE, count = 0 → INSERT

INSERT (Add Mold)

-- MoldInfo table
INSERT INTO MoldInfo (
    moldId, moldName, remark, belongings, productionLine, status
) VALUES (
    :moldId,
    :moldName,
    :remark,
    :belongings,
    :productionLine,
    :status
)

-- MoldStatus table (linked creation)
INSERT INTO MoldStatus (moldId, fail, produced, moldState)
VALUES (:moldId, 2, 0, 1)

UPDATE (Modify Mold)

UPDATE MoldInfo SET
    moldName = :moldName,
    remark = :remark,
    belongings = :belongings,
    productionLine = :productionLine,
    status = :status
WHERE moldId = :moldId