瀏覽代碼

咨询客户列表开发

anderx 1 年之前
父節點
當前提交
597c8b6334
共有 1 個文件被更改,包括 12 次插入9 次删除
  1. 12 9
      src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

+ 12 - 9
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -277,17 +277,20 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
         if (!contactMobile.equals("-")){
             String[] split = contactMobile.split(";");
             for (String s : split) {
-                String mobileReg="[1-9]\\d{10}";
-                String mobileReg2="^0\\d{2,3}-?\\d{7,8}$";
-                Pattern  pattern =Pattern.compile(mobileReg);
-                Matcher matcher = pattern.matcher(s);
-                if (!matcher.matches()){
-                    Pattern  pattern2 =Pattern.compile(mobileReg2);
-                    Matcher matcher2 = pattern2.matcher(s);
-                    if (!matcher2.matches()){
-                        throw new BusinessException("手机号格式不正确");
+                if (StringUtils.isNotBlank(s)){
+                    String mobileReg="[1-9]\\d{10}";
+                    String mobileReg2="^0\\d{2,3}-?\\d{7,8}$";
+                    Pattern  pattern =Pattern.compile(mobileReg);
+                    Matcher matcher = pattern.matcher(s);
+                    if (!matcher.matches()){
+                        Pattern  pattern2 =Pattern.compile(mobileReg2);
+                        Matcher matcher2 = pattern2.matcher(s);
+                        if (!matcher2.matches()){
+                            throw new BusinessException("手机号格式不正确");
+                        }
                     }
                 }
+
             }
         }