View Javadoc
1   package com.foxinmy.weixin4j.pay.payment.mch;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   import com.foxinmy.weixin4j.xml.ListsuffixResult;
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.util.List;
11  
12  /**
13   * 退款记录
14   * 
15   * @className RefundRecord
16   * @author jinyu(foxinmy@gmail.com)
17   * @date 2014年11月1日
18   * @since JDK 1.6
19   */
20  @XmlRootElement
21  @XmlAccessorType(XmlAccessType.FIELD)
22  public class RefundRecord extends MerchantTradeResult {
23  
24  	private static final long serialVersionUID = -2971132874939642721L;
25  	/**
26  	 * 退款笔数
27  	 */
28  	@XmlElement(name = "refund_count")
29  	@JSONField(name = "refund_count")
30  	private int refundCount;
31  	/**
32  	 * 退款总金额,单位为分,可以做部分退款
33  	 */
34  	@XmlElement(name = "refund_fee")
35  	@JSONField(name = "refund_fee")
36  	private int refundFee;
37  	/**
38  	 * 退款详情
39  	 * 
40  	 * @see RefundDetail
41  	 */
42  	@ListsuffixResult({ ".*(_\\d)$" })
43  	private List<RefundDetail> refundList;
44  
45  	protected RefundRecord() {
46  		// jaxb required
47  	}
48  
49  	public int getRefundCount() {
50  		return refundCount;
51  	}
52  
53  	public void setRefundCount(int refundCount) {
54  		this.refundCount = refundCount;
55  	}
56  
57  	public int getRefundFee() {
58  		return refundFee;
59  	}
60  
61  	public void setRefundFee(int refundFee) {
62  		this.refundFee = refundFee;
63  	}
64  
65  	/**
66  	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
67  	 * 
68  	 * @return 元单位
69  	 */
70  	@JSONField(serialize = false)
71  	public double getFormatRefundFee() {
72  		return refundFee / 100d;
73  	}
74  
75  	public List<RefundDetail> getRefundList() {
76  		return refundList;
77  	}
78  
79  	public void setRefundList(List<RefundDetail> refundList) {
80  		this.refundList = refundList;
81  	}
82  
83  	@Override
84  	public String toString() {
85  		return "RefundRecord [refundCount=" + refundCount + ", refundFee="
86  				+ refundFee + ", refundList=" + refundList + ", "
87  				+ super.toString() + "]";
88  	}
89  }