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.

142 lines
3.8 KiB

### 列出物料(ListMaterial)
此接口用于获取物料列表,搜索物料
---
### 基本信息
方法:POST
URL: http://localhost:8033/open/ListMaterial
---
### 请求
请求参数
| 参数名 | 类型 | 必填 | 说明 |
| :-- | :-- | :-- | :-- |
| profile | string | 是 | 厂区代码 |
| search | string | 否 | 物料编码物料描述模糊查询 |
| type| string | 否 | 传递物料类型code |
示例 1:模糊查询玻璃主材
```
{
"data": {
"profile": "测试",
"search": "001",
"type": "CELL"
}
}
```
---
### 响应
响应字段
| 字段 | 类型 | 说明 |
| :-- | :-- | :-- |
| materialCode | string | 物料编码 |
| materialTypeCode | string | 物料类别代码 |
| materialTypeDesc | string | 物料类别名称 |
| descriptions | string | 物料描述 |
| flag | int | 数据状态:0禁用 1启用 |
| createTime | string | 创建时间 |
| attrs | Array | 物料属性 |
attrs字段
| 字段 | 类型 | 说明 |
| :-- | :-- | :-- |
| materialCode | string | 物料编码 |
| materialTypeCode | string | 物料类别代码 |
| materialTypeDesc | string | 物料类别名称 |
| attrCode | string | 属性代码 |
| attrName | string | 属性名称 |
1 year ago
| attrValue | string | 物料属性值 |
| attrValueCode | string | 物料属性值代码 |
| flag | int | 数据状态:0禁用 1启用 |
查询成功时,响应如下:
```
{
"clock": "2023-07-05 14:12:33.463",
"status": "ok",
"data": {
"list": [
{
"materialCode": "20230704001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"descriptions": "测试电池片",
"createTime": "2023-07-04 13:38:41.100",
"attrs": [
{
"materialCode": "20230704001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "cell_uop",
"attrName": "单片功率",
"attrValue": "7.24",
"attrValueCode": ""
}
]
},
{
"materialCode": "dianchi0001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"descriptions": "电池01",
"createTime": "2023-06-08 16:00:50.750",
"attrs": [
{
"materialCode": "dianchi0001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "cell_eff",
"attrName": "电池效率",
"attrValue": "24",
"attrValueCode": ""
},
{
"materialCode": "dianchi0001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "cell_uop",
"attrName": "单片功率",
"attrValue": "23",
"attrValueCode": ""
},
{
"materialCode": "dianchi0001",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "d",
"attrName": "d",
"attrValue": "123",
"attrValueCode": "123"
}
]
}
]
}
}
```
查询报错:
```
{
"clock": "2023-06-25 20:00:00.000",
"status": "exception",
"message": "错误信息",
"data": {}
}
```