View Javadoc
1   package org.oxerr.youzan.dto.ump;
2   
3   import java.io.Serializable;
4   import java.math.BigDecimal;
5   import java.time.Instant;
6   
7   import org.oxerr.youzan.dto.deserializer.InstantDeserializer;
8   
9   import com.fasterxml.jackson.annotation.JsonProperty;
10  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11  
12  /**
13   * <a href="http://open.youzan.com/structparam?struct=UmpCoupon">优惠数据结构(优惠券、
14   * 优惠码的通用结构)</a>.
15   */
16  public class UmpCoupon implements Serializable {
17  
18  	private static final long serialVersionUID = 2016062501L;
19  
20  	/**
21  	 * 是否设置满多少元可用
22  	 */
23  	private Boolean isAtLeast;
24  
25  	/**
26  	 * 优惠结束时间
27  	 */
28  	private Instant endAt;
29  
30  	/**
31  	 * 是否同步微信卡券
32  	 */
33  	private Boolean isSyncWeixin;
34  
35  	/**
36  	 * 是否是随机优惠
37  	 */
38  	private Boolean isRandom;
39  
40  	/**
41  	 * 是否仅原价购买商品时可用
42  	 */
43  	private Boolean isForbidPreference;
44  
45  	/**
46  	 * 使用说明
47  	 */
48  	private String description;
49  
50  	/**
51  	 * 优惠标题
52  	 */
53  	private String title;
54  
55  	/**
56  	 * 优惠生效时间
57  	 */
58  	private Instant startAt;
59  
60  	/**
61  	 * 总库存
62  	 */
63  	private Long total;
64  
65  	/**
66  	 * 是否到期前4天发送提醒
67  	 */
68  	private Boolean expireNotice;
69  
70  	/**
71  	 * 每人限领个数,为 0 则表示不限制
72  	 */
73  	private Long quota;
74  
75  	/**
76  	 * 剩余可用库存
77  	 */
78  	private Long stock;
79  
80  	/**
81  	 * 优惠面额。如果 is_random 为 1,则该字段表示随机金额的下限。单位:元,精确到分。
82  	 */
83  	private BigDecimal value;
84  
85  	/**
86  	 * 领取优惠的次数
87  	 */
88  	private Long statFetchNum;
89  
90  	/**
91  	 * 如果 is_random 为 1,则该字段表示随机金额的上限。单位:元,精确到分。
92  	 */
93  	private BigDecimal valueRandomTo;
94  
95  	/**
96  	 * 是否可分享领取链接
97  	 */
98  	private Boolean isShare;
99  
100 	/**
101 	 * 使用优惠的次数
102 	 */
103 	private Long statUseNum;
104 
105 	/**
106 	 * 领取优惠的人数
107 	 */
108 	private Long statFetchUserNum;
109 
110 	/**
111 	 * 优惠创建时间
112 	 */
113 	private Instant created;
114 
115 	/**
116 	 * 可用范围的类型,可选值:
117 	 * <ul>
118 	 * <li>PART(部分商品可用,或指定商品可用)</li>
119 	 * <li>ALL(全部商品可用)</li>
120 	 * </ul>
121 	 */
122 	private String rangeType;
123 
124 	/**
125 	 * 优惠领取链接
126 	 */
127 	private String fetchUrl;
128 
129 	/**
130 	 * 限制领用者等级的名称
131 	 */
132 	private String userLevelName;
133 
134 	/**
135 	 * 优惠的ID
136 	 */
137 	private Long groupId;
138 
139 	/**
140 	 * 微信卡券ID
141 	 */
142 	private String weixinCardId;
143 
144 	/**
145 	 * 优惠的类型。可选值:
146 	 * <ul>
147 	 * <li>PROMOCARD(优惠券)</li>
148 	 * <li>PROMOCODE(优惠码)</li>
149 	 * </ul>
150 	 */
151 	private String couponType;
152 
153 	/**
154 	 * 是否限制领用者的等级,0 表示不限制,大于 0 表示领用者必须是这个等级ID
155 	 */
156 	private Integer needUserLevel;
157 
158 	/**
159 	 * 如果 is_at_least 为 1,该字段表示订单必须满这个价格,优惠才可用。单位:元,精确到分。
160 	 */
161 	private BigDecimal atLeast;
162 
163 	/**
164 	 * 优惠状态,0 表示有效,1 表示失效,2 表示微信卡券审核中
165 	 */
166 	private Integer status;
167 
168 	public UmpCoupon() {
169 	}
170 
171 	public UmpCoupon(
172 		@JsonProperty("is_at_least") Boolean isAtLeast,
173 		@JsonProperty("end_at")
174 		@JsonDeserialize(using = InstantDeserializer.class)
175 		Instant endAt,
176 		@JsonProperty("is_sync_weixin") Boolean isSyncWeixin,
177 		@JsonProperty("is_random") Boolean isRandom,
178 		@JsonProperty("is_forbid_preference") Boolean isForbidPreference,
179 		@JsonProperty("description") String description,
180 		@JsonProperty("title") String title,
181 		@JsonProperty("start_at")
182 		@JsonDeserialize(using = InstantDeserializer.class)
183 		Instant startAt,
184 		@JsonProperty("total") Long total,
185 		@JsonProperty("expire_notice") Boolean expireNotice,
186 		@JsonProperty("quota") Long quota,
187 		@JsonProperty("stock") Long stock,
188 		@JsonProperty("value") BigDecimal value,
189 		@JsonProperty("stat_fetch_num") Long statFetchNum,
190 		@JsonProperty("value_random_to") BigDecimal valueRandomTo,
191 		@JsonProperty("is_share") Boolean isShare,
192 		@JsonProperty("stat_use_num") Long statUseNum,
193 		@JsonProperty("stat_fetch_user_num") Long statFetchUserNum,
194 		@JsonProperty("created")
195 		@JsonDeserialize(using = InstantDeserializer.class)
196 		Instant created,
197 		@JsonProperty("range_type") String rangeType,
198 		@JsonProperty("fetch_url") String fetchUrl,
199 		@JsonProperty("user_level_name") String userLevelName,
200 		@JsonProperty("group_id") Long groupId,
201 		@JsonProperty("weixin_card_id") String weixinCardId,
202 		@JsonProperty("coupon_type") String couponType,
203 		@JsonProperty("need_user_level") Integer needUserLevel,
204 		@JsonProperty("at_least") BigDecimal atLeast,
205 		@JsonProperty("status") Integer status
206 	) {
207 		this.isAtLeast = isAtLeast;
208 		this.endAt = endAt;
209 		this.isSyncWeixin = isSyncWeixin;
210 		this.isRandom = isRandom;
211 		this.isForbidPreference = isForbidPreference;
212 		this.description = description;
213 		this.title = title;
214 		this.startAt = startAt;
215 		this.total = total;
216 		this.expireNotice = expireNotice;
217 		this.quota = quota;
218 		this.stock = stock;
219 		this.value = value;
220 		this.statFetchNum = statFetchNum;
221 		this.valueRandomTo = valueRandomTo;
222 		this.isShare = isShare;
223 		this.statUseNum = statUseNum;
224 		this.statFetchUserNum = statFetchUserNum;
225 		this.created = created;
226 		this.rangeType = rangeType;
227 		this.fetchUrl = fetchUrl;
228 		this.userLevelName = userLevelName;
229 		this.groupId = groupId;
230 		this.weixinCardId = weixinCardId;
231 		this.couponType = couponType;
232 		this.needUserLevel = needUserLevel;
233 		this.atLeast = atLeast;
234 		this.status = status;
235 	}
236 
237 	public Boolean getIsAtLeast() {
238 		return isAtLeast;
239 	}
240 
241 	public void setIsAtLeast(Boolean isAtLeast) {
242 		this.isAtLeast = isAtLeast;
243 	}
244 
245 	public Instant getEndAt() {
246 		return endAt;
247 	}
248 
249 	public void setEndAt(Instant endAt) {
250 		this.endAt = endAt;
251 	}
252 
253 	public Boolean getIsSyncWeixin() {
254 		return isSyncWeixin;
255 	}
256 
257 	public void setIsSyncWeixin(Boolean isSyncWeixin) {
258 		this.isSyncWeixin = isSyncWeixin;
259 	}
260 
261 	public Boolean getIsRandom() {
262 		return isRandom;
263 	}
264 
265 	public void setIsRandom(Boolean isRandom) {
266 		this.isRandom = isRandom;
267 	}
268 
269 	public Boolean getIsForbidPreference() {
270 		return isForbidPreference;
271 	}
272 
273 	public void setIsForbidPreference(Boolean isForbidPreference) {
274 		this.isForbidPreference = isForbidPreference;
275 	}
276 
277 	public String getDescription() {
278 		return description;
279 	}
280 
281 	public void setDescription(String description) {
282 		this.description = description;
283 	}
284 
285 	public String getTitle() {
286 		return title;
287 	}
288 
289 	public void setTitle(String title) {
290 		this.title = title;
291 	}
292 
293 	public Instant getStartAt() {
294 		return startAt;
295 	}
296 
297 	public void setStartAt(Instant startAt) {
298 		this.startAt = startAt;
299 	}
300 
301 	public Long getTotal() {
302 		return total;
303 	}
304 
305 	public void setTotal(Long total) {
306 		this.total = total;
307 	}
308 
309 	public Boolean getExpireNotice() {
310 		return expireNotice;
311 	}
312 
313 	public void setExpireNotice(Boolean expireNotice) {
314 		this.expireNotice = expireNotice;
315 	}
316 
317 	public Long getQuota() {
318 		return quota;
319 	}
320 
321 	public void setQuota(Long quota) {
322 		this.quota = quota;
323 	}
324 
325 	public Long getStock() {
326 		return stock;
327 	}
328 
329 	public void setStock(Long stock) {
330 		this.stock = stock;
331 	}
332 
333 	public BigDecimal getValue() {
334 		return value;
335 	}
336 
337 	public void setValue(BigDecimal value) {
338 		this.value = value;
339 	}
340 
341 	public Long getStatFetchNum() {
342 		return statFetchNum;
343 	}
344 
345 	public void setStatFetchNum(Long statFetchNum) {
346 		this.statFetchNum = statFetchNum;
347 	}
348 
349 	public BigDecimal getValueRandomTo() {
350 		return valueRandomTo;
351 	}
352 
353 	public void setValueRandomTo(BigDecimal valueRandomTo) {
354 		this.valueRandomTo = valueRandomTo;
355 	}
356 
357 	public Boolean getIsShare() {
358 		return isShare;
359 	}
360 
361 	public void setIsShare(Boolean isShare) {
362 		this.isShare = isShare;
363 	}
364 
365 	public Long getStatUseNum() {
366 		return statUseNum;
367 	}
368 
369 	public void setStatUseNum(Long statUseNum) {
370 		this.statUseNum = statUseNum;
371 	}
372 
373 	public Long getStatFetchUserNum() {
374 		return statFetchUserNum;
375 	}
376 
377 	public void setStatFetchUserNum(Long statFetchUserNum) {
378 		this.statFetchUserNum = statFetchUserNum;
379 	}
380 
381 	public Instant getCreated() {
382 		return created;
383 	}
384 
385 	public void setCreated(Instant created) {
386 		this.created = created;
387 	}
388 
389 	public String getRangeType() {
390 		return rangeType;
391 	}
392 
393 	public void setRangeType(String rangeType) {
394 		this.rangeType = rangeType;
395 	}
396 
397 	public String getFetchUrl() {
398 		return fetchUrl;
399 	}
400 
401 	public void setFetchUrl(String fetchUrl) {
402 		this.fetchUrl = fetchUrl;
403 	}
404 
405 	public String getUserLevelName() {
406 		return userLevelName;
407 	}
408 
409 	public void setUserLevelName(String userLevelName) {
410 		this.userLevelName = userLevelName;
411 	}
412 
413 	public Long getGroupId() {
414 		return groupId;
415 	}
416 
417 	public void setGroupId(Long groupId) {
418 		this.groupId = groupId;
419 	}
420 
421 	public String getWeixinCardId() {
422 		return weixinCardId;
423 	}
424 
425 	public void setWeixinCardId(String weixinCardId) {
426 		this.weixinCardId = weixinCardId;
427 	}
428 
429 	public String getCouponType() {
430 		return couponType;
431 	}
432 
433 	public void setCouponType(String couponType) {
434 		this.couponType = couponType;
435 	}
436 
437 	public Integer getNeedUserLevel() {
438 		return needUserLevel;
439 	}
440 
441 	public void setNeedUserLevel(Integer needUserLevel) {
442 		this.needUserLevel = needUserLevel;
443 	}
444 
445 	public BigDecimal getAtLeast() {
446 		return atLeast;
447 	}
448 
449 	public void setAtLeast(BigDecimal atLeast) {
450 		this.atLeast = atLeast;
451 	}
452 
453 	public Integer getStatus() {
454 		return status;
455 	}
456 
457 	public void setStatus(Integer status) {
458 		this.status = status;
459 	}
460 
461 }