Browse Source

feat: 岗位导入添加字段

zhangying 10 months ago
parent
commit
983a194082

+ 17 - 0
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.*;
 import java.util.*;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 @Service("PostService")
 @Service("PostService")
@@ -61,6 +62,10 @@ public class PostServiceImpl implements PostService {
     @Autowired
     @Autowired
     private PcWorkcategoryMapper pcWorkcategoryMapper;
     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
     @Override
     public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
     public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
                                     String professionName, Integer minCount, Integer maxCount,
                                     String professionName, Integer minCount, Integer maxCount,
@@ -504,6 +509,18 @@ public class PostServiceImpl implements PostService {
                     errorInfo += "输入的学历要求不存在!";
                     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)) {
             if (stringUtils.IsNullOrEmpty(errorInfo)) {
                 resultList.add(item);
                 resultList.add(item);
             } else {
             } else {

BIN
src/main/resources/static/doc/template/岗位信息导入模板.xlsx


+ 3 - 0
vue/src/views/companyService/post/index.vue

@@ -198,6 +198,9 @@ export default defineComponent({
         {cnName: '开始日期', enName: 'startTime', width: 100},
         {cnName: '开始日期', enName: 'startTime', width: 100},
         {cnName: '结束日期', enName: 'endTime', width: 100},
         {cnName: '结束日期', enName: 'endTime', width: 100},
         {cnName: '工作地点', enName: 'jobPlace', width: 100},
         {cnName: '工作地点', enName: 'jobPlace', width: 100},
+        {cnName: '联系人', enName: 'contactName', width: 100},
+        {cnName: '联系人电话', enName: 'contactMobile', width: 100},
+        {cnName: '联系人邮箱', enName: 'contactEmail', width: 100},
         {cnName: '工作年限', enName: 'workYearName', width: 100},
         {cnName: '工作年限', enName: 'workYearName', width: 100},
         {cnName: '学历要求', enName: 'cultureLevelName', width: 100},
         {cnName: '学历要求', enName: 'cultureLevelName', width: 100},
         {cnName: '岗位最高月薪', enName: 'maxSalary', width: 100},
         {cnName: '岗位最高月薪', enName: 'maxSalary', width: 100},