View Javadoc
1   package com.foxinmy.weixin4j.payment.mch;
2   
3   import java.util.Date;
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   
10  import com.alibaba.fastjson.annotation.JSONField;
11  import com.foxinmy.weixin4j.util.DateUtil;
12  
13  /**
14   * 发送红包结果
15   * 
16   * @className RedpacketSendResult
17   * @author jinyu(foxinmy@gmail.com)
18   * @date 2015年4月1日
19   * @since JDK 1.6
20   * @see
21   * @deprecated 迁移到子模块weixin4j-pay
22   */
23  @Deprecated
24  @XmlRootElement
25  @XmlAccessorType(XmlAccessType.FIELD)
26  public class RedpacketSendResult extends MerchantResult {
27  
28  	private static final long serialVersionUID = 5611847899634131711L;
29  	/**
30  	 * 商户订单号(每个订单号必须唯一) 组成: mch_id+yyyymmdd+10位一天内不能重复的数字。
31  	 */
32  	@XmlElement(name = "mch_billno")
33  	@JSONField(name = "mch_billno")
34  	private String outTradeNo;
35  	/**
36  	 * 接收红包的用户的openid
37  	 */
38  	@XmlElement(name = "re_openid")
39  	@JSONField(name = "re_openid")
40  	private String openId;
41  	/**
42  	 * 付款金额 单位为分
43  	 */
44  	@XmlElement(name = "total_amount")
45  	@JSONField(name = "total_amount")
46  	private int totalAmount;
47  	/**
48  	 * 发放成功时间
49  	 */
50  	@XmlElement(name = "send_time")
51  	@JSONField(name = "send_time")
52  	private String sendTime;
53  	/**
54  	 * 微信单号
55  	 */
56  	@XmlElement(name = "send_listid")
57  	@JSONField(name = "send_listid")
58  	private String sendListid;
59  
60  	protected RedpacketSendResult() {
61  		// jaxb required
62  	}
63  
64  	public String getOutTradeNo() {
65  		return outTradeNo;
66  	}
67  
68  	public String getOpenId() {
69  		return openId;
70  	}
71  
72  	public int getTotalAmount() {
73  		return totalAmount;
74  	}
75  
76  	/**
77  	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
78  	 * 
79  	 * @return 元单位
80  	 */
81  	@JSONField(serialize = false)
82  	public double getFormatTotalAmount() {
83  		return totalAmount / 100d;
84  	}
85  
86  	public String getSendTime() {
87  		return sendTime;
88  	}
89  
90  	@JSONField(serialize = false)
91  	public Date getFormatSendTime() {
92  		return DateUtil.parse2yyyyMMddHHmmss(sendTime);
93  	}
94  
95  	public String getSendListid() {
96  		return sendListid;
97  	}
98  
99  	@Override
100 	public String toString() {
101 		return "RedpacketSendResult [outTradeNo=" + outTradeNo + ", openId="
102 				+ openId + ", totalAmount=" + totalAmount + ", "
103 				+ super.toString() + "]";
104 	}
105 }