Browse Source

web-求职意向导入调整

liao-sea 9 months ago
parent
commit
d502c629c5

+ 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 += "请填写希望工作地区!";

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


+ 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},