|
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service("PostService")
|
|
@@ -61,6 +62,10 @@ public class PostServiceImpl implements PostService {
|
|
|
@Autowired
|
|
|
private PcWorkcategoryMapper pcWorkcategoryMapper;
|
|
|
|
|
|
+ private final String MOBILE_REGEX = "0?(13|14|15|16|18|17|19)[0-9]{9}";
|
|
|
+ private final String LONG_MOBILE_REGEX = "[0-9-()()]{7,18}";
|
|
|
+ private final String EMAIL_REGEX = "^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+\\.){1,63}[a-z0-9]+$";
|
|
|
+
|
|
|
@Override
|
|
|
public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
|
|
|
String professionName, Integer minCount, Integer maxCount,
|
|
@@ -504,6 +509,18 @@ public class PostServiceImpl implements PostService {
|
|
|
errorInfo += "输入的学历要求不存在!";
|
|
|
}
|
|
|
|
|
|
+ if (!stringUtils.IsNullOrEmpty(item.getContactMobile())) {
|
|
|
+ if (!Pattern.matches(MOBILE_REGEX, item.contactMobile) && !Pattern.matches(LONG_MOBILE_REGEX, item.contactMobile)) {
|
|
|
+ errorInfo += "输入的联系人电话格式不正确";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!stringUtils.IsNullOrEmpty(item.getCompanyEmail())) {
|
|
|
+ if (!Pattern.matches(EMAIL_REGEX, item.contactEmail)) {
|
|
|
+ errorInfo += "输入的邮箱格式不正确";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (stringUtils.IsNullOrEmpty(errorInfo)) {
|
|
|
resultList.add(item);
|
|
|
} else {
|