1 package com.foxinmy.weixin4j.pay.payment.mch;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4 import com.foxinmy.weixin4j.pay.payment.coupon.RefundCouponInfo;
5 import com.foxinmy.weixin4j.pay.type.mch.CouponType;
6 import com.foxinmy.weixin4j.pay.type.mch.RefundChannel;
7 import com.foxinmy.weixin4j.pay.type.mch.RefundStatus;
8 import com.foxinmy.weixin4j.util.DateUtil;
9 import com.foxinmy.weixin4j.xml.ListsuffixResult;
10
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
15 import java.io.Serializable;
16 import java.util.Date;
17 import java.util.List;
18
19
20
21
22
23
24
25
26
27 @XmlRootElement
28 @XmlAccessorType(XmlAccessType.FIELD)
29 public class RefundDetail implements Serializable {
30 private static final long serialVersionUID = 1402738803019986864L;
31
32 protected RefundDetail() {
33
34 }
35
36
37
38
39 @XmlElement(name = "out_refund_no")
40 @JSONField(name = "out_refund_no")
41 private String outRefundNo;
42
43
44
45 @XmlElement(name = "refund_id")
46 @JSONField(name = "refund_id")
47 private String refundId;
48
49
50
51 @XmlElement(name = "refund_channel")
52 @JSONField(name = "refund_channel")
53 private String refundChannel;
54
55
56
57 @XmlElement(name = "refund_fee")
58 @JSONField(name = "refund_fee")
59 private int refundFee;
60
61
62
63 @XmlElement(name = "refund_status")
64 @JSONField(name = "refund_status")
65 private String refundStatus;
66
67
68
69 @XmlElement(name = "settlement_refund_fee")
70 @JSONField(name = "settlement_refund_fee")
71 private Integer settlementRefundFee;
72
73
74
75 @XmlElement(name = "coupon_refund_fee")
76 @JSONField(name = "coupon_refund_fee")
77 private Integer couponRefundFee;
78
79
80
81 @XmlElement(name = "coupon_refund_count")
82 @JSONField(name = "coupon_refund_count")
83 private Integer couponRefundCount;
84
85
86
87
88
89 @XmlElement(name = "coupon_type")
90 @JSONField(name = "coupon_type")
91 private String couponType;
92
93
94
95 @XmlElement(name = "refund_recv_accout")
96 @JSONField(name = "refund_recv_accout")
97 private String refundRecvAccout;
98
99
100
101 @XmlElement(name = "refund_success_time")
102 @JSONField(name = "refund_success_time")
103 private String refundSuccessTime;
104
105
106
107
108
109 @ListsuffixResult
110 private List<RefundCouponInfo> couponList;
111
112 public String getOutRefundNo() {
113 return outRefundNo;
114 }
115
116 public void setOutRefundNo(String outRefundNo) {
117 this.outRefundNo = outRefundNo;
118 }
119
120 public String getRefundId() {
121 return refundId;
122 }
123
124 public void setRefundId(String refundId) {
125 this.refundId = refundId;
126 }
127
128 public String getRefundChannel() {
129 return refundChannel;
130 }
131
132 public void setRefundChannel(String refundChannel) {
133 this.refundChannel = refundChannel;
134 }
135
136 @JSONField(serialize = false)
137 public RefundChannel getFormatRefundChannel() {
138 return refundChannel != null ? RefundChannel.valueOf(refundChannel
139 .toUpperCase()) : null;
140 }
141
142 public int getRefundFee() {
143 return refundFee;
144 }
145
146 public void setRefundFee(int refundFee) {
147 this.refundFee = refundFee;
148 }
149
150 public String getRefundStatus() {
151 return refundStatus;
152 }
153
154 public void setRefundStatus(String refundStatus) {
155 this.refundStatus = refundStatus;
156 }
157
158 @JSONField(serialize = false)
159 public RefundStatus getFormatRefundStatus() {
160 return refundStatus != null ? RefundStatus.valueOf(refundStatus
161 .toUpperCase()) : null;
162 }
163
164 public List<RefundCouponInfo> getCouponList() {
165 return couponList;
166 }
167
168 public void setCouponList(List<RefundCouponInfo> couponList) {
169 this.couponList = couponList;
170 }
171
172 public Integer getSettlementRefundFee() {
173 return settlementRefundFee;
174 }
175
176 public void setSettlementRefundFee(Integer settlementRefundFee) {
177 this.settlementRefundFee = settlementRefundFee;
178 }
179
180
181
182
183
184
185 @JSONField(serialize = false)
186 public double getFormatSettlementRefundFee() {
187 return settlementRefundFee != null ? settlementRefundFee / 100d : 0d;
188 }
189
190 public Integer getCouponRefundFee() {
191 return couponRefundFee;
192 }
193
194 public void setCouponRefundFee(Integer couponRefundFee) {
195 this.couponRefundFee = couponRefundFee;
196 }
197
198
199
200
201
202
203 @JSONField(serialize = false)
204 public double getFormatCouponRefundFee() {
205 return couponRefundFee != null ? couponRefundFee / 100d : 0d;
206 }
207
208 public Integer getCouponRefundCount() {
209 return couponRefundCount;
210 }
211
212 public void setCouponRefundCount(Integer couponRefundCount) {
213 this.couponRefundCount = couponRefundCount;
214 }
215
216 public String getCouponType() {
217 return couponType;
218 }
219
220 public void setCouponType(String couponType) {
221 this.couponType = couponType;
222 }
223
224 @JSONField(serialize = false)
225 public CouponType getFormatCouponType() {
226 return couponType != null ? CouponType
227 .valueOf(couponType.toUpperCase()) : null;
228 }
229
230 public String getRefundRecvAccout() {
231 return refundRecvAccout;
232 }
233
234 public void setRefundRecvAccout(String refundRecvAccout) {
235 this.refundRecvAccout = refundRecvAccout;
236 }
237
238 public String getRefundSuccessTime() {
239 return refundSuccessTime;
240 }
241
242 public void setRefundSuccessTime(String refundSuccessTime) {
243 this.refundSuccessTime = refundSuccessTime;
244 }
245
246 @JSONField(serialize = false)
247 public Date getFormatRefundSuccessTime() {
248 return refundSuccessTime != null ? DateUtil.parse2yyyyMMddHHmmss(refundSuccessTime) : null;
249 }
250
251 @Override
252 public String toString() {
253 return "RefundDetail [outRefundNo=" + outRefundNo + ", refundId="
254 + refundId + ", refundChannel=" + refundChannel
255 + ", refundFee=" + refundFee + ", refundStatus=" + refundStatus
256 + ", settlementRefundFee=" + settlementRefundFee
257 + ", couponRefundFee=" + couponRefundFee
258 + ", couponRefundCount=" + couponRefundCount + ", couponType="
259 + couponType + ", refundRecvAccout=" + refundRecvAccout
260 + ", couponList=" + couponList + "]";
261 }
262 }