Parcourir la source

工具类的一些判断

xiaochan il y a 3 ans
Parent
commit
a711f03e16

+ 1 - 0
src/main/java/thyyxxk/webserver/utils/DateUtil.java

@@ -154,6 +154,7 @@ public class DateUtil {
     }
 
     public static Boolean shiJianDaXiao(Date startTime, Date endTime, String yunSuanFu) {
+        if (startTime == null || endTime == null) return false;
         switch (yunSuanFu) {
             case ">":
                 return startTime.compareTo(endTime) > 0;

+ 1 - 2
src/main/java/thyyxxk/webserver/utils/StringUtil.java

@@ -1,7 +1,6 @@
 package thyyxxk.webserver.utils;
 
 
-import com.microsoft.sqlserver.jdbc.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 
 import java.util.ArrayList;
@@ -75,7 +74,7 @@ public class StringUtil {
      * @return 返回 到底要不要 toUpperCase
      */
     public static String isContainChinese(String str) {
-        if (StringUtils.isEmpty(str)) {
+        if (isBlank(str)) {
             return "";
         }
         Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");