获取工单产品信息
操作场景
本章节指导用户通过调用API导入工单。
前提条件
- 已开通数字化制造基础服务(MBM Space),并根据开通区域确定调用API的Endpoint,详细信息请参见地区与终端节点。
假设数字化制造基础服务的访问网址为https://ipdcenter.cn-north-4.myhuaweicloud.com/mbm_app/xxxxxx#/xxxxxx,则调用数字化制造基础服务的API的Endpoint为访问网址中的ipdcenter.cn-north-4.myhuaweicloud.com/mbm_app/xxxxxx,即“https://”后至“#”前的内容。
- 当您使用Token认证方式完成认证鉴权时,需要获取用户Token并在调用接口时增加“X-Auth-Token”到业务接口请求消息头中。Token认证,具体操作请参考认证鉴权。
通过IAM服务获取到的Token有效期为24小时,需要使用同一个Token鉴权时,可以先将Token缓存,避免频繁调用。
操作步骤
- 获取接口相关信息。
URI格式:GET /wom/openapi/v1/wos/wo-part-info
详情请参见获取工单产品信息。
- 在Request Header中增加“X-Auth-Token”。
- 发送“GET https://{MBM Endpoint}/wom/openapi/v1/wos/wo-part-info”。
- 查看请求响应结果。
请求成功时,响应参数如下:
{ "status" : "200", "message" : "success", "data" : { "wo_info" : { "wo_id" : "1417639245421830258", "wo_order" : "WOP123456", "erp_wo_id" : "1457698771257845", "erp_wo_order" : "QWERTYUI", "parent_wo_id" : "1478932452572618", "parent_wo_order" : "WOP147369", "wo_type" : "10", "part_id" : "1564789221484123", "part_no" : "TEST2023", "part_desc" : "MODEL测试", "part_revision" : "1", "lot_unit" : 1, "wo_qty" : 100, "site_id" : "22DF4572394G485KF502", "site_no" : "TEST210213", "completed_qty" : 1, "wo_status" : "10", "hold_flag" : "0", "split_flag" : "1", "solution_flag" : "2", "sn_generate_flag" : "0", "erp_plan_start_date" : "2023-08-14 00:00:00", "erp_plan_end_date" : "2023-08-14 00:00:00", "data_source" : "MANUAL", "actual_wo_start_date" : "2023-08-14 00:00:00", "actual_wo_complete_date" : "2023-08-14 00:00:00", "org_id" : "1" }, "part_info" : { "part_id" : "147258369159753246", "part_no" : "012254736", "part_desc_en" : "MODEL测试", "part_desc" : "MODEL测试", "part_desc_ext" : "MODEL测试001", "part_desc_ext_en" : "MODEL测试001", "status" : 20, "part_status" : 1, "bulk_picked_flag" : "N", "model" : "HK537RX60", "ext_model" : "Default", "ext_model_4print" : "Default", "part_template_type" : "AI", "product_name" : "VIP888", "product_family_name" : "WIFI001", "product_line" : "网络", "default_workstep_info_id" : "157489325467962165", "container_part_flag" : "N", "container_capacity" : 0, "revision_control_flag" : "Y", "setup_flag" : "Y", "sn_type" : 0, "part_check_flag" : "Y", "preform_type" : 0, "unit" : "PCS", "inventory_item_id" : "1", "planning_make_buy_code" : "1", "part_grp_id" : "9179546248489855254588", "part_grp_no" : "0728", "category_code" : "0302", "category_name" : "制成板", "product_flag" : "1" } } }
请求异常时,错误码请参见错误码。