InventoryOccupyApplyRequest.php
3.14 KB
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
<?php
/**
* TOP API: taobao.inventory.occupy.apply request
*
* @author auto create
* @since 1.0, 2012-12-13 16:33:03
*/
class InventoryOccupyApplyRequest
{
/**
* 外部订单类型, BALANCE:盘点、NON_TAOBAO_TRADE:非淘宝交易、ALLOCATE:调拨、OTHERS:其他
**/
private $bizType;
/**
* 商家外部定单号
**/
private $bizUniqueCode;
/**
* 渠道编号
**/
private $channelFlags;
/**
* 商品库存预留信息: [{"scItemId":"商品后端ID,如果有传scItemCode,参数可以为0","scItemCode":"商品商家编码","inventoryType":"库存类型 1:正常,2:损坏,3:冻结,10:质押",11-20:商家自定义,”inventoryTypeName”:”库存类型名称,可选”,"occupyQuantity":"数量"}]
**/
private $items;
/**
* 天数,默认5天,最大15天
**/
private $occupyTime;
/**
* 占用类型
参数定义
AUTO_CALCULATE:自动计算可供占用,如果库存不够返回失败 ClIENT_FORCE:强制要求最大化占用,有多少占用多少
**/
private $occupyType;
/**
* 商家仓库编码
**/
private $storeCode;
private $apiParas = array();
public function setBizType($bizType)
{
$this->bizType = $bizType;
$this->apiParas["biz_type"] = $bizType;
}
public function getBizType()
{
return $this->bizType;
}
public function setBizUniqueCode($bizUniqueCode)
{
$this->bizUniqueCode = $bizUniqueCode;
$this->apiParas["biz_unique_code"] = $bizUniqueCode;
}
public function getBizUniqueCode()
{
return $this->bizUniqueCode;
}
public function setChannelFlags($channelFlags)
{
$this->channelFlags = $channelFlags;
$this->apiParas["channel_flags"] = $channelFlags;
}
public function getChannelFlags()
{
return $this->channelFlags;
}
public function setItems($items)
{
$this->items = $items;
$this->apiParas["items"] = $items;
}
public function getItems()
{
return $this->items;
}
public function setOccupyTime($occupyTime)
{
$this->occupyTime = $occupyTime;
$this->apiParas["occupy_time"] = $occupyTime;
}
public function getOccupyTime()
{
return $this->occupyTime;
}
public function setOccupyType($occupyType)
{
$this->occupyType = $occupyType;
$this->apiParas["occupy_type"] = $occupyType;
}
public function getOccupyType()
{
return $this->occupyType;
}
public function setStoreCode($storeCode)
{
$this->storeCode = $storeCode;
$this->apiParas["store_code"] = $storeCode;
}
public function getStoreCode()
{
return $this->storeCode;
}
public function getApiMethodName()
{
return "taobao.inventory.occupy.apply";
}
public function getApiParas()
{
return $this->apiParas;
}
public function check()
{
RequestCheckUtil::checkNotNull($this->bizType,"bizType");
RequestCheckUtil::checkNotNull($this->bizUniqueCode,"bizUniqueCode");
RequestCheckUtil::checkNotNull($this->items,"items");
RequestCheckUtil::checkNotNull($this->occupyTime,"occupyTime");
RequestCheckUtil::checkNotNull($this->occupyType,"occupyType");
RequestCheckUtil::checkNotNull($this->storeCode,"storeCode");
}
public function putOtherTextParam($key, $value) {
$this->apiParas[$key] = $value;
$this->$key = $value;
}
}