|
|
@@ -471,15 +471,25 @@ public class GetWechatData extends BaseClass implements Runnable {
|
|
|
public static void sortByStartDigits(Rows rows, String key, String path) {
|
|
|
Collections.sort(rows, (s1, s2) -> {
|
|
|
String str1 = getStartDigits(s1.getString(key).replace(path, "").replace("/", ""));
|
|
|
- String str2 = getStartDigits(s2.getString(key));
|
|
|
+ String str2 = getStartDigits(s2.getString(key).replace(path, "").replace("/", ""));
|
|
|
System.err.println(str1);
|
|
|
int num1 = Integer.MAX_VALUE;
|
|
|
int num2 = Integer.MAX_VALUE;
|
|
|
if (!str1.equals("")) {
|
|
|
- num1 = Integer.parseInt(str1);
|
|
|
+ try {
|
|
|
+ num1 = Integer.parseInt(str1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if (!str2.equals("")) {
|
|
|
- num2 = Integer.parseInt(str2);
|
|
|
+ try {
|
|
|
+ num2 = Integer.parseInt(str2);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
return num1 - num2;
|
|
|
|
|
|
@@ -494,10 +504,18 @@ public class GetWechatData extends BaseClass implements Runnable {
|
|
|
int num1 = Integer.MAX_VALUE;
|
|
|
int num2 = Integer.MAX_VALUE;
|
|
|
if (!str1.equals("")) {
|
|
|
- num1 = Integer.parseInt(str1);
|
|
|
+ try {
|
|
|
+ num1 = Integer.parseInt(str1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
if (!str2.equals("")) {
|
|
|
- num2 = Integer.parseInt(str2);
|
|
|
+ try {
|
|
|
+ num2 = Integer.parseInt(str2);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
return num1 - num2;
|
|
|
|