帮助中心
帮助中心主页
HTTP API
Modbus API
常见问题
分页查询运单信息

请求

  • 功能:通过参数分页查询系统内的运单集合,查询参数中的 page 和 size 等均为示例,即本接口可以通过多种方式过滤和排序。
  • 方法:GET
  • 接口说明:/orders
json
GET "http://host:8088/orders"
1

请求参数

NameTypeDescriptionRequired
pagenumber页码数,如果不传默认为1
sizenumber每页运单数量,如果不传默认为20
orderBystring排序的字段,可以为运单信息中的任意字段,默认为 createTime
orderMethodstring排序方法,可以为 descending 和 ascending,默认为 descending 降序
whereobject string过滤条件,为 JSON 字符串,不传时不做过滤,详情见过滤条件

排序字段

对于运单,支持排序的字段有:

  • id
  • state
  • msg
  • complete
  • terminalTime
  • terminateTime
  • createTime
  • receiveTime
  • executionTimeCost
  • type
  • vehicle
  • startOdo
  • finishOdo
  • orderOdo
  • keyRoute
  • group
  • externalId
  • label
  • priority

过滤条件

json
{
    "relation":"AND", // 表示多个查询条件的组合方式,支持AND, OR
    "predicates":[ // 每列的条件,格式为 [列名,操作符,值],三个字符串,支持的操作有:GT, LT, EQ, LIKE, NE, IN
        ["createTime", "GT", "1642846097186"], // 创建时间大于指定值
        ["createTime", "LT", "1642846097200"], // 创建时间小于指定值
        ["vehicle", "EQ", "AMB-01"], // 执行机器人为 AMB-01
        ["state", "EQ", "FINISHED"] // 状态为 FINISHED
    ]
}
1
2
3
4
5
6
7
8
9

对于运单,支持过滤的字段有:

  • id
  • vehicle
  • createTime
  • state
  • complete
  • type

URL 编码

对于JSON中的特殊字符,需要使用百分号编码

编码前
json
{"relation":"AND","predicates":[["createTime","GT","1642846097186"],["createTime","LT","1645524497186"]]}
1

编码后
json
%7B%22relation%22:%22AND%22,%22predicates%22:%5B%5B%22createTime%22,%22GT%22,1642846097186%5D,%5B%22createTime%22,%22LT%22,1645524497186%5D%5D%7D
1

完整的请求示例
json
GET "http://host:8088/orders?page=1&size=20&orderBy=createTime&orderMethod=descending&where=%7B%22relation%22:%22AND%22,%22predicates%22:%5B%5B%22createTime%22,%22GT%22,1642846097186%5D,%5B%22createTime%22,%22LT%22,1645524497186%5D%5D%7D"
1

请求示例

按照 createTime 字段降序排序,取第二页的20个运单信息,如果第二页运单数量不足20,则取第二页的全部运单信息

json
GET "http://host:8088/orders?page=2&size=20&orderBy=createTime&orderMethod=descending"
1

按照 terminalTime 字段升序排序,取第一页的30个运单信息,如果第一页运单数量不足30,则取第一页的全部运单信息

json
GET "http://host:8088/orders?page=1&size=30&orderBy=createTime&orderMethod=ascending"
1

响应

响应数据

NameTypeDescription
listobject array运单信息数组,详情见查询运单
pageint页码数,默认为1
sizeint每页条数,默认为20
totalint运单的总数

响应示例

Responses Code 200

成功响应

0.1.8.220922 版本之前 operation_args 和 script_args 返回类型 json string。
0.1.8.220922版本之后 operation_args 和 script_args 返回类型是 json object。

