浏览代码

Merge remote-tracking branch 'origin/master'

lizeyu 10 月之前
父节点
当前提交
fe32651399

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/baseSettings/SiteUserController.java

@@ -129,7 +129,7 @@ public class SiteUserController {
         List<SiteUserVo> result = userInfoService.importSiteUser(dataList, accountService.getLoginUserID());
 
         if (result != null && result.size() > 0) {
-            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+            return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
         } else {
             return RespGenerstor.success(true);
         }

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/companyService/CompanyController.java

@@ -196,7 +196,7 @@ public class CompanyController {
         List<CompanyVo> result = companyService.importCompany(data, accountService.getLoginUserID());
 
         if (result != null && result.size() > 0) {
-            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+            return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
         } else {
             return RespGenerstor.success(true);
         }

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -193,7 +193,7 @@ public class PostController {
     public BaseResponse<Object> importPost(@RequestBody List<PostVo> dataList){
         List<PostVo> result = postService.importPost(dataList, accountService.getLoginUserID());
         if (result != null && result.size() > 0) {
-            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+            return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
         } else {
             return RespGenerstor.success(true);
         }

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobHuntController.java

@@ -107,7 +107,7 @@ public class JobHuntController {
     public BaseResponse<Object> importPost(@RequestBody List<JobHuntVo> dataList) {
         List<JobHuntVo> result = jobhuntService.importJobHunt(dataList, accountService.getLoginUserID());
         if (result != null && result.size() > 0) {
-            return RespGenerstor.fail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
+            return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);
         } else {
             return RespGenerstor.success(true);
         }

+ 11 - 0
src/main/java/com/hz/employmentsite/filter/exception/RespGenerstor.java

@@ -12,4 +12,15 @@ public class RespGenerstor {
     public static BaseResponse<Object> fail(String code, String message) {
         return new BaseResponse<Object>(code, message, null);
     }
+
+    /**
+     * 导入时,数据不填充错误信息
+     *
+     * @param baseErrorEnum 错误代码
+     * @param data          接口数据
+     * @return
+     */
+    public static BaseResponse<Object> importFail(BaseErrorEnum baseErrorEnum, Object data) {
+        return new BaseResponse<Object>(baseErrorEnum.getCode(), baseErrorEnum.getMessage(), data);
+    }
 }

+ 44 - 5
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -58,6 +58,9 @@ public class PostServiceImpl implements PostService {
     @Autowired
     private RecommendMgtCQuery recommendMgtCQuery;
 
+    @Autowired
+    private PcWorkcategoryMapper pcWorkcategoryMapper;
+
     @Override
     public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
                                     String professionName, Integer minCount, Integer maxCount,
@@ -361,19 +364,46 @@ public class PostServiceImpl implements PostService {
                 for (PcProfession curItem : thirdLevelData) {
                     SysDictionaryItem item = new SysDictionaryItem();
                     item.setCode(curItem.getProfessionID());
-                    item.setCode(curItem.getProfessionName());
+                    item.setName(curItem.getProfessionName());
                     thirdLevelProfessionList.add(item);
                 }
             }
         }
+        // 工种信息
+        List<SysDictionaryItem> WorkCategoryList = new ArrayList<>();
+        // 获取第一级工种
+        PcWorkcategoryExample workCategoryExample = new PcWorkcategoryExample();
+        workCategoryExample.or().andParentWorkCategoryIDEqualTo("").andStatusEqualTo(1);
+        List<PcWorkcategory> firstLevelWorkCategoryList = pcWorkcategoryMapper.selectByExample(workCategoryExample);
+        for (PcWorkcategory pcWorkcategory : firstLevelWorkCategoryList) {
+            // 获取第二级工种
+            workCategoryExample = new PcWorkcategoryExample();
+            workCategoryExample.or().andParentWorkCategoryIDEqualTo(pcWorkcategory.getWorkCategoryID()).andStatusEqualTo(1);
+            List<PcWorkcategory> secondLevelWorkCategoryList = pcWorkcategoryMapper.selectByExample(workCategoryExample);
+            for (PcWorkcategory workCategory : secondLevelWorkCategoryList) {
+                // 获取第三级工种
+                workCategoryExample = new PcWorkcategoryExample();
+                workCategoryExample.or().andParentWorkCategoryIDEqualTo(workCategory.getWorkCategoryID()).andStatusEqualTo(1);
+                List<PcWorkcategory> thirdLevelWorkCategoryList = pcWorkcategoryMapper.selectByExample(workCategoryExample);
+                for (PcWorkcategory pcWorkCategory1 : thirdLevelWorkCategoryList) {
+                    SysDictionaryItem item = new SysDictionaryItem();
+                    item.setCode(pcWorkCategory1.getWorkCategoryID());
+                    item.setName(pcWorkCategory1.getWorkCategoryName());
+                    WorkCategoryList.add(item);
+                }
+            }
+        }
 
         //文化程度
         List<SysDictionaryItem> dicCultureDataList = dictionaryService.getDictionaryItemList("CultureLevel");
+        // 工作年限
         List<SysDictionaryItem> dicWorkYearDataList = dictionaryService.getDictionaryItemList("WorkYearType");
         List<PostVo> resultList = new ArrayList<>();
 
         dataList.forEach(item -> {
             String errorInfo = "";
+            item.setPostID(UUID.randomUUID().toString());
+            item.setRecordStatus(1);
             if (stringUtils.IsNullOrEmpty(item.companyName))
                 errorInfo += "请填写企业名称!";
             else {
@@ -390,6 +420,15 @@ public class PostServiceImpl implements PostService {
                 if (item.professionID == null || item.professionID == "")
                     errorInfo += "岗位不存在!";
             }
+            if (stringUtils.IsNullOrEmpty(item.getWorkCategoryName())) {
+                errorInfo += "请填写工种名称";
+            } else {
+                item.workCode = WorkCategoryList.stream().filter(it -> it.getName().equals(item.getWorkCategoryName().trim()))
+                        .findFirst().orElse(new SysDictionaryItem()).getCode();
+                if (item.workCode == null || item.workCode == "") {
+                    errorInfo += "工种不存在!";
+                }
+            }
 
             if (stringUtils.IsNullOrEmpty(String.valueOf(item.recruitCount)) || item.recruitCount == null)
                 errorInfo += "请填写招聘人数!";
@@ -401,11 +440,11 @@ public class PostServiceImpl implements PostService {
             if (stringUtils.IsNullOrEmpty(item.jobPlace))
                 errorInfo += "请填写工作地点!";
 
-            if (stringUtils.IsNullOrEmpty(item.workYearStr)) {
-                item.workYear = dicWorkYearDataList.stream().filter(it -> it.getName().equals(item.workYearStr.trim()))
+            if (!stringUtils.IsNullOrEmpty(item.getWorkYearName())) {
+                item.workYear = dicWorkYearDataList.stream().filter(it -> it.getName().equals(item.getWorkYearName().trim()))
                         .findFirst().orElse(new SysDictionaryItem()).getValue();
-                if (item.workYear == null || item.workYear == 0)
-                    errorInfo += "输入的工作年限不存在!";
+                if (item.workYear == null)
+                    errorInfo += "工作年限不存在!";
             }
 
             if (item.isTrailName.trim().equals("是")) item.isTrail = true;

+ 39 - 9
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobHuntServiceImpl.java

@@ -198,23 +198,53 @@ public class JobHuntServiceImpl implements JobHuntService {
         if (dataList.size() <= 0)
             throw new BaseException("", "请添加导入数据!");
         //求职人员
-        PcJobuserExample jobuserExample = new PcJobuserExample();
-        jobuserExample.or().andNameIsNotNull();
-        List<PcJobuser> jobUserList = pcJobuserMapper.selectByExample(jobuserExample);
+        PcSiteUserExample siteUserExp = new PcSiteUserExample();
+        siteUserExp.or().andUserIDEqualTo(userID);
+        PcSiteUser curLoginSiteUser = pcSiteUserMapper.selectByExample(siteUserExp).stream().findFirst().orElse(null);
+
+        List<PcJobuser> jobUserList = new ArrayList<>();
+        if(curLoginSiteUser==null){
+            throw new BaseException("", "未能查询到当前登录人的驿站信息!");
+        }else{
+            PcJobuserExample jobuserExample = new PcJobuserExample();
+            jobuserExample.or().andNameIsNotNull().andSiteIDEqualTo(curLoginSiteUser.getSiteID());
+            jobUserList = pcJobuserMapper.selectByExample(jobuserExample);
+        }
         //岗位
-        List<PcProfession> proList = pcProfessionMapper.selectByExample(null);
+        List<SysDictionaryItem> thirdLevelProfessionList = new ArrayList<>();
+        PcProfessionExample professionExp = new PcProfessionExample();
+        professionExp.or().andParentProfessionIDEqualTo("").andStatusEqualTo(1);
+        var firstLevelData = pcProfessionMapper.selectByExample(professionExp);
+        for (PcProfession curProfession : firstLevelData) {
+            professionExp = new PcProfessionExample();
+            professionExp.or().andParentProfessionIDEqualTo(curProfession.getProfessionID()).andStatusEqualTo(1);
+            var secondLevelData = pcProfessionMapper.selectByExample(professionExp);
+            for (PcProfession curParentProfession : secondLevelData) {
+                professionExp = new PcProfessionExample();
+                professionExp.or().andParentProfessionIDEqualTo(curParentProfession.getProfessionID()).andStatusEqualTo(1);
+                var thirdLevelData = pcProfessionMapper.selectByExample(professionExp);
+                for (PcProfession curItem : thirdLevelData) {
+                    SysDictionaryItem item = new SysDictionaryItem();
+                    item.setCode(curItem.getProfessionID());
+                    item.setName(curItem.getProfessionName());
+                    thirdLevelProfessionList.add(item);
+                }
+            }
+        }
         //求职类型
         List<SysDictionaryItem> dicHuntTypeList = dictionaryService.getDictionaryItemList("JobHuntType");
         //人才类型
         List<SysDictionaryItem> dicUserTypeList = dictionaryService.getDictionaryItemList("JobUserType");
         List<JobHuntVo> resultList = new ArrayList<>();
 
+        List<PcJobuser> finalJobUserList = jobUserList;
         dataList.forEach(item -> {
             String errorInfo = "";
+            item.setJobHuntID(UUID.randomUUID().toString());
             if (stringUtils.IsNullOrEmpty(item.jobUserName))
                 errorInfo += "请填写姓名!";
             else {
-                item.jobUserID = jobUserList.stream().filter(it -> it.getName().equals(item.getJobUserName().trim()))
+                item.jobUserID = finalJobUserList.stream().filter(it -> it.getName().equals(item.getJobUserName().trim()))
                         .findFirst().orElse(new PcJobuser()).getJobuserID();
                 if (item.jobUserID == null)
                     errorInfo += "求职人员不存在!";
@@ -245,12 +275,12 @@ public class JobHuntServiceImpl implements JobHuntService {
                 errorInfo += "请填写最高薪酬!";
 
             if (stringUtils.IsNullOrEmpty(item.professionName))
-                errorInfo += "请填写岗位名称!";
+                errorInfo += "请填写求职岗位!";
             else {
-                item.professionID = proList.stream().filter(it -> it.getProfessionName().equals(item.getProfessionName().trim()))
-                        .findFirst().orElse(new PcProfession()).getProfessionID();
+                item.professionID = thirdLevelProfessionList.stream().filter(it -> it.getName().equals(item.getProfessionName().trim()))
+                        .findFirst().orElse(new SysDictionaryItem()).getCode();
                 if (item.professionID == null)
-                    errorInfo += "岗位不存在!";
+                    errorInfo += "求职岗位不存在!";
             }
             if (stringUtils.IsNullOrEmpty(item.areaWork))
                 errorInfo += "请填写希望工作地区!";

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


二进制
src/main/resources/static/doc/template/求职意向导入模板.xlsx


+ 2 - 1
vue/src/views/companyService/post/index.vue

@@ -185,11 +185,12 @@ export default defineComponent({
       columns: [
         {cnName: '企业名称', enName: 'companyName', width: 100},
         {cnName: '岗位名称', enName: 'professionName', width: 100},
+        {cnName: '工种名称', enName: 'workCategoryName', width: 100},
         {cnName: '招聘人数', enName: 'recruitCount', width: 100},
         {cnName: '开始日期', enName: 'startTime', width: 100},
         {cnName: '结束日期', enName: 'endTime', width: 100},
         {cnName: '工作地点', enName: 'jobPlace', width: 100},
-        {cnName: '工作年限', enName: 'workYear', width: 100},
+        {cnName: '工作年限', enName: 'workYearName', width: 100},
         {cnName: '学历要求', enName: 'cultureLevelName', width: 100},
         {cnName: '岗位最高月薪', enName: 'maxSalary', width: 100},
         {cnName: '岗位最低月薪', enName: 'minSalary', width: 100},

+ 2 - 2
vue/src/views/jobUserManager/jobhunt/index.vue

@@ -285,8 +285,8 @@ export default defineComponent({
       columns: [
         {cnName: '姓名', enName: 'jobUserName', width: 100},
         // {cnName: '工种名称', enName: 'workName', width: 100},
-        {cnName: '求职类型', enName: 'jobHuntType', width: 100},
-        {cnName: '人才类型', enName: 'jobUserType', width: 100},
+        {cnName: '求职类型', enName: 'jobHuntTypeStr', width: 100},
+        {cnName: '人才类型', enName: 'jobUserTypeStr', width: 100},
         {cnName: '最低月薪(元)', enName: 'minSalary', width: 100},
         {cnName: '最高月薪(元)', enName: 'maxSalary', width: 100},
         {cnName: '求职岗位', enName: 'professionName', width: 100},