1 package com.foxinmy.weixin4j.mp.oldpayment;
2
3 import javax.xml.bind.annotation.XmlAccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlElement;
6 import javax.xml.bind.annotation.XmlRootElement;
7
8 import com.alibaba.fastjson.annotation.JSONField;
9 import com.foxinmy.weixin4j.type.mch.RefundChannel;
10 import com.foxinmy.weixin4j.type.mch.RefundStatus;
11
12
13
14
15
16
17
18
19
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.FIELD)
23 public class RefundDetailV2 extends ApiResultV2 {
24
25 private static final long serialVersionUID = -3687863914168618620L;
26
27
28
29
30 @XmlElement(name = "out_refund_no")
31 @JSONField(name = "out_refund_no")
32 private String outRefundNo;
33
34
35
36 @XmlElement(name = "refund_id")
37 @JSONField(name = "refund_id")
38 private String refundId;
39
40
41
42 @XmlElement(name = "refund_channel")
43 @JSONField(name = "refund_channel")
44 private int refundChannel;
45
46
47
48 @XmlElement(name = "refund_fee")
49 @JSONField(name = "refund_fee")
50 private int refundFee;
51
52
53
54 @XmlElement(name = "refund_status")
55 @JSONField(name = "refund_status")
56 private int refundStatus;
57
58
59
60 @XmlElement(name = "recv_user_id")
61 @JSONField(name = "recv_user_id")
62 private String recvUserId;
63
64
65
66 @XmlElement(name = "reccv_user_name")
67 @JSONField(name = "reccv_user_name")
68 private String reccvUserName;
69
70 protected RefundDetailV2() {
71
72 }
73
74 public String getOutRefundNo() {
75 return outRefundNo;
76 }
77
78 public String getRefundId() {
79 return refundId;
80 }
81
82 public int getRefundChannel() {
83 return refundChannel;
84 }
85
86 @JSONField(serialize = false)
87 public RefundChannel getFormatRefundChannel() {
88 if (refundChannel == 0) {
89 return RefundChannel.TENPAY;
90 } else if (refundChannel == 1) {
91 return RefundChannel.BANK;
92 } else {
93 return null;
94 }
95 }
96
97 public int getRefundFee() {
98 return refundFee;
99 }
100
101
102
103
104
105
106 @JSONField(serialize = false)
107 public double getFormatRefundFee() {
108 return refundFee / 100d;
109 }
110
111 public int getRefundStatus() {
112 return refundStatus;
113 }
114
115 @JSONField(serialize = false)
116 public RefundStatus getFormatRefundStatus() {
117 String refundStatus_ = String.format(",%d,", refundStatus);
118 if (",4,10,".contains(refundStatus_)) {
119 return RefundStatus.SUCCESS;
120 } else if (",3,5,6,".contains(refundStatus_)) {
121 return RefundStatus.FAIL;
122 } else if (",8,9,11,".contains(refundStatus_)) {
123 return RefundStatus.PROCESSING;
124 } else if (",1,2,".contains(refundStatus_)) {
125 return RefundStatus.NOTSURE;
126 } else if (",7,".contains(refundStatus_)) {
127 return RefundStatus.CHANGE;
128 } else {
129 return null;
130 }
131 }
132
133 public String getRecvUserId() {
134 return recvUserId;
135 }
136
137 public String getReccvUserName() {
138 return reccvUserName;
139 }
140
141 @Override
142 public String toString() {
143 return "outRefundNo=" + outRefundNo + ", refundId=" + refundId
144 + ", refundChannel=" + refundChannel + ", refundFee="
145 + refundFee + ", refundStatus=" + refundStatus
146 + ", recvUserId=" + recvUserId + ", reccvUserName="
147 + reccvUserName + ", refundChannel=" + getFormatRefundChannel()
148 + ", refundFee=" + getFormatRefundFee() + ", refundStatus="
149 + getFormatRefundStatus();
150 }
151 }