1 package com.foxinmy.weixin4j.pay.payment.coupon;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4 import com.foxinmy.weixin4j.pay.type.mch.CouponType;
5
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlElement;
9 import javax.xml.bind.annotation.XmlRootElement;
10 import java.io.Serializable;
11
12
13
14
15
16
17
18
19
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.FIELD)
23 public class OrderCouponInfo implements Serializable {
24
25 private static final long serialVersionUID = -8744999305258786901L;
26
27
28
29
30 @XmlElement(name = "coupon_batch_id")
31 @JSONField(name = "coupon_batch_id")
32 private String couponBatchId;
33
34
35
36
37
38 @XmlElement(name = "coupon_type")
39 @JSONField(name = "coupon_type")
40 private String couponType;
41
42
43
44 @XmlElement(name = "coupon_id")
45 @JSONField(name = "coupon_id")
46 private String couponId;
47
48
49
50 @XmlElement(name = "coupon_fee")
51 @JSONField(name = "coupon_fee")
52 private Integer couponFee;
53
54 protected OrderCouponInfo() {
55
56 }
57
58 public String getCouponBatchId() {
59 return couponBatchId;
60 }
61
62 public void setCouponBatchId(String couponBatchId) {
63 this.couponBatchId = couponBatchId;
64 }
65
66 public String getCouponType() {
67 return couponType;
68 }
69
70 public void setCouponType(String couponType) {
71 this.couponType = couponType;
72 }
73
74 @JSONField(serialize = false)
75 public CouponType getFormatCouponType() {
76 return couponType != null ? CouponType
77 .valueOf(couponType.toUpperCase()) : null;
78 }
79
80 public String getCouponId() {
81 return couponId;
82 }
83
84 public void setCouponId(String couponId) {
85 this.couponId = couponId;
86 }
87
88 public Integer getCouponFee() {
89 return couponFee;
90 }
91
92 public void setCouponFee(Integer couponFee) {
93 this.couponFee = couponFee;
94 }
95
96
97
98
99
100
101 @JSONField(serialize = false)
102 public double getFormatCouponFee() {
103 return couponFee != null ? couponFee.doubleValue() / 100d : 0d;
104 }
105
106 @Override
107 public String toString() {
108 return "couponBatchId=" + couponBatchId + ", couponType=" + couponType
109 + ", couponId=" + couponId + ", couponFee=" + couponFee;
110 }
111 }