View Javadoc
1   package com.foxinmy.weixin4j.pay.payment.coupon;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   
5   import javax.xml.bind.annotation.XmlAccessType;
6   import javax.xml.bind.annotation.XmlAccessorType;
7   import javax.xml.bind.annotation.XmlElement;
8   import javax.xml.bind.annotation.XmlRootElement;
9   import java.io.Serializable;
10  
11  /**
12   * 退款代金券信息
13   * 
14   * @className RefundCouponInfo
15   * @author jinyu(foxinmy@gmail.com)
16   * @date 2015年3月24日
17   * @since JDK 1.6
18   * @see
19   */
20  @XmlRootElement
21  @XmlAccessorType(XmlAccessType.FIELD)
22  public class RefundCouponInfo implements Serializable {
23  
24  	private static final long serialVersionUID = -8744999305258786901L;
25  
26  	/**
27  	 * 代金券或立减优惠批次ID
28  	 */
29  	@XmlElement(name = "coupon_refund_batch_id")
30  	@JSONField(name = "coupon_refund_batch_id")
31  	private String couponBatchId;
32  	/**
33  	 * 退款代金券ID
34  	 */
35  	@XmlElement(name = "coupon_refund_id")
36  	@JSONField(name = "coupon_refund_id")
37  	private String couponId;
38  	/**
39  	 * 单个代金券或立减优惠支付金额
40  	 */
41  	@XmlElement(name = "coupon_refund_fee")
42  	@JSONField(name = "coupon_refund_fee")
43  	private Integer couponFee;
44  
45  	protected RefundCouponInfo() {
46  		// jaxb requried
47  	}
48  
49  	public String getCouponBatchId() {
50  		return couponBatchId;
51  	}
52  
53  	public void setCouponBatchId(String couponBatchId) {
54  		this.couponBatchId = couponBatchId;
55  	}
56  
57  	public String getCouponId() {
58  		return couponId;
59  	}
60  
61  	public void setCouponId(String couponId) {
62  		this.couponId = couponId;
63  	}
64  
65  	public Integer getCouponFee() {
66  		return couponFee;
67  	}
68  
69  	public void setCouponFee(Integer couponFee) {
70  		this.couponFee = couponFee;
71  	}
72  
73  	/**
74  	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
75  	 * 
76  	 * @return 元单位
77  	 */
78  	@JSONField(serialize = false)
79  	public double getFormatCouponFee() {
80  		return couponFee != null ? couponFee.doubleValue() / 100d : 0d;
81  	}
82  
83  	@Override
84  	public String toString() {
85  		return "couponBatchId=" + couponBatchId + ", couponId=" + couponId
86  				+ ", couponFee=" + couponFee;
87  	}
88  }