json
{
    "list": [        // orders list
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "b0862b13-335e-4e7d-88f2-5c41f4f61c21",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "RUNNING"
                }
            ],
            "complete": false,
            "createTime": 1640081982,
            "group": "",
            "id": "818f193c-8950-4931-ae2b-2e4b4c7bc048",
            "msg": "",
            "state": "RUNNING",
            "terminalTime": 0,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "078409df-6f15-4379-b12a-eaf0015c3768",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "ee181abf-e0ac-48a1-87c9-b09c6c7e5698",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081915,
            "group": "",
            "id": "f51f3427-f85b-4659-b84f-120cd0f63cd5",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081982,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "a5c24466-8c7a-468b-a54b-14be9fefb9ae",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "28c7b05e-1087-4557-9e8d-7daeb2e90bac",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081825,
            "group": "",
            "id": "bf5dfa95-5f39-4805-8ac1-95456d78e737",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081915,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "b67f0ca8-9504-43f0-bc36-ac2ef71aaff4",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "684a2ab3-7d63-485e-abcc-613920f4ba26",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081758,
            "group": "",
            "id": "6449f7f0-083d-4a23-8dbb-e0be4636ff47",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081825,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "efc7d235-f9c7-4a38-b89d-924add92be37",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "6f3bd107-6f45-4a94-a34c-c7a69c4ab81a",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": "null",
                    "recognize": false,
                    "script_args": "null",
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081690,
            "group": "",
            "id": "f881ffad-0500-4006-877d-278de06b37e2",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081757,
            "type": 0,
            "vehicle": "2000-1"
        }
    ],
    "page": 1,        // 页码数,默认为1
    "size": 5,        // 每页默认为20
    "total": 42        // 订单的总数
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
json
{
    "list": [        // orders list
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "b0862b13-335e-4e7d-88f2-5c41f4f61c21",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "RUNNING"
                }
            ],
            "complete": false,
            "createTime": 1640081982,
            "group": "",
            "id": "818f193c-8950-4931-ae2b-2e4b4c7bc048",
            "msg": "",
            "state": "RUNNING",
            "terminalTime": 0,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "078409df-6f15-4379-b12a-eaf0015c3768",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "ee181abf-e0ac-48a1-87c9-b09c6c7e5698",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081915,
            "group": "",
            "id": "f51f3427-f85b-4659-b84f-120cd0f63cd5",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081982,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "a5c24466-8c7a-468b-a54b-14be9fefb9ae",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "28c7b05e-1087-4557-9e8d-7daeb2e90bac",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081825,
            "group": "",
            "id": "bf5dfa95-5f39-4805-8ac1-95456d78e737",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081915,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "b67f0ca8-9504-43f0-bc36-ac2ef71aaff4",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "684a2ab3-7d63-485e-abcc-613920f4ba26",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": {}, 
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081758,
            "group": "",
            "id": "6449f7f0-083d-4a23-8dbb-e0be4636ff47",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081825,
            "type": 0,
            "vehicle": "2000-1"
        },
        {
            "blocks": [
                {
                    "binTask": "",
                    "blockId": "efc7d235-f9c7-4a38-b89d-924add92be37",
                    "goodsId": "",
                    "location": "AP3",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                },
                {
                    "binTask": "",
                    "blockId": "6f3bd107-6f45-4a94-a34c-c7a69c4ab81a",
                    "goodsId": "",
                    "location": "AP13",
                    "operation": "",
                    "operation_args": {},
                    "recognize": false,
                    "script_args": {},
                    "script_name": "",
                    "state": "FINISHED"
                }
            ],
            "complete": true,
            "createTime": 1640081690,
            "group": "",
            "id": "f881ffad-0500-4006-877d-278de06b37e2",
            "msg": "",
            "state": "FINISHED",
            "terminalTime": 1640081757,
            "type": 0,
            "vehicle": "2000-1"
        }
    ],
    "page": 1,        // 页码数,默认为1
    "size": 5,        // 每页默认为20
    "total": 42        // 订单的总数
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

Responses Code 400

page 不为有效数字
json
{
    "code": 50003,
    "create_on": "2022-05-18T15:35:55.604Z",
    "msg": "query param page is illegal"
}
1
2
3
4
5

page 溢出
json
{
    "code": 50002,
    "create_on": "2022-05-18T15:36:30.722Z",
    "msg": "page out of range"
}
1
2
3
4
5

size 不为有效数字
json
{
    "code": 50003,
    "create_on": "2022-05-18T15:37:37.366Z",
    "msg": "query param size is illegal"
}
1
2
3
4
5

size 溢出
json
{
    "code": 50002,
    "create_on": "2022-05-18T15:38:02.768Z",
    "msg": "size out of range"
}
1
2
3
4
5

orderBy 类型不支持
json
{
    "code": 50003,
    "create_on": "2022-05-18T15:39:05.229Z",
    "msg": "query param orderBy is not supported"
}
1
2
3
4
5

orderMethod 类型不支持
json
{
    "code": 50003,
    "create_on": "2022-05-18T15:40:03.539Z",
    "msg": "query param orderMethod is not supported"
}
1
2
3
4
5
最近更新 2022/11/28
文章内容

请求

请求参数

排序字段

过滤条件

URL 编码

请求示例

按照 createTime 字段降序排序,取第二页的20个运单信息,如果第二页运单数量不足20,则取第二页的全部运单信息

按照 terminalTime 字段升序排序,取第一页的30个运单信息,如果第一页运单数量不足30,则取第一页的全部运单信息

响应

响应数据

响应示例

Responses Code 200

Responses Code 400