From 61b706ef913c445d74d5443b087622740923b66b Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期二, 09 七月 2019 01:04:18 +0800
Subject: [PATCH] 修改查询js

---
 java110-common/src/main/java/com/java110/common/util/StringUtil.java |  834 +++++++++++++++++++++++++++++------------------------------
 1 files changed, 414 insertions(+), 420 deletions(-)

diff --git a/java110-common/src/main/java/com/java110/common/util/StringUtil.java b/java110-common/src/main/java/com/java110/common/util/StringUtil.java
index dd5ac6d..3c8fdbf 100644
--- a/java110-common/src/main/java/com/java110/common/util/StringUtil.java
+++ b/java110-common/src/main/java/com/java110/common/util/StringUtil.java
@@ -7,6 +7,8 @@
 package com.java110.common.util;
 
 
+import org.springframework.util.*;
+
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.util.regex.Pattern;
@@ -21,471 +23,463 @@
  */
 
 public class StringUtil {
-	/**
-	 * Description: 鏍煎紡鍖栧瓧绗︿覆(鐢ㄦ埛缁勫缓琛ㄤ娇鐢�) <br>
-	 *
-	 * @param name
-	 * @return String
-	 */
-	public static String formatString(String name) {
-		String s = "0000000000" + name;
-		return s.substring(s.length() - 10, s.length());
-	}
+    /**
+     * Description: 鏍煎紡鍖栧瓧绗︿覆(鐢ㄦ埛缁勫缓琛ㄤ娇鐢�) <br>
+     *
+     * @param name
+     * @return String
+     */
+    public static String formatString(String name) {
+        String s = "0000000000" + name;
+        return s.substring(s.length() - 10, s.length());
+    }
 
-	/**
-	 * Description:鎶奊BK杞爜鎴怚SO8859_1 <br>
-	 *
-	 * @param name
-	 * @return String
-	 */
-	public static String getStringByISO(String name) {
-		try {
-			// 闃叉涓枃瀛楃鍑虹幇涔辩爜
-			name = new String(name.getBytes("GBK"), "ISO8859_1");
-		} catch (UnsupportedEncodingException e2) {
-		}
+    /**
+     * Description:鎶奊BK杞爜鎴怚SO8859_1 <br>
+     *
+     * @param name
+     * @return String
+     */
+    public static String getStringByISO(String name) {
+        try {
+            // 闃叉涓枃瀛楃鍑虹幇涔辩爜
+            name = new String(name.getBytes("GBK"), "ISO8859_1");
+        } catch (UnsupportedEncodingException e2) {
+        }
 
-		return name;
-	}
+        return name;
+    }
 
-	/**
-	 * Description:鑾峰緱鏍煎紡鍖栫殑url <br>
-	 *
-	 * @param url
-	 * @return String
-	 */
-	public static String getFormatUrl(String url) {
-		if (isNullOrNone(url)) {
-			return "";
-		}
+    /**
+     * Description:鑾峰緱鏍煎紡鍖栫殑url <br>
+     *
+     * @param url
+     * @return String
+     */
+    public static String getFormatUrl(String url) {
+        if (isNullOrNone(url)) {
+            return "";
+        }
 
-		if (url.indexOf('?') == -1) {
-			return url + '?';
-		} else {
-			return url + '&';
-		}
-	}
+        if (url.indexOf('?') == -1) {
+            return url + '?';
+        } else {
+            return url + '&';
+        }
+    }
 
-	/**
-	 * Description: 鑾峰緱瀛楃(byte)鐨勫疄闄呴暱搴�<br>
-	 * 1銆佲��<br>
-	 * 2銆佲��<br>
-	 * 3銆佲��<br>
-	 * 4銆佲��<br>
-	 *
-	 * @param s
-	 * @return int
-	 * @exception/throws
-	 */
-	public static int lengthByte(String s) {
-		int length = 0;
-		for (int i = 0; i < s.length(); i++) {
-			if (s.charAt(i) <= 127) {
-				length++;
-			} else {
-				length = length + 2;
-			}
-		}
-		return length;
-	}
+    /**
+     * Description: 鑾峰緱瀛楃(byte)鐨勫疄闄呴暱搴�<br>
+     * 1銆佲��<br>
+     * 2銆佲��<br>
+     * 3銆佲��<br>
+     * 4銆佲��<br>
+     *
+     * @param s
+     * @return int
+     * @exception/throws
+     */
+    public static int lengthByte(String s) {
+        int length = 0;
+        for (int i = 0; i < s.length(); i++) {
+            if (s.charAt(i) <= 127) {
+                length++;
+            } else {
+                length = length + 2;
+            }
+        }
+        return length;
+    }
 
-	/**
-	 * Description: 鍦╦dbc鐢╰hin瀹㈡埛绔繛鎺racle閲岄潰涓枃绠�3涓瓧绗�<br>
-	 *
-	 * @param s
-	 * @return int
-	 * @exception/throws
-	 */
-	public static int lengthByteInPrepared(String s) {
-		int length = 0;
+    /**
+     * Description: 鍦╦dbc鐢╰hin瀹㈡埛绔繛鎺racle閲岄潰涓枃绠�3涓瓧绗�<br>
+     *
+     * @param s
+     * @return int
+     * @exception/throws
+     */
+    public static int lengthByteInPrepared(String s) {
+        int length = 0;
 
-		if (s == null) {
-			return length;
-		}
+        if (s == null) {
+            return length;
+        }
 
-		for (int i = 0; i < s.length(); i++) {
-			if (s.charAt(i) <= 127) {
-				length++;
-			} else {
-				length = length + 3;
-			}
-		}
-		return length;
-	}
+        for (int i = 0; i < s.length(); i++) {
+            if (s.charAt(i) <= 127) {
+                length++;
+            } else {
+                length = length + 3;
+            }
+        }
+        return length;
+    }
 
-	/**
-	 * Description:鍒ゆ柇瀛楁绌簄ull <br>
-	 *
-	 * @param s
-	 * @return boolean
-	 */
-	public static boolean isNullOrNone(String s) {
-		if (s == null || "".equals(s.trim())) {
-			return true;
-		}
+    /**
+     * Description:鍒ゆ柇瀛楁绌簄ull <br>
+     *
+     * @param s
+     * @return boolean
+     */
+    public static boolean isNullOrNone(String s) {
+        if (s == null || "".equals(s.trim())) {
+            return true;
+        }
 
-		return false;
-	}
+        return false;
+    }
 
-	/**
-	 *
-	 * Description: 鍒ゆ柇瀵硅薄鏄惁涓虹┖<br>
-	 *
-	 * @param obj
-	 * @return boolean
-	 * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
-	 */
-	public static boolean isNullOrNone(Object obj) {
-		if (obj == null) {
-			return true;
-		}
-		if (obj instanceof String) {
-			return isNullOrNone((String) obj);
-		}
-		return false;
-	}
+    /**
+     * Description: 鍒ゆ柇瀵硅薄鏄惁涓虹┖<br>
+     *
+     * @param obj
+     * @return boolean
+     * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
+     */
+    public static boolean isNullOrNone(Object obj) {
+        if (obj == null) {
+            return true;
+        }
+        if (obj instanceof String) {
+            return isNullOrNone((String) obj);
+        }
+        return false;
+    }
 
-	/**
-	 * Description:鍒ゆ柇瀛楁绌簄ull <br>
-	 *
-	 * @param ss
-	 * @return boolean
-	 */
-	public static boolean isNullOrNone(String[] ss) {
-		if (ss == null || ss.length == 0) {
-			return true;
-		}
+    /**
+     * Description:鍒ゆ柇瀛楁绌簄ull <br>
+     *
+     * @param ss
+     * @return boolean
+     */
+    public static boolean isNullOrNone(String[] ss) {
+        if (ss == null || ss.length == 0) {
+            return true;
+        }
 
-		for (int i = 0; i < ss.length; i++) {
-			if (ss[i] == null || "".equals(ss[i].trim())) {
-				return true;
-			}
-		}
+        for (int i = 0; i < ss.length; i++) {
+            if (ss[i] == null || "".equals(ss[i].trim())) {
+                return true;
+            }
+        }
 
-		return false;
-	}
+        return false;
+    }
 
-	public static int countChar(String src, char c) {
-		if (isNullOrNone(src)) {
-			return 0;
-		}
+    public static int countChar(String src, char c) {
+        if (isNullOrNone(src)) {
+            return 0;
+        }
 
-		int k = 0;
-		for (int i = 0; i < src.length(); i++) {
-			if (src.charAt(i) == c) {
-				k++;
-			}
-		}
+        int k = 0;
+        for (int i = 0; i < src.length(); i++) {
+            if (src.charAt(i) == c) {
+                k++;
+            }
+        }
 
-		return k;
-	}
+        return k;
+    }
 
-	/**
-	 * 鎶�'鍙樻垚 ''
-	 *
-	 * @param src
-	 * @return
-	 */
-	public static String oracleString(String src) {
-		if (isNullOrNone(src)) {
-			return "";
-		}
+    /**
+     * 鎶�'鍙樻垚 ''
+     *
+     * @param src
+     * @return
+     */
+    public static String oracleString(String src) {
+        if (isNullOrNone(src)) {
+            return "";
+        }
 
-		return src.replaceAll("'", "''");
-	}
+        return src.replaceAll("'", "''");
+    }
 
-	/**
-	 * 鏇挎崲鍑芥暟
-	 *
-	 * @param
-	 *            source
-	 * @param
-	 *            find
-	 * @param
-	 *            rep
-	 * @return String
-	 */
-	public static String replace(String source, String find, String rep) {
-		String result = source;
-		String begin = "";
-		String end = "";
-		int flag;
+    /**
+     * 鏇挎崲鍑芥暟
+     *
+     * @param source
+     * @param find
+     * @param rep
+     * @return String
+     */
+    public static String replace(String source, String find, String rep) {
+        String result = source;
+        String begin = "";
+        String end = "";
+        int flag;
 
-		flag = result.indexOf(find, 0);
+        flag = result.indexOf(find, 0);
 
-		while (flag != -1) {
-			begin = result.substring(0, flag);
-			end = result.substring(flag + (find.length()), result.length());
-			result = begin + rep + end;
-			flag = result.indexOf(find, flag + rep.length());
-		}
-		return result;
-	}
+        while (flag != -1) {
+            begin = result.substring(0, flag);
+            end = result.substring(flag + (find.length()), result.length());
+            result = begin + rep + end;
+            flag = result.indexOf(find, flag + rep.length());
+        }
+        return result;
+    }
 
-	/**
-	 * 淇濇姢鎴柇
-	 *
-	 * @param s
-	 * @param begin
-	 * @param end
-	 * @return
-	 */
-	public static String truncate(String s, int begin, int end) {
-		if (isNullOrNone(s)) {
-			return "";
-		}
+    /**
+     * 淇濇姢鎴柇
+     *
+     * @param s
+     * @param begin
+     * @param end
+     * @return
+     */
+    public static String truncate(String s, int begin, int end) {
+        if (isNullOrNone(s)) {
+            return "";
+        }
 
-		if (begin < 0) {
-			return "";
-		}
+        if (begin < 0) {
+            return "";
+        }
 
-		if (begin >= end) {
-			return "";
-		}
+        if (begin >= end) {
+            return "";
+        }
 
-		s = s.trim();
-		if (begin >= s.length()) {
-			return "";
-		}
+        s = s.trim();
+        if (begin >= s.length()) {
+            return "";
+        }
 
-		if (end >= s.length()) {
-			return s;
-		} else {
-			return s.substring(begin, end);
-		}
-	}
+        if (end >= s.length()) {
+            return s;
+        } else {
+            return s.substring(begin, end);
+        }
+    }
 
-	/**
-	 *
-	 * Description: 鍒ゆ柇鏄惁涓烘暟瀛�<br>
-	 * 1銆佲��<br>
-	 * 2銆佲��<br>
-	 * 3銆佲��<br>
-	 * 4銆佲��<br>
-	 *
-	 * @param str
-	 * @return boolean
-	 * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
-	 */
-	public static boolean isNumber(String str) {
-		if (null == str || "".equals(str)) {
-			return false;
-		} else {
-			return Pattern.matches("^[0-9]+$", str);
-		}
-	}
+    /**
+     * Description: 鍒ゆ柇鏄惁涓烘暟瀛�<br>
+     * 1銆佲��<br>
+     * 2銆佲��<br>
+     * 3銆佲��<br>
+     * 4銆佲��<br>
+     *
+     * @param str
+     * @return boolean
+     * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
+     */
+    public static boolean isNumber(String str) {
+        if (null == str || "".equals(str)) {
+            return false;
+        } else {
+            return Pattern.matches("^[0-9]+$", str);
+        }
+    }
 
-	/**
-	 * Description: 鑾峰緱瀛楃(byte)鐨勫疄闄呴暱搴�<br>
-	 * 1銆佲��<br>
-	 * 2銆佲��<br>
-	 * 3銆佲��<br>
-	 * 4銆佲��<br>
-	 *
-	 * @param s
-	 * @return int
-	 * @exception/throws
-	 */
-	public static int realLength(String s) {
-		if (null == s || "".equals(s)) {
-			return 0;
-		} else {
-			return s.getBytes().length;
-		}
-	}
+    /**
+     * Description: 鑾峰緱瀛楃(byte)鐨勫疄闄呴暱搴�<br>
+     * 1銆佲��<br>
+     * 2銆佲��<br>
+     * 3銆佲��<br>
+     * 4銆佲��<br>
+     *
+     * @param s
+     * @return int
+     * @exception/throws
+     */
+    public static int realLength(String s) {
+        if (null == s || "".equals(s)) {
+            return 0;
+        } else {
+            return s.getBytes().length;
+        }
+    }
 
-	/**
-	 * Description: 妫�鏌ラ潪娉曞瓧绗�<br>
-	 */
-	public static boolean isUnlawfulChar(String s) {
-		if (null == s || "".equals(s)) {
-			return false;
-		} else {
-			return Pattern.matches("^[^`~@#\\$%\\^&\\*\\(\\)=\\!\\+\\\\/\\|<>\\?;\\:\\.'\"\\{\\}\\[\\]??, ]*$", s);
-		}
-	}
+    /**
+     * Description: 妫�鏌ラ潪娉曞瓧绗�<br>
+     */
+    public static boolean isUnlawfulChar(String s) {
+        if (null == s || "".equals(s)) {
+            return false;
+        } else {
+            return Pattern.matches("^[^`~@#\\$%\\^&\\*\\(\\)=\\!\\+\\\\/\\|<>\\?;\\:\\.'\"\\{\\}\\[\\]??, ]*$", s);
+        }
+    }
 
-	/**
-	 *
-	 * Description: 鍒ゆ柇鏄惁涓哄瓧姣�<br>
-	 * 1銆佲��<br>
-	 * 2銆佲��<br>
-	 * 3銆佲��<br>
-	 * 4銆佲��<br>
-	 *
-	 * @param str
-	 * @return boolean
-	 * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
-	 */
-	public static boolean isLetter(String str) {
-		if (null == str || "".equals(str)) {
-			return false;
-		} else {
-			return Pattern.matches("^[A-Za-z]+$", str);
-		}
-	}
+    /**
+     * Description: 鍒ゆ柇鏄惁涓哄瓧姣�<br>
+     * 1銆佲��<br>
+     * 2銆佲��<br>
+     * 3銆佲��<br>
+     * 4銆佲��<br>
+     *
+     * @param str
+     * @return boolean
+     * @exception/throws [杩濅緥绫诲瀷] [杩濅緥璇存槑]
+     */
+    public static boolean isLetter(String str) {
+        if (null == str || "".equals(str)) {
+            return false;
+        } else {
+            return Pattern.matches("^[A-Za-z]+$", str);
+        }
+    }
 
-	/**
-	 * (source != null) ? source : "";鐩稿綋浜巓racle鐨刵vl鍑芥暟
-	 *
-	 * @param source
-	 * @return String
-	 */
-	public static String nvl(String source) {
-		return (source != null) ? source.trim() : "";
-	}
+    /**
+     * (source != null) ? source : "";鐩稿綋浜巓racle鐨刵vl鍑芥暟
+     *
+     * @param source
+     * @return String
+     */
+    public static String nvl(String source) {
+        return (source != null) ? source.trim() : "";
+    }
 
-	/**
-	 * Method nvl.
-	 *
-	 * @param source
-	 *            String
-	 * @param defaultString
-	 *            String
-	 * @return String
-	 */
-	public static String nvl(String source, String defaultString) {
-		return (source != null) ? source.trim() : defaultString;
-	}
+    /**
+     * Method nvl.
+     *
+     * @param source        String
+     * @param defaultString String
+     * @return String
+     */
+    public static String nvl(String source, String defaultString) {
+        return (source != null) ? source.trim() : defaultString;
+    }
 
-	/**
-	 * 瀹炵幇瀵圭鍚堟潯浠剁殑瀛楃涓茬殑鍙嶈浆
-	 *
-	 * @param str
-	 *            鍘熷瀛楃涓�
-	 * @return 缁忚繃鍙嶈浆澶勭悊鍚庣殑瀛楃涓�
-	 */
-	public static String reverseString(String str) {
-		StringBuffer resultStringBuffer = new StringBuffer();
-		String[] allStr = str.split(" ");
-		StringBuffer sb = new StringBuffer(); // 淇濆瓨闇�瑕佽繘琛屽弽杞殑瀛楃涓�
-		for (int i = 0; i < allStr.length; i++) {
-			if (meetReverseCondition(allStr[i])) {
-				sb.delete(0, sb.length());
+    /**
+     * 瀹炵幇瀵圭鍚堟潯浠剁殑瀛楃涓茬殑鍙嶈浆
+     *
+     * @param str 鍘熷瀛楃涓�
+     * @return 缁忚繃鍙嶈浆澶勭悊鍚庣殑瀛楃涓�
+     */
+    public static String reverseString(String str) {
+        StringBuffer resultStringBuffer = new StringBuffer();
+        String[] allStr = str.split(" ");
+        StringBuffer sb = new StringBuffer(); // 淇濆瓨闇�瑕佽繘琛屽弽杞殑瀛楃涓�
+        for (int i = 0; i < allStr.length; i++) {
+            if (meetReverseCondition(allStr[i])) {
+                sb.delete(0, sb.length());
 
-				// 灏嗛渶瑕佸弽杞殑瀛楃涓插弽杞悗娣诲姞鍒扮粨鏋滃瓧绗︿覆
-				resultStringBuffer.append(sb.append(allStr[i]).reverse()).append(" ");
-			} else {
-				resultStringBuffer.append(allStr[i]).append(" ");
-			}
-		}
+                // 灏嗛渶瑕佸弽杞殑瀛楃涓插弽杞悗娣诲姞鍒扮粨鏋滃瓧绗︿覆
+                resultStringBuffer.append(sb.append(allStr[i]).reverse()).append(" ");
+            } else {
+                resultStringBuffer.append(allStr[i]).append(" ");
+            }
+        }
 
-		return resultStringBuffer.deleteCharAt(resultStringBuffer.length() - 1).toString();
-	}
+        return resultStringBuffer.deleteCharAt(resultStringBuffer.length() - 1).toString();
+    }
 
-	/**
-	 * 鍒ゆ柇瀛楃涓叉槸鍚︾鍚堝弽杞潯浠� 鏈嚱鏁拌reverseString(String str)璋冪敤
-	 *
-	 * @param str
-	 *            闇�瑕佽繘琛屽弽杞鐞嗙殑瀛楃涓�
-	 * @return true 绗﹀悎鍙嶈浆鏉′欢 false 涓嶇鍚堝弽杞潯浠�
-	 */
-	private static boolean meetReverseCondition(String str) {
-		// 濡傛灉瀛楃涓叉槸浠�'*'寮�澶村苟涓旈暱搴﹀ぇ浜�1,骞朵笖绗簩涓瓧绗︽槸鑻辨枃,姹夊瓧鎴栨暟瀛�
-		return (str.charAt(0) == '*') && (str.length() > 1) && Character.isLetterOrDigit(str.charAt(1));
-	}
+    /**
+     * 鍒ゆ柇瀛楃涓叉槸鍚︾鍚堝弽杞潯浠� 鏈嚱鏁拌reverseString(String str)璋冪敤
+     *
+     * @param str 闇�瑕佽繘琛屽弽杞鐞嗙殑瀛楃涓�
+     * @return true 绗﹀悎鍙嶈浆鏉′欢 false 涓嶇鍚堝弽杞潯浠�
+     */
+    private static boolean meetReverseCondition(String str) {
+        // 濡傛灉瀛楃涓叉槸浠�'*'寮�澶村苟涓旈暱搴﹀ぇ浜�1,骞朵笖绗簩涓瓧绗︽槸鑻辨枃,姹夊瓧鎴栨暟瀛�
+        return (str.charAt(0) == '*') && (str.length() > 1) && Character.isLetterOrDigit(str.charAt(1));
+    }
 
-	/**
-	 *
-	 * 鍙栧瓧绗︿覆鐨勫墠maxLength闀垮害鐨勫瓧涓诧紙涓�涓腑鏂囧瓧绗︿负2涓暱搴︼級
-	 *
-	 *
-	 * @param str
-	 * @param maxLength
-	 * @return String throws
-	 */
-	public static String splitStr(String str, int maxLength) {
-		if (maxLength <= 0) {
-			return "";
-		}
-		String result = str;
-		byte[] bytes = str.getBytes();
-		if (bytes.length > maxLength) {
+    /**
+     * 鍙栧瓧绗︿覆鐨勫墠maxLength闀垮害鐨勫瓧涓诧紙涓�涓腑鏂囧瓧绗︿负2涓暱搴︼級
+     *
+     * @param str
+     * @param maxLength
+     * @return String throws
+     */
+    public static String splitStr(String str, int maxLength) {
+        if (maxLength <= 0) {
+            return "";
+        }
+        String result = str;
+        byte[] bytes = str.getBytes();
+        if (bytes.length > maxLength) {
 
-			result = new String(bytes, 0, maxLength);
-			if (!result.substring(result.length() - 1).equals(str.substring(result.length() - 1, result.length()))) {
-				result = new String(bytes, 0, maxLength - 1);
-			}
-		}
+            result = new String(bytes, 0, maxLength);
+            if (!result.substring(result.length() - 1).equals(str.substring(result.length() - 1, result.length()))) {
+                result = new String(bytes, 0, maxLength - 1);
+            }
+        }
 
-		return result;
-	}
+        return result;
+    }
 
-	/**
-	 * 鍒ゆ柇鏄惁瀛樺湪
-	 *
-	 * @param filterStr
-	 * @param id
-	 * @return boolean
-	 */
-	public static boolean isExists(String filterStr, String id) {
-		String[] filterTag = filterStr.split(",");
-		for (int i = 0; i < filterTag.length; i++) {
-			if (id.equals(filterTag[i])) {
-				return true;
-			}
-		}
-		return false;
-	}
+    /**
+     * 鍒ゆ柇鏄惁瀛樺湪
+     *
+     * @param filterStr
+     * @param id
+     * @return boolean
+     */
+    public static boolean isExists(String filterStr, String id) {
+        String[] filterTag = filterStr.split(",");
+        for (int i = 0; i < filterTag.length; i++) {
+            if (id.equals(filterTag[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
 
-	/**
-	 * 鏍煎紡鍖栨椂闂�
-	 *
-	 * @param
-	 *            dt
-	 * @param
-	 *            format
-	 * @return String
-	 */
-	public static String getTime(Date dt, String format) {
-		String time = null;
-		java.text.DateFormat df = new java.text.SimpleDateFormat(format);
-		time = df.format(dt);
+    /**
+     * 鏍煎紡鍖栨椂闂�
+     *
+     * @param dt
+     * @param format
+     * @return String
+     */
+    public static String getTime(Date dt, String format) {
+        String time = null;
+        java.text.DateFormat df = new java.text.SimpleDateFormat(format);
+        time = df.format(dt);
 
-		return time;
-	}
+        return time;
+    }
 
-	public static String[] stringToArray(String str, String start, String end, String split) {
-		if (null == str || "".equals(str))
-			return null;
-		if (str.indexOf(start) == -1 || str.indexOf(end) == -1 || str.indexOf(split) == -1)
-			return new String[] { str };
-		return str.substring(str.indexOf(start) + 1, str.indexOf(end)).split(split);
-	}
+    public static String[] stringToArray(String str, String start, String end, String split) {
+        if (null == str || "".equals(str))
+            return null;
+        if (str.indexOf(start) == -1 || str.indexOf(end) == -1 || str.indexOf(split) == -1)
+            return new String[]{str};
+        return str.substring(str.indexOf(start) + 1, str.indexOf(end)).split(split);
+    }
 
-	/**
-	 * 鍒ゆ柇瀛楃涓叉槸鍚︿负null鎴栬�呯┖
-	 *
-	 * @param str
-	 * @return
-	 */
-	public static boolean isEmpty(String str) {
-		return str == null || "".equals(str);
-	}
+    /**
+     * 鍒ゆ柇瀛楃涓叉槸鍚︿负null鎴栬�呯┖
+     *
+     * @param str
+     * @return
+     */
+    public static boolean isEmpty(String str) {
+        return str == null || "".equals(str);
+    }
 
-	/**
-	 * 鑾峰彇鎸囧畾闀垮害(鎸夊瓧鑺傞暱搴﹁幏鍙�)鐨勫瓧绗︿覆锛屼腑鏂囩畻2涓瓧鑺傞暱搴︼紝鍏煎oracle鐨� varchar2闀垮害璁$畻鏂瑰紡
-	 *
-	 * @param src
-	 *            婧愬瓧绗︿覆
-	 * @param length
-	 *            闀垮害
-	 * @return
-	 */
-	public static String getSubStr(String src, int length) {
-		if (StringUtil.isEmpty(src)) {
-			return null;
-		}
-		byte[] b = src.getBytes();
-		if (b.length > length) {
-			byte[] s = new byte[length];
-			for (int i = 0; i < length; i++) {
-				s[i] = b[i];
-			}
-			return new String(s);
-		} else {
-			return src;
-		}
-	}
+    /**
+     * 鑾峰彇鎸囧畾闀垮害(鎸夊瓧鑺傞暱搴﹁幏鍙�)鐨勫瓧绗︿覆锛屼腑鏂囩畻2涓瓧鑺傞暱搴︼紝鍏煎oracle鐨� varchar2闀垮害璁$畻鏂瑰紡
+     *
+     * @param src    婧愬瓧绗︿覆
+     * @param length 闀垮害
+     * @return
+     */
+    public static String getSubStr(String src, int length) {
+        if (StringUtil.isEmpty(src)) {
+            return null;
+        }
+        byte[] b = src.getBytes();
+        if (b.length > length) {
+            byte[] s = new byte[length];
+            for (int i = 0; i < length; i++) {
+                s[i] = b[i];
+            }
+            return new String(s);
+        } else {
+            return src;
+        }
+    }
 
+    public static String truncateMessage(String description, int length) {
+        org.springframework.util.Assert.state(length > 0);
+        if ((description != null) && (description.length() > length)) {
+            return description.substring(0, length);
+        }
+
+        return description;
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0