更新已上报物料的消耗记录
路径 | /industry/qualitytrace/materialconsumption/update |
版本号 | 1.0.0 |
协议 | HTTPS |
请求方法 | POST |
是否需要用户身份鉴权 | 否 |
超时时间 | 5000 |
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
materialCode | String | 是 | 物料主数据编码 | |
uniqueCode | String | 是 | 唯一编码, 可以是工单号、批次号 | |
id | Long | 是 | 待更新物料消耗记录id | |
stepCode | String | 是 | 工艺步骤编码,是工艺路径->工序->步骤的code字段 | |
assetNum | String | 否 | 生产设备 固定资产编号,对应的是主数据中的设备资产编号 | |
outPut | Float | 是 | 数量 | |
startTime | String | 是 | "startTime":"2019-09-25 00:00:00" | 消耗开始时间 |
endTime | String | 是 | "endTime":"2019-09-25 00:00:01" | 物料消耗结束时间 |
destConsume | String | 否 | 目标唯一码,记录此物料是消耗在哪个报工记录中 | |
columns | List | 否 | "columns":["name","phoneNumber"] | 工艺关键参数,参数列名字,也就是表头 |
columnData | List | 否 | "columnData":["张三","13800000456"] | 工艺关键参数参数名对应的数据,跟columns根据需要一一对应 |
appId | String | 否 | 应用id,saas的共享应用需要传这个值 | |
employeeId | String | 否 | 用户id,需要做用户级别鉴权时需要传入此参数 | |
corpId | String | 否 | 企业标识,每个企业拥有唯一的CorpID,比如钉钉corpID、LH里面的appId,用参数source来区分参数含义 | |
userId | String | 否 | 员工在当前企业内的唯一标识,比如钉钉userId或者IoT的employeeId | |
source | String | 否 | 参数来源源,枚举值,钉钉填写DINGDING,多租户saas应用填SAAS,source、corpId、userId配合使用 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | Int |
响应码, 200: 成功 |
|
message | String |
错误消息 |
|
localizedMsg | String |
本地语言错误消息 |
|
data | String |
响应结果 |
示例
请求示例
// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();
ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");
SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);
IoTApiRequest request = new IoTApiRequest();
// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("materialCode", "value0");
request.putParam("uniqueCode", value1");
request.putParam("id", value2");
request.putParam("stepCode", value3");
request.putParam("assetNum", value4");
request.putParam("outPut", value5");
request.putParam("startTime", value6");
request.putParam("endTime", value7");
request.putParam("destConsume", value8");
request.putParam("columns", value9");
request.putParam("columnData", value10");
request.putParam("appId", value11");
request.putParam("employeeId", value12");
request.putParam("corpId", value13");
request.putParam("userId", value14");
request.putParam("source", value15");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");
// 设置请求参数域名, path, request, isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/industry/qualitytrace/materialconsumption/update", request, true, headers);
System.out.println(
"response code = " + response.getCode()
+ " response = " + new String(response.getBody(), "UTF-8")
+ " headers = " + response.getHeaders().toString()
);
正常返回示例
JSON
格式
{
"id": "4de2c367-c1db-417c-aa15-8c585e595d92",
"code": 200,
"message": null,
"localizedMsg": null,
"data": null
}
异常返回示例
JSON
格式
{
"id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
"code": 403,
"message": "request forbidden.",
"localizedMsg": "请求被禁止",
"data": null
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
500 | 500 | Internal Error | Internal Error |
503 | 503 | Service Unavailable | Service Unavailable |
403 | 403 | Request Limited | Request Limited |
401 | 401 | Empty Signature | Empty Signature |
400 | 400 | Request Format Error | Request Format Error |
200 | 20003 | Find Backend Error | Find Backend Error |
200 | 20004 | Backend Service Error | Backend Service Error |
200 | 20055 | Backend Service Invalid | Request Format Error |
200 | 20056 | Hsf Invoke Timeout | Hsf Invoke Timeout |
200 | 401 | Request Authorized Error | Request Authorized Error |
200 | 403 | Request Forbidden | Request Forbidden |
200 | 500 | Server Error | Server Error |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 460 | request forbidden | 请求被禁止 |
200 | 1009 | SQL invoke error | SQL 执行出错 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
在文档使用中是否遇到以下问题
更多建议
匿名提交