|
@@ -44,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -373,9 +374,17 @@ public class FactoryServiceImpl implements FactoryService {
|
|
|
if (StringUtils.isBlank(factoryProperty.getKeymanMobile())) {
|
|
|
errorMessage.append("联系人手机号").append("为空,");
|
|
|
}
|
|
|
+ Pattern patternPhone = Pattern.compile("^[1]\\d{10}$");
|
|
|
+ if(!patternPhone.matcher(factoryProperty.getKeymanMobile()).matches()){
|
|
|
+ errorMessage.append("联系人手机号").append("格式不正确,");
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(factoryProperty.getEmail())) {
|
|
|
errorMessage.append("邮箱").append("为空,");
|
|
|
}
|
|
|
+ Pattern patternEmail = Pattern.compile("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
|
|
|
+ if(!patternEmail.matcher(factoryProperty.getEmail()).matches()){
|
|
|
+ errorMessage.append("邮箱").append("格式不正确,");
|
|
|
+ }
|
|
|
|
|
|
return errorMessage.toString();
|
|
|
}
|