From a3ea58065f61d16f06a0883737eae320eef5c33a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 01 八月 2019 15:47:12 +0800
Subject: [PATCH] 非任务模式不执行京东/拼多多订单

---
 fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java |   61 ++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
index 1be1f69..62ef157 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/StringUtil.java
@@ -4,6 +4,7 @@
 import java.lang.reflect.Method;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -11,6 +12,7 @@
 
 import org.apache.commons.codec.binary.Base64;
 
+import net.sf.json.JSONObject;
 import sun.misc.BASE64Encoder;
 
 public class StringUtil {
@@ -39,7 +41,7 @@
 	// 鏄惁涓虹數璇濆彿鐮�
 	public static boolean isMobile(String mobile) {
 
-		String regex = "^((13[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
+		String regex = "^((13[0-9])|(14[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
 		Pattern p = Pattern.compile(regex);
 		Matcher m = p.matcher(mobile);
 
@@ -91,7 +93,7 @@
 		}
 		return code;
 	}
-	
+
 	public static String getVerifyCode(int count) {
 		String sts = "0123456789";
 		String code = "";
@@ -101,8 +103,6 @@
 		}
 		return code;
 	}
-	
-	
 
 	// 锟斤拷取锟斤拷锟脚凤拷锟酵的革拷式
 	public static String getMessageStyle(String code) {
@@ -283,4 +283,57 @@
 		return lArr;
 	}
 
+	public static boolean isJson(String content) {
+		try {
+			JSONObject.fromObject(content);
+			return true;
+		} catch (Exception e) {
+			return false;
+		}
+	}
+
+	public static String concat(List list, String sperator) {
+		if (list == null)
+			return null;
+		String str = "";
+		for (Object obj : list) {
+			str += obj + sperator;
+		}
+		if (str.endsWith(sperator))
+			str = str.substring(0, str.length() - sperator.length());
+		return str;
+	}
+	
+	public static String concat(Object[] array, String sperator) {
+		if (array == null)
+			return null;
+		
+		String str = "";
+		for (int i = 0; i < array.length; i++) {
+			str += array[i] + sperator;
+		}
+		
+		if (str.endsWith(sperator))
+			str = str.substring(0, str.length() - sperator.length());
+		return str;
+	}
+
+
+	/**
+	 * 娣樺彛浠ゆ彁鍙�
+	 * 
+	 * @param str
+	 * @return
+	 */
+	public static String picUpTaoToken(String str) {
+		String pattern = "(鈧硔1}[A-Za-z0-9]+鈧硔1})|(楼{1}[A-Za-z0-9]+楼{1})|(锟1}[A-Za-z0-9]+锟1})";
+		Pattern r = Pattern.compile(pattern);
+		Matcher m = r.matcher(str);
+		while (m.find()) {
+			String group = m.group(0);
+			if (!StringUtil.isNullOrEmpty(group))
+				return group;
+		}
+		return null;
+	}
 }

--
Gitblit v1.8.0