diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java index 6f66dfdd86..a48617c4cb 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java @@ -230,6 +230,15 @@ protected static Integer readXmlInteger(Document d, String tagName) { return Integer.parseInt(content); } + protected static Long readXmlLong(Document d, String tagName) { + String content = readXmlString(d, tagName); + if (content == null || content.trim().length() == 0) { + return null; + } + + return Long.parseLong(content); + } + /** * Gets logger. * diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayEntrustResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayEntrustResult.java index 4dc6f19ae4..2cd0e3588d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayEntrustResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayEntrustResult.java @@ -81,7 +81,7 @@ public class WxPayEntrustResult extends BaseWxPayResult implements Serializable * 非必传 */ @XStreamAlias("request_serial") - private Integer requestSerial; + private Long requestSerial; /** * 签约协议号 @@ -120,7 +120,7 @@ protected void loadXml(Document d) { tradeType = readXmlString(d, "trade_type"); codeUrl = readXmlString(d, "code_url"); planId = readXmlInteger(d, "plan_id"); - requestSerial = readXmlInteger(d, "request_serial"); + requestSerial = readXmlLong(d, "request_serial"); contractCode = readXmlString(d, "contract_code"); contractDisplayAccount = readXmlString(d, "contract_display_account"); mwebUrl = readXmlString(d, "mweb_url"); diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignQueryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignQueryResult.java index abb72a5b79..d04f47a9dc 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignQueryResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignQueryResult.java @@ -42,7 +42,7 @@ public class WxSignQueryResult extends BaseWxPayResult implements Serializable { * 请求序列号 */ @XStreamAlias("request_serial") - private Integer requestSerial; + private Long requestSerial; /** * 签约协议号 @@ -106,7 +106,7 @@ public class WxSignQueryResult extends BaseWxPayResult implements Serializable { protected void loadXml(Document d) { contractId = readXmlString(d, "contract_id"); planId = readXmlString(d, "plan_id"); - requestSerial = readXmlInteger(d, "request_serial"); + requestSerial = readXmlLong(d, "request_serial"); contractCode = readXmlString(d, "contract_code"); contractDisplayAccount = readXmlString(d, "contract_display_account"); contractState = readXmlInteger(d, "contract_state"); diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignStatusNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignStatusNotifyResult.java index f55b576e36..0c0b48ecd4 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignStatusNotifyResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxSignStatusNotifyResult.java @@ -81,7 +81,7 @@ public class WxSignStatusNotifyResult extends BaseWxPayResult { * 请求序列号 */ @XStreamAlias("request_serial") - private Integer requestSerial; + private Long requestSerial; @Override public void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException { @@ -117,7 +117,7 @@ protected void loadXml(Document d) { contractId = readXmlString(d, "contract_id"); contractExpiredTime = readXmlString(d, "contract_expired_time"); contractTerminationMode = readXmlInteger(d, "contract_termination_mode"); - requestSerial = readXmlInteger(d, "request_serial"); + requestSerial = readXmlLong(d, "request_serial"); } @Override