更新时间:2024-06-25 GMT+08:00
分享

查询单个任务

功能介绍

该API用于查询并显示单个任务详情

URI

GET /v2/{project_id}/optverse/regular-plate/tasks/{task_id}

请求参数

表1 参数说明

参数

参数类型

说明

task_id

String

任务ID

请求消息

请求样例

GET /v2/{project_id}/optverse/regular-plate/tasks/40a8175b-701a-47cf-8b56-64875cabcd25

响应参数

表2 响应参数说明

参数

参数类型

说明

error_detail

String

如果运行出错会提示

result

Object

如果运行正常会在该属性内给出结果

status

String

任务运行状态,详情请参见表3

task_id

String

任务id

result_list

Array of objects

切割方案列表

plan_info

Array of objects

切割方案的统计信息列表

cut_file

String

以字符串形式保存的切割方案文件

plan_name

String

此方案序号(根据参数设置可给出多组方案)

material_info

String

统计信息,详情请参见表4

material_name

String

材料名称

problem_id

Int

按材料划分的问题序列号

表3 任务状态说明

状态

说明

waiting

在任务队列中,等待执行, 当等待时间超过一定时间,会超时,转为abnormal状态

running

任务正在执行

finished

任务成功运行结束,通过`result`获取结果

failed

任务执行出错,通过`error_detail`获取错误信息

abnormal

任务异常,可能是排队超时,可能是重试次数超时,可能是计算时间超时,通过`error_detail`获取错误信息

表4 统计信息响应参数说明

参数

单位

参数类型

说明

cut_length

米(m)

float

切割长度

cut_sum

-

Int

切割刀数

cut_time

分钟(min)

float

锯切时间

item_num

-

Int

开料件数

material

-

String

材料

program_num

-

Int

锯切图数量

run_program_num

-

Int

运行的锯切图数

rate

百分比(%)

float

原材料利用率

sum_area

平方米(m2)

float

原材料使用面积

sum_cost

-

Float

锯切成本

sum_plate_num

-

Int

原材料使用数量

sum_used_area

平方米(m2)

float

原材料利用面积

响应示例

成功响应示例
{
    "result": {
        "result_list": [
            {
                "cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
                "plan_info": [
                    {
                        "material_info": {
                            "cut_length": 5.02,
                            "cut_sum": 5,
                            "cut_time": 1.1,
                            "item_num": 2,
                            "material": "18MM_PLATE",
                            "program_num": 1,
                            "rate": 0.02229,
                            "run_program_num": 1,
                            "sum_area": 2.98,
                            "sum_cost": 103.67,
                            "sum_plate_num": 1,
                            "sum_used_area": 0.07
                        },
                        "material_name": "18MM_PLATE",
                        "problem_id": 1
                    }
                ],
                "plan_name": "方案1"
            },
            {
                "cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
                "plan_info": [
                    {
                        "material_info": {
                            "cut_length": 5.02,
                            "cut_sum": 5,
                            "cut_time": 1.1,
                            "item_num": 2,
                            "material": "18MM_PLATE",
                            "program_num": 1,
                            "rate": 0.02229,
                            "run_program_num": 1,
                            "sum_area": 2.98,
                            "sum_cost": 103.67,
                            "sum_plate_num": 1,
                            "sum_used_area": 0.07
                        },
                        "material_name": "18MM_PLATE",
                        "problem_id": 1
                    }
                ],
                "plan_name": "方案2"
            },
            {
                "cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
                "plan_info": [
                    {
                        "material_info": {
                            "cut_length": 5.02,
                            "cut_sum": 5,
                            "cut_time": 1.1,
                            "item_num": 2,
                            "material": "18MM_PLATE",
                            "program_num": 1,
                            "rate": 0.02229,
                            "run_program_num": 1,
                            "sum_area": 2.98,
                            "sum_cost": 103.67,
                            "sum_plate_num": 1,
                            "sum_used_area": 0.07
                        },
                        "material_name": "18MM_PLATE",
                        "problem_id": 1
                    }
                ],
                "plan_name": "方案3"
            },
            {
                "cut_file": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><AutoCut ver=\"100\"><Project Name=\"订单\" CutTime=\"999.99\" Selected=\"-1\" ApplictionVer=\"1.0.0\" Update=\"2020-4-22 11:14:00\"><Data Class=\"3\" TotalUnit=\"1000000\" Type=\"18.0_18MM_PLATE\" Ply=\"18.0\" Grain=\"True\"><Objective Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Objective><Substitute Type=\"Shape\" Count=\"1\"><Shape X=\"60.0\" Y=\"553.0\" Turn=\"True\" Count=\"1\" Name=\"底板\" TLType=\"18MM_PLATE_18.0mm\" FH=\"18.0\" item_code=\"小板标识\" order_code=\"订单号\" plan_code=\"批次号\"/></Substitute><Condition Type=\"Shape\" Count=\"1\"><Shape Name=\"18MM_PLATE\" X=\"2440.0\" Y=\"1220.0\" Turn=\"True\" Sx=\"10.0\" Sy=\"10.0\" Count=\"9999\"/></Condition><Solutions Selected=\"0\"><Solution SolverName=\"排料名称\" SolveGap=\"4.4\" SheetCounts=\"1\" SumUnitArea=\"66360.0\" SumSheetArea=\"2976800.0\" SumSpareArea=\"2910440.0\"><Layouts><Layout ID=\"0\" SheetID=\"0\" Count=\"1\" Cut=\"False\" X=\"2440.0\" Y=\"1220.0\" UnitArea=\"66360.0\" SheetArea=\"2976800.0\" SpareArea=\"2910440.0\"><Part X=\"1212.2\" Y=\"2432.2\" Px=\"7.8\" Py=\"7.8\"><Part X=\"2432.2\" Y=\"60.0\" Px=\"7.8\" Py=\"7.8\"><Part X=\"60.0\" Y=\"553.0\" Px=\"7.8\" Py=\"7.8\" Turn=\"False\" UID=\"0\" BID=\"0\" Angle=\"90\"/><Substitute X=\"60.0\" Y=\"553.0\" Px=\"565.2\" Py=\"7.8\" Turn=\"False\" SID=\"0\" BID=\"0\" Angle=\"90\"/></Part></Part></Layout></Layouts></Solution></Solutions></Data></Project></AutoCut>",
                "plan_info": [
                    {
                        "material_info": {
                            "cut_length": 5.02,
                            "cut_sum": 5,
                            "cut_time": 1.1,
                            "item_num": 2,
                            "material": "18MM_PLATE",
                            "program_num": 1,
                            "rate": 0.02229,
                            "run_program_num": 1,
                            "sum_area": 2.98,
                            "sum_cost": 103.67,
                            "sum_plate_num": 1,
                            "sum_used_area": 0.07
                        },
                        "material_name": "18MM_PLATE",
                        "problem_id": 1
                    }
                ],
                "plan_name": "方案4"
            }
        ]
    },
    "status": "finished",
    "task_id": "40axxxxx-701a-47cf-8b56-648xxxxxxx25"
}

相关文档