1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Abbotton\DouDian\Api; |
4
|
|
|
|
5
|
|
|
use Illuminate\Http\Client\RequestException; |
6
|
|
|
use Psr\SimpleCache\InvalidArgumentException; |
7
|
|
|
|
8
|
|
|
class Logistics extends BaseRequest |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* 获取区列表. |
12
|
|
|
* |
13
|
|
|
* @param array $params |
14
|
|
|
* @return array |
15
|
|
|
* @throws RequestException |
16
|
|
|
* @throws InvalidArgumentException |
17
|
|
|
*/ |
18
|
|
|
public function areaList(array $params): array |
19
|
|
|
{ |
20
|
|
|
return $this->httpPost('address/areaList', $params); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* 获取市列表. |
25
|
|
|
* |
26
|
|
|
* @param array $params |
27
|
|
|
* @return array |
28
|
|
|
* @throws RequestException |
29
|
|
|
* @throws InvalidArgumentException |
30
|
|
|
*/ |
31
|
|
|
public function cityList(array $params): array |
32
|
|
|
{ |
33
|
|
|
return $this->httpPost('address/cityList', $params); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* 获取省列表. |
38
|
|
|
* |
39
|
|
|
* @return array |
40
|
|
|
* @throws RequestException |
41
|
|
|
* @throws InvalidArgumentException |
42
|
|
|
*/ |
43
|
|
|
public function provinceList(): array |
44
|
|
|
{ |
45
|
|
|
return $this->httpPost('address/provinceList'); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* 订单发货. |
50
|
|
|
* |
51
|
|
|
* @param array $params |
52
|
|
|
* @return array |
53
|
|
|
* @throws RequestException |
54
|
|
|
* @throws InvalidArgumentException |
55
|
|
|
*/ |
56
|
|
|
public function add(array $params): array |
57
|
|
|
{ |
58
|
|
|
return $this->httpPost('order/logisticsAdd', $params); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* 一个父订单可发多个物流包裹. |
63
|
|
|
* |
64
|
|
|
* @param array $params |
65
|
|
|
* @return array |
66
|
|
|
* @throws RequestException |
67
|
|
|
* @throws InvalidArgumentException |
68
|
|
|
*/ |
69
|
|
|
public function addMultiPack(array $params): array |
70
|
|
|
{ |
71
|
|
|
return $this->httpPost('order/logisticsAddMultiPack', $params); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* 支持多个子订单发同一个物流包裹. |
76
|
|
|
* |
77
|
|
|
* @param array $params |
78
|
|
|
* @return array |
79
|
|
|
* @throws RequestException |
80
|
|
|
* @throws InvalidArgumentException |
81
|
|
|
*/ |
82
|
|
|
public function addSinglePack(array $params): array |
83
|
|
|
{ |
84
|
|
|
return $this->httpPost('order/logisticsAddSinglePack', $params); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* 获取快递公司列表. |
89
|
|
|
* |
90
|
|
|
* @return array |
91
|
|
|
* @throws RequestException |
92
|
|
|
* @throws InvalidArgumentException |
93
|
|
|
*/ |
94
|
|
|
public function companyList(): array |
95
|
|
|
{ |
96
|
|
|
return $this->httpPost('order/logisticsCompanyList'); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* 修改发货物流 |
101
|
|
|
* |
102
|
|
|
* @param array $params |
103
|
|
|
* @return array |
104
|
|
|
* @throws RequestException |
105
|
|
|
* @throws InvalidArgumentException |
106
|
|
|
*/ |
107
|
|
|
public function edit(array $params): array |
108
|
|
|
{ |
109
|
|
|
return $this->httpPost('order/logisticsEdit', $params); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* 修改包裹里的物流信息. |
114
|
|
|
* |
115
|
|
|
* @param array $params |
116
|
|
|
* @return array |
117
|
|
|
* @throws RequestException |
118
|
|
|
* @throws InvalidArgumentException |
119
|
|
|
*/ |
120
|
|
|
public function editByPack(array $params): array |
121
|
|
|
{ |
122
|
|
|
return $this->httpPost('order/logisticsEditByPack', $params); |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* 根据省获取全量四级地址. |
127
|
|
|
* |
128
|
|
|
* @param array $params |
129
|
|
|
* @return array |
130
|
|
|
* @throws InvalidArgumentException |
131
|
|
|
* @throws RequestException |
132
|
|
|
*/ |
133
|
|
|
public function getAreasByProvince(array $params): array |
134
|
|
|
{ |
135
|
|
|
return $this->httpPost('address/getAreasByProvince', $params); |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* 获取四级地址全量省份信息. |
140
|
|
|
* |
141
|
|
|
* @return array |
142
|
|
|
* @throws InvalidArgumentException |
143
|
|
|
* @throws RequestException |
144
|
|
|
*/ |
145
|
|
|
public function getProvince(): array |
146
|
|
|
{ |
147
|
|
|
return $this->httpPost('address/getProvince'); |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* 顺丰新下单接口. |
152
|
|
|
* |
153
|
|
|
* @param array $params |
154
|
|
|
* @return array |
155
|
|
|
* @throws InvalidArgumentException |
156
|
|
|
* @throws RequestException |
157
|
|
|
*/ |
158
|
|
|
public function createSFOrder(array $params): array |
159
|
|
|
{ |
160
|
|
|
return $this->httpPost('logistics/createSFOrder', $params); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* 用于ISV/商家ERP系统 端发起取消已获取的电子面单号. |
165
|
|
|
* |
166
|
|
|
* @param array $params |
167
|
|
|
* @return array |
168
|
|
|
* @throws InvalidArgumentException |
169
|
|
|
* @throws RequestException |
170
|
|
|
*/ |
171
|
|
|
public function cancelOrder(array $params): array |
172
|
|
|
{ |
173
|
|
|
return $this->httpPost('logistics/cancelOrder', $params); |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* 查询地址快递是否可以送达. |
178
|
|
|
* |
179
|
|
|
* @param array $params |
180
|
|
|
* @return array |
181
|
|
|
* @throws InvalidArgumentException |
182
|
|
|
* @throws RequestException |
183
|
|
|
*/ |
184
|
|
|
public function getOutRange(array $params): array |
185
|
|
|
{ |
186
|
|
|
return $this->httpPost('logistics/getOutRange', $params); |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* 查询商家和物流商的订购关系以及物流单号使用情况. |
191
|
|
|
* |
192
|
|
|
* @param array $params |
193
|
|
|
* @return array |
194
|
|
|
* @throws InvalidArgumentException |
195
|
|
|
* @throws RequestException |
196
|
|
|
*/ |
197
|
|
|
public function listShopNetsite(array $params): array |
198
|
|
|
{ |
199
|
|
|
return $this->httpPost('logistics/listShopNetsite', $params); |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* 商家ERP/ISV 向字节电子面单系统获取单号和打印信息. |
204
|
|
|
* |
205
|
|
|
* @param array $params |
206
|
|
|
* @return array |
207
|
|
|
* @throws InvalidArgumentException |
208
|
|
|
* @throws RequestException |
209
|
|
|
*/ |
210
|
|
|
public function newCreateOrder(array $params): array |
211
|
|
|
{ |
212
|
|
|
return $this->httpPost('logistics/newCreateOrder', $params); |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* 更新收件人信息 以及发件人名字联系方式信息,不支持顺丰速递面单信息更新. |
217
|
|
|
* |
218
|
|
|
* @param array $params |
219
|
|
|
* @return array |
220
|
|
|
* @throws InvalidArgumentException |
221
|
|
|
* @throws RequestException |
222
|
|
|
*/ |
223
|
|
|
public function updateOrder(array $params): array |
224
|
|
|
{ |
225
|
|
|
return $this->httpPost('logistics/updateOrder', $params); |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* 查询跨境订单列表. |
230
|
|
|
* |
231
|
|
|
* @param array $params |
232
|
|
|
* @return array |
233
|
|
|
* @throws InvalidArgumentException |
234
|
|
|
* @throws RequestException |
235
|
|
|
*/ |
236
|
|
|
public function orderList(array $params): array |
237
|
|
|
{ |
238
|
|
|
return $this->httpPost('crossBorder/orderList', $params); |
239
|
|
|
} |
240
|
|
|
} |
241
|
|
|
|