Passed
Push — main ( 33cb0c...67dbd0 )
by Abbotton
10:38
created

Logistics::deliveryNotice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
     *
15
     * @throws RequestException
16
     * @throws InvalidArgumentException
17
     *
18
     * @return array
19
     */
20
    public function add(array $params): array
21
    {
22
        return $this->httpPost('order/logisticsAdd', $params);
23
    }
24
25
    /**
26
     * 一个父订单可发多个物流包裹.
27
     *
28
     * @param array $params
29
     *
30
     * @throws RequestException
31
     * @throws InvalidArgumentException
32
     *
33
     * @return array
34
     */
35
    public function addMultiPack(array $params): array
36
    {
37
        return $this->httpPost('order/logisticsAddMultiPack', $params);
38
    }
39
40
    /**
41
     * 支持多个子订单发同一个物流包裹.
42
     *
43
     * @param array $params
44
     *
45
     * @throws RequestException
46
     * @throws InvalidArgumentException
47
     *
48
     * @return array
49
     */
50
    public function addSinglePack(array $params): array
51
    {
52
        return $this->httpPost('order/logisticsAddSinglePack', $params);
53
    }
54
55
    /**
56
     * 获取快递公司列表.
57
     *
58
     * @throws RequestException
59
     * @throws InvalidArgumentException
60
     *
61
     * @return array
62
     */
63
    public function companyList(): array
64
    {
65
        return $this->httpPost('order/logisticsCompanyList');
66
    }
67
68
    /**
69
     * 修改发货物流
70
     *
71
     * @param array $params
72
     *
73
     * @throws RequestException
74
     * @throws InvalidArgumentException
75
     *
76
     * @return array
77
     */
78
    public function edit(array $params): array
79
    {
80
        return $this->httpPost('order/logisticsEdit', $params);
81
    }
82
83
    /**
84
     * 修改包裹里的物流信息.
85
     *
86
     * @param array $params
87
     *
88
     * @throws RequestException
89
     * @throws InvalidArgumentException
90
     *
91
     * @return array
92
     */
93
    public function editByPack(array $params): array
94
    {
95
        return $this->httpPost('order/logisticsEditByPack', $params);
96
    }
97
98
    /**
99
     * 根据省获取全量四级地址.
100
     *
101
     * @param array $params
102
     *
103
     * @throws InvalidArgumentException
104
     * @throws RequestException
105
     *
106
     * @return array
107
     */
108
    public function getAreasByProvince(array $params): array
109
    {
110
        return $this->httpPost('address/getAreasByProvince', $params);
111
    }
112
113
    /**
114
     * 获取四级地址全量省份信息.
115
     *
116
     * @throws InvalidArgumentException
117
     * @throws RequestException
118
     *
119
     * @return array
120
     */
121
    public function getProvince(): array
122
    {
123
        return $this->httpPost('address/getProvince');
124
    }
125
126
    /**
127
     * 顺丰新下单接口.
128
     *
129
     * @param array $params
130
     *
131
     * @throws InvalidArgumentException
132
     * @throws RequestException
133
     *
134
     * @return array
135
     */
136
    public function createSFOrder(array $params): array
137
    {
138
        return $this->httpPost('logistics/createSFOrder', $params);
139
    }
140
141
    /**
142
     * 用于ISV/商家ERP系统 端发起取消已获取的电子面单号.
143
     *
144
     * @param array $params
145
     *
146
     * @throws InvalidArgumentException
147
     * @throws RequestException
148
     *
149
     * @return array
150
     */
151
    public function cancelOrder(array $params): array
152
    {
153
        return $this->httpPost('logistics/cancelOrder', $params);
154
    }
155
156
    /**
157
     * 查询地址快递是否可以送达.
158
     *
159
     * @param array $params
160
     *
161
     * @throws InvalidArgumentException
162
     * @throws RequestException
163
     *
164
     * @return array
165
     */
166
    public function getOutRange(array $params): array
167
    {
168
        return $this->httpPost('logistics/getOutRange', $params);
169
    }
170
171
    /**
172
     * 查询商家和物流商的订购关系以及物流单号使用情况.
173
     *
174
     * @param array $params
175
     *
176
     * @throws InvalidArgumentException
177
     * @throws RequestException
178
     *
179
     * @return array
180
     */
181
    public function listShopNetsite(array $params): array
182
    {
183
        return $this->httpPost('logistics/listShopNetsite', $params);
184
    }
185
186
    /**
187
     * 商家ERP/ISV 向字节电子面单系统获取单号和打印信息.
188
     *
189
     * @param array $params
190
     *
191
     * @throws InvalidArgumentException
192
     * @throws RequestException
193
     *
194
     * @return array
195
     */
196
    public function newCreateOrder(array $params): array
197
    {
198
        return $this->httpPost('logistics/newCreateOrder', $params);
199
    }
200
201
    /**
202
     * 更新收件人信息 以及发件人名字联系方式信息,不支持顺丰速递面单信息更新.
203
     *
204
     * @param array $params
205
     *
206
     * @throws InvalidArgumentException
207
     * @throws RequestException
208
     *
209
     * @return array
210
     */
211
    public function updateOrder(array $params): array
212
    {
213
        return $this->httpPost('logistics/updateOrder', $params);
214
    }
215
216
    /**
217
     * 提供给isv查询运单轨迹的接口.
218
     *
219
     * @param array $params
220
     *
221
     * @throws InvalidArgumentException
222
     * @throws RequestException
223
     *
224
     * @return array
225
     */
226
    public function trackNoRouteDetail(array $params): array
227
    {
228
        return $this->httpPost('logistics/trackNoRouteDetail', $params);
229
    }
230
231
    /**
232
     * 查询商家自定义区模板(新版).
233
     *
234
     * @param array $params
235
     *
236
     * @throws InvalidArgumentException
237
     * @throws RequestException
238
     *
239
     * @return array
240
     */
241
    public function getCustomTemplateList(array $params): array
242
    {
243
        return $this->httpPost('logistics/getCustomTemplateList', $params);
244
    }
245
246
    /**
247
     * 获取商家所有模版信息.
248
     *
249
     * @param  array  $params
250
     * @return array
251
     * @throws InvalidArgumentException
252
     * @throws RequestException
253
     */
254
    public function templateList(array $params): array
255
    {
256
        return $this->httpPost('logistics/templateList', $params);
257
    }
258
259
    /**
260
     * 获取面单信息.
261
     *
262
     * @param  array  $params
263
     * @return array
264
     * @throws InvalidArgumentException
265
     * @throws RequestException
266
     */
267
    public function waybillApply(array $params): array
268
    {
269
        return $this->httpPost('logistics/waybillApply', $params);
270
    }
271
272
    /**
273
     * 追加子母件.
274
     *
275
     * @param  array  $params
276
     * @return array
277
     * @throws InvalidArgumentException
278
     * @throws RequestException
279
     */
280
    public function appendSubOrder(array $params): array
281
    {
282
        return $this->httpPost('logistics/appendSubOrder', $params);
283
    }
284
285
    /**
286
     * 订单放行/回退.
287
     *
288
     * @param  array  $params
289
     * @return array
290
     * @throws InvalidArgumentException
291
     * @throws RequestException
292
     */
293
    public function deliveryNotice(array $params): array
294
    {
295
        return $this->httpPost('logistics/deliveryNotice', $params);
296
    }
297
}
298