dingtalk.oapi.rhino.mos.exec.perform.batch.create (批量创建)

批量创建工序

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
batch_create_operation_req BatchCreateOperationWithEntityReq 可选 入参
  • entity_condition
  • EntityCondition
  • 可选
  • 实体条件
  • └ entity_ids
  • Number []
  • 可选
  • [1]
  • 实体ids
  • entity_source
  • Source
  • 可选
  • 实体来源(暂未支持)
  • └ source_id
  • String
  • 可选
  • 1
  • sourceId
  • └ source_type
  • String
  • 可选
  • SAAS-BED
  • sourceType
  • └ entity_type
  • String
  • 可选
  • CLOTHES
  • 实体type
  • └ order_id
  • Number
  • 可选
  • 1
  • 订单id
  • perform_operation_reqs
  • PerformOperationReq []
  • 必须
  • 工序请求
  • └ context
  • 可选
  • {"key" : "value"}
  • 上下文
  • └ device_ids
  • Number []
  • 可选
  • [1]
  • 设备id
  • └ flow_version
  • Number
  • 必须
  • 1
  • flow版本
  • └ operation_type
  • String
  • 必须
  • NORMAL
  • 工序类型
  • └ operation_uid
  • Number
  • 必须
  • 1
  • 工序唯一id
  • └ perform_status
  • String
  • 可选
  • PENDING
  • 执行状态
  • └ priority
  • Number
  • 必须
  • 0
  • 优先级
  • └ process_type_code
  • String
  • 必须
  • CJ
  • 工序类型码
  • └ section_code
  • String
  • 必须
  • C-C
  • 工段
  • └ work_nos
  • String []
  • 可选
  • []
  • 工号
  • └ workstation_code
  • String
  • 可选
  • CC-03
  • 工作站
  • └ process_cost_time
  • String
  • 可选
  • 10.2
  • 执行耗时
  • └ process_end_time
  • Date
  • 可选
  • 2020-04-02 12:00:00
  • 执行完成时间
  • └ process_start_time
  • Date
  • 可选
  • 2020-04-02 12:00:00
  • 执行开始时间
  • source
  • Source
  • 必须
  • 来源
  • └ source_id
  • String
  • 必须
  • 1
  • sourceId
  • └ source_type
  • String
  • 必须
  • SAAS-BED
  • sourceType
  • └ tenant_id
  • String
  • 必须
  • B001
  • 租户id
  • └ userid
  • String
  • 可选
  • 1
  • 用户id

响应参数

名称 类型 示例值 描述
external_msg_info String success 错误信息
errmsg String success 返回信息
model OperationPerformDto [] 返回结果
  • └ active
  • String
  • 1
  • 是否生效
  • └ batch_id
  • Number
  • 1
  • 批量id
  • └ context
  • Json
  • 上下文
  • └ create_type
  • String
  • NEW
  • 创建类型
  • └ device_ids
  • Number []
  • [1]
  • 设备id
  • └ entity_id
  • Number
  • 1
  • 实体id
  • └ entity_type
  • String
  • CLOTHES
  • 实体类型
  • └ flow_version
  • Number
  • 1
  • flow版本
  • └ id
  • Number
  • 1
  • 执行记录id
  • └ operation_type
  • String
  • NORMAL
  • 工序类型
  • └ operation_uid
  • Number
  • 1
  • 工序uid
  • └ order_id
  • Number
  • 1
  • 订单id
  • └ perform_status
  • String
  • PENDING
  • 执行状态
  • └ perform_type
  • String
  • REWORK
  • 执行类型
  • └ priority
  • Number
  • 0
  • 优先级
  • └ process_type_code
  • String
  • CJ
  • 工序类型code
  • └ processing_end_time
  • Date
  • 2019-01-01 00:00:00
  • 工序处理结束时间
  • └ processing_start_time
  • Date
  • 2019-01-01 00:00:00
  • 工序处理开始时间
  • └ section_code
  • String
  • C-C
  • 工段
  • └ source_id
  • String
  • 1
  • sourceId
  • └ source_type
  • String
  • SAAS-BED
  • source类型
  • └ tenant_id
  • String
  • B001
  • 租户id
  • └ work_nos
  • String []
  • []
  • 工号
  • └ workstation_code
  • String
  • CC-03
  • 站位
errcode Number 200 错误码

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/rhino/mos/exec/perform/batch/create");
OapiRhinoMosExecPerformBatchCreateRequest req = new OapiRhinoMosExecPerformBatchCreateRequest();
BatchCreateOperationWithEntityReq obj1 = new BatchCreateOperationWithEntityReq();
EntityCondition obj2 = new EntityCondition();
obj2.setEntityIds(new Long[] { 1 };
);
Source obj3 = new Source();
obj3.setSourceId("1");
obj3.setSourceType("SAAS-BED");
obj2.setEntitySource(obj3);
obj2.setEntityType("CLOTHES");
obj1.setEntityCondition(obj2);
obj1.setOrderId(1L);
List<PerformOperationReq> list5 = new ArrayList<PerformOperationReq>();
PerformOperationReq obj6 = new PerformOperationReq();
list5.add(obj6);
obj6.setDeviceIds(new Long[] { 1 };
);
obj6.setFlowVersion(1L);
obj6.setOperationType("NORMAL");
obj6.setOperationUid(1L);
obj6.setPerformStatus("PENDING");
obj6.setPriority(0L);
obj6.setProcessTypeCode("CJ");
obj6.setSectionCode("C-C");
obj6.setWorkNos("");
obj6.setWorkstationCode("CC-03");
obj6.setProcessCostTime("10.2");
obj6.setProcessEndTime(StringUtils.parseDateTime("2020-04-02 12:00:00"));
obj6.setProcessStartTime(StringUtils.parseDateTime("2020-04-02 12:00:00"));
obj1.setPerformOperationReqs(list5);
Source obj7 = new Source();
obj7.setSourceId("1");
obj7.setSourceType("SAAS-BED");
obj1.setSource(obj7);
obj1.setTenantId("B001");
obj1.setUserid("1");
req.setBatchCreateOperationReq(obj1);
OapiRhinoMosExecPerformBatchCreateResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
{
    "external_msg_info":"success",
    "errmsg":"success",
    "model":[
        {
                "active":"1",
                "batch_id":1,
                "context":"",
                "create_type":"NEW",
                "device_ids":{
                    "number":[
                        [1]
                    ]
                },
                "entity_id":1,
                "entity_type":"CLOTHES",
                "flow_version":1,
                "id":1,
                "operation_type":"NORMAL",
                "operation_uid":1,
                "order_id":1,
                "perform_status":"PENDING",
                "perform_type":"REWORK",
                "priority":0,
                "process_type_code":"CJ",
                "processing_end_time":"2019-01-01 00:00:00",
                "processing_start_time":"2019-01-01 00:00:00",
                "section_code":"C-C",
                "source_id":"1",
                "source_type":"SAAS-BED",
                "tenant_id":"B001",
                "work_nos":{
                    "string":[
                        "[]"
                    ]
                },
                "workstation_code":"CC-03"
        }
    ],
    "errcode":200
}

异常示例

  • JSON示例
{
	"errcode":88,
	"errmsg":"ding talk error"
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部