diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/RecruitFollowController.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/RecruitFollowController.java index adf55d3..eeb38cb 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/RecruitFollowController.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/RecruitFollowController.java @@ -67,6 +67,9 @@ public class RecruitFollowController extends BaseController { @Autowired private PostGradeService postGradeService; + @Autowired + private EntryManageService entryManageService; + // @PreAuthorize("@ss.hasPermi('recruit:follow:add')") // @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT) @@ -243,6 +246,33 @@ public class RecruitFollowController extends BaseController { filteredFollowVOList.add(followVO); } ); + //获取入职管理的(接受offer人数:是否确认入职)(入职人数:实际入职日期) + List entryManageList=entryManageService.getOfferCounts(startDate,endDate); + if(!CollectionUtils.isEmpty(entryManageList)){ + //筛选出entryManageList里《接受offer人数》 + List offerLists = entryManageList.stream() + .filter(entry -> "1".equals(entry.getIsEntry())) + .collect(Collectors.toList()); + //将这个offerList 根据岗位id进行分组 + Map> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId)); + + //筛选出entryManageList里《入职人数》 + List entryList = entryManageList.stream() + .filter(entry -> entry.getActualJoinDate() != null) + .collect(Collectors.toList()); + Map> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId)); + filteredFollowVOList.forEach(followVO -> { + List offer = offerMap.get(followVO.getPostId()); + List entry = entryMap.get(followVO.getPostId()); + + if (offer != null) { + followVO.setOfferCount(offer.size()); + } + if(entry!=null){ + followVO.setEntryCount(entry.size()); + } + }); + } // filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0 filteredFollowVOList.forEach(followVO -> { @@ -261,8 +291,8 @@ public class RecruitFollowController extends BaseController { if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L); if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L); if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L); - if (followVO.getOfferCount() == null) followVO.setOfferCount(0L); - if (followVO.getEntryCount() == null) followVO.setEntryCount(0L); + if (followVO.getOfferCount() == null) followVO.setOfferCount(0); + if (followVO.getEntryCount() == null) followVO.setEntryCount(0); //再根据岗位公海里绑定的hr进行重新覆盖写入;因为有可能某岗位被分配给其他人了。 RecruitPost recruitPost = recruitPostService.getOne(new LambdaQueryWrapper().eq(RecruitPost::getNodeId, followVO.getPostId())); @@ -306,8 +336,6 @@ public class RecruitFollowController extends BaseController { private void handleFollowRecords(FollowDTO req, List followVOList,LocalDate startDate,LocalDate endDate) { String hrName = req.getHrName(); - - // 定义所有需要处理的状态及其对应的Map Map>> statusMaps = new HashMap<>(); statusMaps.put(-1, resumeFollowRecordService.listBySelect(req).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); @@ -315,8 +343,8 @@ public class RecruitFollowController extends BaseController { statusMaps.put(4, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 4).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); statusMaps.put(5, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 5).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); statusMaps.put(1, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 1).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); - statusMaps.put(2, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 2).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); - statusMaps.put(6, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 6).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); + // statusMaps.put(2, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 2).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); + //statusMaps.put(6, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 6).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId))); // 处理每种状态下的记录 for (Map.Entry>> entry : statusMaps.entrySet()) { @@ -359,12 +387,12 @@ public class RecruitFollowController extends BaseController { case 1: followVO.setSalaryCount(records.stream().filter(r -> "1".equals(r.getFinalPass())).count()); break; - case 6: - followVO.setOfferCount(records.stream().filter(r -> "1".equals(r.getAcceptOffer())).count()); - break; - case 2: - followVO.setEntryCount(records.stream().filter(r -> r.getActualJoinDate() != null).count()); - break; +// case 6: +// followVO.setOfferCount(records.stream().filter(r -> "1".equals(r.getAcceptOffer())).count()); +// break; +// case 2: +// followVO.setEntryCount(records.stream().filter(r -> r.getActualJoinDate() != null).count()); +// break; } } } @@ -464,6 +492,34 @@ public class RecruitFollowController extends BaseController { filteredFollowVOList.add(followVO); } ); + //获取入职管理的(接受offer人数:是否确认入职)(入职人数:实际入职日期) + List entryManageList=entryManageService.getOfferCounts(startDate,endDate); + if(!CollectionUtils.isEmpty(entryManageList)){ + //筛选出entryManageList里《接受offer人数》 + List offerLists = entryManageList.stream() + .filter(entry -> "1".equals(entry.getIsEntry())) + .collect(Collectors.toList()); + //将这个offerList 根据岗位id进行分组 + Map> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId)); + + //筛选出entryManageList里《入职人数》 + List entryList = entryManageList.stream() + .filter(entry -> entry.getActualJoinDate() != null) + .collect(Collectors.toList()); + Map> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId)); + filteredFollowVOList.forEach(followVO -> { + List offer = offerMap.get(followVO.getPostId()); + List entry = entryMap.get(followVO.getPostId()); + + if (offer != null) { + followVO.setOfferCount(offer.size()); + } + if(entry!=null){ + followVO.setEntryCount(entry.size()); + } + }); + } + //需求人数总数 Integer postCountTotal=0; //主动打招呼总数 @@ -479,9 +535,9 @@ public class RecruitFollowController extends BaseController { //终试通过人数总数 Long salaryCountTotal=0L; //接收offer人数总数 - Long offerCountTotal=0L; + Integer offerCountTotal=0; //入职人数总数 - Long entryCountTotal=0L; + Integer entryCountTotal=0; // filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0 for (FollowVO followVO:filteredFollowVOList){ @@ -499,8 +555,8 @@ public class RecruitFollowController extends BaseController { if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L); if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L); if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L); - if (followVO.getOfferCount() == null) followVO.setOfferCount(0L); - if (followVO.getEntryCount() == null) followVO.setEntryCount(0L); + if (followVO.getOfferCount() == null) followVO.setOfferCount(0); + if (followVO.getEntryCount() == null) followVO.setEntryCount(0); Optional optionalPostGrade = postGradeList.stream() .filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId())) diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/FollowVO.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/FollowVO.java index 0c7ca8c..f4fc3c7 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/FollowVO.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/FollowVO.java @@ -91,11 +91,11 @@ public class FollowVO { @ApiModelProperty(value = "offer人数") @Excel(name = "接受offer人数") - private Long offerCount; + private Integer offerCount; @ApiModelProperty(value = "入职人数") @Excel(name = "入职人数") - private Long entryCount; + private Integer entryCount; // @ApiModelProperty(value = "离职人数") // private Long leaveCount; diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java index 8f65cde..b88dc27 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/mapper/EntryManageMapper.java @@ -25,6 +25,8 @@ public interface EntryManageMapper extends BaseMapper { List getListByWeek(@Param("now") LocalDate now, @Param("plusDays") LocalDate plusDays); List listByYear(@Param("year") String year); + + List getOfferCounts(@Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate); } diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java index 71af1bf..d6b1ec4 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/EntryManageService.java @@ -22,4 +22,6 @@ public interface EntryManageService extends IService { List getListByWeek(LocalDate now, LocalDate plusDays); List listByYear(String year); + + List getOfferCounts(LocalDate startDate, LocalDate endDate); } diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java index c2fc993..03a7cf7 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/service/impl/EntryManageServiceImpl.java @@ -38,6 +38,11 @@ public class EntryManageServiceImpl extends ServiceImpl listByYear(String year) { return this.baseMapper.listByYear(year); } + + @Override + public List getOfferCounts(LocalDate startDate, LocalDate endDate) { + return this.baseMapper.getOfferCounts(startDate,endDate); + } } diff --git a/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml index 9edf6f7..67e40a3 100644 --- a/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml +++ b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml @@ -76,4 +76,15 @@ CONCAT(#{year}, '-12-31') AND join_date is not null + + + +