Browse Source

web-企业岗位、求职人员互推调整

liao-sea 8 months ago
parent
commit
bbbfdf52c0

+ 13 - 20
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/RecommendMgtServiceImpl.java

@@ -136,7 +136,7 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
             });
 
             addList.forEach(x -> {
-                pcRecommendMgtMapper.insert(x);
+                result[0] = pcRecommendMgtMapper.insert(x);
             });
 
 //            serviceList.forEach(item -> {
@@ -200,12 +200,15 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
                                                         Integer workYear, List<String> regionNameList, List<String> siteNameList,Integer minSalary,Integer maxSalary) {
         PageHelper.startPage(page, rows);
         List<String> recommendedJobHuntIDList = new ArrayList<>();
-        PcRecommendMgtExample recommendMgtExp = new PcRecommendMgtExample();
-        recommendMgtExp.or().andPostIDEqualTo(postID);
-        var recommendedList = pcRecommendMgtMapper.selectByExample(recommendMgtExp);
-        if( recommendedList.size()>0 && type.equals(0)){
-            for(PcRecommendMgt curRecommended:recommendedList){
-                recommendedJobHuntIDList.add(curRecommended.getJobHuntID());
+        //type为0时推荐求职人员(意向)给企业岗位,需要过滤已推荐的求职意向信息
+        if(type.equals(0)){
+            PcRecommendMgtExample recommendMgtExp = new PcRecommendMgtExample();
+            recommendMgtExp.or().andPostIDEqualTo(postID);
+            var recommendedList = pcRecommendMgtMapper.selectByExample(recommendMgtExp);
+            if( recommendedList.size()>0){
+                for(PcRecommendMgt curRecommended:recommendedList){
+                    recommendedJobHuntIDList.add(curRecommended.getJobHuntID());
+                }
             }
         }
         List<RecommendJobVo> list = recommendMgtCQuery.getRecommendJobList(postID, professionID, huntProfessionName, userName, type, cultureRank, keyPersonType, parentProfessionID, workYear,stringUtils.ListToInSql(regionNameList),stringUtils.ListToInSql(siteNameList), minSalary, maxSalary,stringUtils.ListToInSql(recommendedJobHuntIDList));
@@ -215,22 +218,12 @@ public class RecommendMgtServiceImpl implements RecommendMgtService {
                 x.setRecommendMgtID(UUID.randomUUID().toString());
             }
             x.setUserMobile(calculateUtils.maskMobile(desUtils.decoderText(x.getUserMobile())));
-            //过滤已入职的求职意向数据
+            //type为0时推荐求职人员(意向)给企业岗位,需要过滤已入职的求职意向信息
             PcRecommendMgtExample curRecommendMgtExp = new PcRecommendMgtExample();
             curRecommendMgtExp.or().andJobHuntIDEqualTo(x.getJobhuntID());
             var curRecommendMgtInfo = pcRecommendMgtMapper.selectByExample(curRecommendMgtExp).stream().findFirst().orElse(null);
-            if( curRecommendMgtInfo ==null || curRecommendMgtInfo.getEntryState().equals(0)){
-                //PcJobhuntExample curJobHuntExp = new PcJobhuntExample();
-                //curJobHuntExp.or().andJobHuntIDEqualTo(x.getJobhuntID());
-                //var curJobHuntInfo = pcJobhuntMapper.selectByExample(curJobHuntExp).stream().findFirst().orElse(null);
-                //if( curJobHuntInfo != null){
-                //    PcJobuserExample curJobUserExp = new PcJobuserExample();
-                //    curJobUserExp.or().andJobuserIDEqualTo(curJobHuntInfo.getJobUserID());
-                //    var curJobUserInfo = pcJobuserMapper.selectByExample(curJobUserExp).stream().findFirst().orElse(null);
-                //    if(!curJobUserInfo.getJobStatusID().equals(1)){
-                //        resultList.add(x);
-                //    }
-                //}
+            //type为1则查询已推荐的所有意向信息,不需要过滤已入职的求职意向
+            if( type.equals(1) || curRecommendMgtInfo ==null || curRecommendMgtInfo.getEntryState().equals(0)){
                 resultList.add(x);
             }
         });

+ 2 - 1
src/main/resources/mapping/cquery/RecommendMgtCQuery.xml

@@ -100,6 +100,7 @@
         <where>
             <if test="type!=null and type==0">
                 and d.RecommendMgtID is null
+                and a.RecordStatus = 1
             </if>
             <if test="type!=null and type==1">
                 and d.RecommendMgtID is not null
@@ -185,6 +186,7 @@
         <where>
             <if test="type!=null and type==0">
                 and d.RecommendMgtID is null
+                and b.jobStatusID != 1
             </if>
             <if test="type!=null and type==1">
                 and d.RecommendMgtID is not null
@@ -236,7 +238,6 @@
                 and a.jobhuntid not in (${recommendedJobHuntIDList})
             </if>
         </where>
-        and b.jobStatusID != 1
         order by a.CreateTime desc
     </select>
     <select id="getProfessionLevelList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">

+ 1 - 1
vue/src/views/jobUserManager/jobhunt/recommend.vue

@@ -523,7 +523,7 @@ export default defineComponent({
           loadData();
           addRecommendList.value = [];
         }else{
-          message.error("该岗位招聘日期已结束,不能推荐!");
+          message.error("该岗位已停用或招聘日期已结束,不能推荐!");
         }
       });
     };