Showing
1 changed file
with
6 additions
and
2 deletions
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.pay.alipay.bean; | @@ -2,6 +2,7 @@ package com.yohoufo.order.service.pay.alipay.bean; | ||
2 | 2 | ||
3 | import lombok.Data; | 3 | import lombok.Data; |
4 | import lombok.Value; | 4 | import lombok.Value; |
5 | +import org.apache.commons.lang3.ArrayUtils; | ||
5 | import org.apache.commons.lang3.StringUtils; | 6 | import org.apache.commons.lang3.StringUtils; |
6 | 7 | ||
7 | import java.math.BigDecimal; | 8 | import java.math.BigDecimal; |
@@ -47,12 +48,15 @@ public class TtnStatusQueryResponse { | @@ -47,12 +48,15 @@ public class TtnStatusQueryResponse { | ||
47 | if (StringUtils.isEmpty(resData)) { | 48 | if (StringUtils.isEmpty(resData)) { |
48 | return; | 49 | return; |
49 | } | 50 | } |
50 | - String[] data = resData.split("|"); | 51 | + String[] data = StringUtils.split(resData, "|"); |
52 | + if (ArrayUtils.isEmpty(data)) { | ||
53 | + return; | ||
54 | + } | ||
51 | for (String e : data) { | 55 | for (String e : data) { |
52 | if (StringUtils.isEmpty(e)) { | 56 | if (StringUtils.isEmpty(e)) { |
53 | continue; | 57 | continue; |
54 | } | 58 | } |
55 | - String[] fs = e.split("^"); | 59 | + String[] fs = StringUtils.splitByWholeSeparatorPreserveAllTokens(e, "^"); |
56 | if (fs.length != 8) { | 60 | if (fs.length != 8) { |
57 | continue; | 61 | continue; |
58 | } | 62 | } |
-
Please register or login to post a comment