MES标准开放接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

2.7 KiB

添加物料(AddMaterial)

此接口用于添加物料


基本信息

方法:POST

URL: http://localhost:8033/open/AddMaterial


请求

请求参数

参数名 类型 必填 说明
profile string 厂区代码
materialCode string 物料编码
materialTypeCode string 物料类别代码
descriptions string 物料描述
attrs Array 物料属性

attrs字段

参数名 类型 必填 说明
materialCode string 物料编码
materialTypeCode string 物料类别代码
attrCode string 属性代码
attrName string 属性名称
attrValue string 物料属性值
attrValueCode string 物料属性值代码

示例 1:添加电池片及物料属性值

{
	"data": {
		"profile": "测试",
		"materialCode": "CELL002",
		"materialTypeCode": "CELL",
		"descriptions": "电池片描述",
		"attrs": [{
				"materialCode": "CELL002",
				"materialTypeCode": "CELL",
				"attrCode": "crys_type",
				"attrName": "晶体结构",
				"attrValue": "单晶",
				"attrValueCode": "单晶"
			},
			{
				"materialCode": "CELL002",
				"materialTypeCode": "CELL",
				"attrCode": "cell_uop",
				"attrName": "单片功率",
				"attrValue": "7.82",
				"attrValueCode": "7.82"
			}
		]
	}
}

响应

执行成功时,响应如下:

{
    "clock": "2023-07-05 14:29:40.122",
    "status": "ok",
    "data": {
        "info": {
            "materialCode": "CELL002",
            "materialTypeCode": "CELL",
            "materialTypeDesc": "电池片",
            "descriptions": "电池片描述",
            "createTime": "2023-07-05 14:29:40.008",
            "attrs": [
                {
                    "materialCode": "CELL002",
                    "materialTypeCode": "CELL",
                    "materialTypeDesc": "电池片",
                    "attrCode": "cell_uop",
                    "attrName": "单片功率",
                    "attrValue": "7.82",
                    "attrValueCode": "7.82"
                },
                {
                    "materialCode": "CELL002",
                    "materialTypeCode": "CELL",
                    "materialTypeDesc": "电池片",
                    "attrCode": "crys_type",
                    "attrName": "晶体结构",
                    "attrValue": "单晶",
                    "attrValueCode": "单晶"
                }
            ]
        }
    }
}

执行报错:

{
  "clock": "2023-06-25 20:00:00.000",
  "status": "exception",
  "message": "添加物料失败",
  "data": {}
}