1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Abbotton\DouDian\Api; |
4
|
|
|
|
5
|
|
|
use Illuminate\Http\Client\RequestException; |
6
|
|
|
use Psr\SimpleCache\InvalidArgumentException; |
7
|
|
|
|
8
|
|
|
class WareHouse extends BaseRequest |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* 查询库存. |
12
|
|
|
* |
13
|
|
|
* @param array $params |
14
|
|
|
* @return array |
15
|
|
|
* @throws RequestException |
16
|
|
|
* @throws InvalidArgumentException |
17
|
|
|
*/ |
18
|
|
|
public function stockNum(array $params): array |
19
|
|
|
{ |
20
|
|
|
return $this->httpPost('sku/stockNum', $params); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* 创建单个区域仓. |
25
|
|
|
* |
26
|
|
|
* @param array $params |
27
|
|
|
* @return array |
28
|
|
|
* @throws RequestException |
29
|
|
|
* @throws InvalidArgumentException |
30
|
|
|
*/ |
31
|
|
|
public function create(array $params): array |
32
|
|
|
{ |
33
|
|
|
return $this->httpPost('warehouse/create', $params); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* 批量创建区域仓. |
38
|
|
|
* |
39
|
|
|
* @param array $params |
40
|
|
|
* @return array |
41
|
|
|
* @throws RequestException |
42
|
|
|
* @throws InvalidArgumentException |
43
|
|
|
*/ |
44
|
|
|
public function createBatch(array $params): array |
45
|
|
|
{ |
46
|
|
|
return $this->httpPost('warehouse/createBatch', $params); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* 编辑区域仓. |
51
|
|
|
* |
52
|
|
|
* @param array $params |
53
|
|
|
* @return array |
54
|
|
|
* @throws RequestException |
55
|
|
|
* @throws InvalidArgumentException |
56
|
|
|
*/ |
57
|
|
|
public function edit(array $params): array |
58
|
|
|
{ |
59
|
|
|
return $this->httpPost('warehouse/edit', $params); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* 查询区域仓. |
64
|
|
|
* |
65
|
|
|
* @param array $params |
66
|
|
|
* @return array |
67
|
|
|
* @throws RequestException |
68
|
|
|
* @throws InvalidArgumentException |
69
|
|
|
*/ |
70
|
|
|
public function info(array $params): array |
71
|
|
|
{ |
72
|
|
|
return $this->httpPost('warehouse/info', $params); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* 批量查询区域仓. |
77
|
|
|
* |
78
|
|
|
* @param array $params |
79
|
|
|
* @return array |
80
|
|
|
* @throws RequestException |
81
|
|
|
* @throws InvalidArgumentException |
82
|
|
|
*/ |
83
|
|
|
public function list(array $params): array |
84
|
|
|
{ |
85
|
|
|
return $this->httpPost('warehouse/list', $params); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* 地址与区域仓解绑. |
90
|
|
|
* |
91
|
|
|
* @param array $params |
92
|
|
|
* @return array |
93
|
|
|
* @throws RequestException |
94
|
|
|
* @throws InvalidArgumentException |
95
|
|
|
*/ |
96
|
|
|
public function removeAddr(array $params): array |
97
|
|
|
{ |
98
|
|
|
return $this->httpPost('warehouse/removeAddr', $params); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* 绑定单个地址到区域仓. |
103
|
|
|
* |
104
|
|
|
* @param array $params |
105
|
|
|
* @return array |
106
|
|
|
* @throws RequestException |
107
|
|
|
* @throws InvalidArgumentException |
108
|
|
|
*/ |
109
|
|
|
public function setAddr(array $params): array |
110
|
|
|
{ |
111
|
|
|
return $this->httpPost('warehouse/setAddr', $params); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* 批量绑定地址与区域仓. |
116
|
|
|
* |
117
|
|
|
* @param array $params |
118
|
|
|
* @return array |
119
|
|
|
* @throws RequestException |
120
|
|
|
* @throws InvalidArgumentException |
121
|
|
|
*/ |
122
|
|
|
public function setAddrBatch(array $params): array |
123
|
|
|
{ |
124
|
|
|
return $this->httpPost('warehouse/setAddrBatch', $params); |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* 设置指定地址下的仓的优先级. |
129
|
|
|
* |
130
|
|
|
* @param array $params |
131
|
|
|
* @return array |
132
|
|
|
* @throws RequestException |
133
|
|
|
* @throws InvalidArgumentException |
134
|
|
|
*/ |
135
|
|
|
public function setPriority(array $params): array |
136
|
|
|
{ |
137
|
|
|
return $this->httpPost('warehouse/setPriority', $params); |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* 设置sku发货时效. |
142
|
|
|
* |
143
|
|
|
* @param array $params |
144
|
|
|
* @return array |
145
|
|
|
* @throws InvalidArgumentException |
146
|
|
|
* @throws RequestException |
147
|
|
|
*/ |
148
|
|
|
public function setSkuShipTime(array $params): array |
149
|
|
|
{ |
150
|
|
|
return $this->httpPost('promise/setSkuShipTime', $params); |
151
|
|
|
} |
152
|
|
|
} |
153
|
|
|
|