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.

153 lines
3.8 KiB

### 修改物料(UpdateMaterial)
此接口用于修改物料
---
### 基本信息
方法:POST
URL: http://localhost:8033/open/UpdateMaterial
---
### 请求
请求参数
| 参数名 | 类型 | 必填 | 说明 |
| :-- | :-- | :-- | :-- |
| profile | string | 是 | 厂区代码 |
| materialCode | string | 是 | 物料编码 |
| materialTypeCode | string | 是 | 物料类别代码 |
| descriptions | string | 否 | 物料描述 |
| attrs | Array | 否 | 物料属性 |
| flag | int | 否 | 数据状态:0禁用 1启用,默认1|
| spec | string | 否 | 规格 |
| model | string | 否 | 型号 |
| erpTypeCode | string | 否 | ERP物料类型 |
| unitId | string | 否 | 主单位 |
| astUnitId | string | 否 | 辅单位 |
| changeRate | string | 否 | 换算率 |
| isNeedCheck | string | 否 | 是否检验 |
| validDay | int | 否 | 保质期 |
| validType | string | 否 | 保质期类型 |
| cellGrade | int | 否 | 辅助属性:等级 |
| cellColor | int | 否 | 辅助属性:颜色 |
| cellEff | int | 否 | 辅助属性:效率 |
| cellUop | int | 否 | 辅助属性:功率 |
| currentGrade | int | 否 | 辅助属性:电流 |
| isBatchManage | int | 否 | 是否启用批次管理 |
attrs字段
| 参数名 | 类型 | 必填 | 说明 |
| :-- | :-- | :-- | :-- |
| materialCode | string | 是 | 物料编码 |
| materialTypeCode | string | 是 | 物料类别代码 |
| attrCode | string | 否 | 属性代码 |
| attrName | string | 否 | 属性名称 |
1 year ago
| 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.88",
"attrValueCode": "7.88"
}
]
}
}
```
---
### 响应
执行成功时,响应如下:
```
{
"clock": "2023-07-05 14:37:28.022",
"status": "ok",
"data": {
"info": {
"materialCode": "CELL002",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"descriptions": "电池片描述",
"spec","4*100",
"model","s700",
"erpTypeCode","",
"unitId","",
"astUnitId","",
"changRate","1/500",
"isNeedCheck","0",
"validDays","60",
"validType","天",
"cellGrade","",
"cellColor","",
"cellEff","",
"cellUop","",
"currentGrade","",
"isBatchManage":"0",
"createTime": "2023-07-05 14:29:40.007",
"attrs": [
{
"materialCode": "CELL002",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "cell_uop",
"attrName": "单片功率",
"attrValue": "7.88",
"attrValueCode": "7.88"
},
{
"materialCode": "CELL002",
"materialTypeCode": "CELL",
"materialTypeDesc": "电池片",
"attrCode": "crys_type",
"attrName": "晶体结构",
"attrValue": "单晶",
"attrValueCode": "单晶"
}
],
}
}
}
```
执行报错:
```
{
"clock": "2023-06-25 20:00:00.000",
"status": "exception",
"message": "修改物料失败",
"data": {}
}
```