|
|
@ -67,6 +67,9 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private PostGradeService postGradeService;
|
|
|
|
private PostGradeService postGradeService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private EntryManageService entryManageService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @PreAuthorize("@ss.hasPermi('recruit:follow:add')")
|
|
|
|
// @PreAuthorize("@ss.hasPermi('recruit:follow:add')")
|
|
|
|
// @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT)
|
|
|
|
// @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT)
|
|
|
@ -243,6 +246,33 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
filteredFollowVOList.add(followVO);
|
|
|
|
filteredFollowVOList.add(followVO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
//获取入职管理的(接受offer人数:是否确认入职)(入职人数:实际入职日期)
|
|
|
|
|
|
|
|
List<EntryManage> entryManageList=entryManageService.getOfferCounts(startDate,endDate);
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(entryManageList)){
|
|
|
|
|
|
|
|
//筛选出entryManageList里《接受offer人数》
|
|
|
|
|
|
|
|
List<EntryManage> offerLists = entryManageList.stream()
|
|
|
|
|
|
|
|
.filter(entry -> "1".equals(entry.getIsEntry()))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//将这个offerList 根据岗位id进行分组
|
|
|
|
|
|
|
|
Map<Long, List<EntryManage>> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//筛选出entryManageList里《入职人数》
|
|
|
|
|
|
|
|
List<EntryManage> entryList = entryManageList.stream()
|
|
|
|
|
|
|
|
.filter(entry -> entry.getActualJoinDate() != null)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
Map<Long, List<EntryManage>> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
|
|
|
|
|
|
|
|
filteredFollowVOList.forEach(followVO -> {
|
|
|
|
|
|
|
|
List<EntryManage> offer = offerMap.get(followVO.getPostId());
|
|
|
|
|
|
|
|
List<EntryManage> entry = entryMap.get(followVO.getPostId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (offer != null) {
|
|
|
|
|
|
|
|
followVO.setOfferCount(offer.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(entry!=null){
|
|
|
|
|
|
|
|
followVO.setEntryCount(entry.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0
|
|
|
|
// filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0
|
|
|
|
filteredFollowVOList.forEach(followVO -> {
|
|
|
|
filteredFollowVOList.forEach(followVO -> {
|
|
|
@ -261,8 +291,8 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L);
|
|
|
|
if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L);
|
|
|
|
if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L);
|
|
|
|
if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L);
|
|
|
|
if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L);
|
|
|
|
if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L);
|
|
|
|
if (followVO.getOfferCount() == null) followVO.setOfferCount(0L);
|
|
|
|
if (followVO.getOfferCount() == null) followVO.setOfferCount(0);
|
|
|
|
if (followVO.getEntryCount() == null) followVO.setEntryCount(0L);
|
|
|
|
if (followVO.getEntryCount() == null) followVO.setEntryCount(0);
|
|
|
|
|
|
|
|
|
|
|
|
//再根据岗位公海里绑定的hr进行重新覆盖写入;因为有可能某岗位被分配给其他人了。
|
|
|
|
//再根据岗位公海里绑定的hr进行重新覆盖写入;因为有可能某岗位被分配给其他人了。
|
|
|
|
RecruitPost recruitPost = recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getNodeId, followVO.getPostId()));
|
|
|
|
RecruitPost recruitPost = recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getNodeId, followVO.getPostId()));
|
|
|
@ -306,8 +336,6 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private void handleFollowRecords(FollowDTO req, List<FollowVO> followVOList,LocalDate startDate,LocalDate endDate) {
|
|
|
|
private void handleFollowRecords(FollowDTO req, List<FollowVO> followVOList,LocalDate startDate,LocalDate endDate) {
|
|
|
|
String hrName = req.getHrName();
|
|
|
|
String hrName = req.getHrName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 定义所有需要处理的状态及其对应的Map
|
|
|
|
// 定义所有需要处理的状态及其对应的Map
|
|
|
|
Map<Integer, Map<Long, List<ResumeFollowRecord>>> statusMaps = new HashMap<>();
|
|
|
|
Map<Integer, Map<Long, List<ResumeFollowRecord>>> statusMaps = new HashMap<>();
|
|
|
|
statusMaps.put(-1, resumeFollowRecordService.listBySelect(req).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId)));
|
|
|
|
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(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(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(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(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(6, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 6).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId)));
|
|
|
|
|
|
|
|
|
|
|
|
// 处理每种状态下的记录
|
|
|
|
// 处理每种状态下的记录
|
|
|
|
for (Map.Entry<Integer, Map<Long, List<ResumeFollowRecord>>> entry : statusMaps.entrySet()) {
|
|
|
|
for (Map.Entry<Integer, Map<Long, List<ResumeFollowRecord>>> entry : statusMaps.entrySet()) {
|
|
|
@ -359,12 +387,12 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
followVO.setSalaryCount(records.stream().filter(r -> "1".equals(r.getFinalPass())).count());
|
|
|
|
followVO.setSalaryCount(records.stream().filter(r -> "1".equals(r.getFinalPass())).count());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
// case 6:
|
|
|
|
followVO.setOfferCount(records.stream().filter(r -> "1".equals(r.getAcceptOffer())).count());
|
|
|
|
// followVO.setOfferCount(records.stream().filter(r -> "1".equals(r.getAcceptOffer())).count());
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
case 2:
|
|
|
|
// case 2:
|
|
|
|
followVO.setEntryCount(records.stream().filter(r -> r.getActualJoinDate() != null).count());
|
|
|
|
// followVO.setEntryCount(records.stream().filter(r -> r.getActualJoinDate() != null).count());
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -464,6 +492,34 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
filteredFollowVOList.add(followVO);
|
|
|
|
filteredFollowVOList.add(followVO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
//获取入职管理的(接受offer人数:是否确认入职)(入职人数:实际入职日期)
|
|
|
|
|
|
|
|
List<EntryManage> entryManageList=entryManageService.getOfferCounts(startDate,endDate);
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(entryManageList)){
|
|
|
|
|
|
|
|
//筛选出entryManageList里《接受offer人数》
|
|
|
|
|
|
|
|
List<EntryManage> offerLists = entryManageList.stream()
|
|
|
|
|
|
|
|
.filter(entry -> "1".equals(entry.getIsEntry()))
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
//将这个offerList 根据岗位id进行分组
|
|
|
|
|
|
|
|
Map<Long, List<EntryManage>> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//筛选出entryManageList里《入职人数》
|
|
|
|
|
|
|
|
List<EntryManage> entryList = entryManageList.stream()
|
|
|
|
|
|
|
|
.filter(entry -> entry.getActualJoinDate() != null)
|
|
|
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
Map<Long, List<EntryManage>> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
|
|
|
|
|
|
|
|
filteredFollowVOList.forEach(followVO -> {
|
|
|
|
|
|
|
|
List<EntryManage> offer = offerMap.get(followVO.getPostId());
|
|
|
|
|
|
|
|
List<EntryManage> entry = entryMap.get(followVO.getPostId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (offer != null) {
|
|
|
|
|
|
|
|
followVO.setOfferCount(offer.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(entry!=null){
|
|
|
|
|
|
|
|
followVO.setEntryCount(entry.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//需求人数总数
|
|
|
|
//需求人数总数
|
|
|
|
Integer postCountTotal=0;
|
|
|
|
Integer postCountTotal=0;
|
|
|
|
//主动打招呼总数
|
|
|
|
//主动打招呼总数
|
|
|
@ -479,9 +535,9 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
//终试通过人数总数
|
|
|
|
//终试通过人数总数
|
|
|
|
Long salaryCountTotal=0L;
|
|
|
|
Long salaryCountTotal=0L;
|
|
|
|
//接收offer人数总数
|
|
|
|
//接收offer人数总数
|
|
|
|
Long offerCountTotal=0L;
|
|
|
|
Integer offerCountTotal=0;
|
|
|
|
//入职人数总数
|
|
|
|
//入职人数总数
|
|
|
|
Long entryCountTotal=0L;
|
|
|
|
Integer entryCountTotal=0;
|
|
|
|
|
|
|
|
|
|
|
|
// filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0
|
|
|
|
// filteredFollowVOList,将所有字段(除了deptName)为null的字段设置为0
|
|
|
|
for (FollowVO followVO:filteredFollowVOList){
|
|
|
|
for (FollowVO followVO:filteredFollowVOList){
|
|
|
@ -499,8 +555,8 @@ public class RecruitFollowController extends BaseController {
|
|
|
|
if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L);
|
|
|
|
if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L);
|
|
|
|
if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L);
|
|
|
|
if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L);
|
|
|
|
if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L);
|
|
|
|
if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L);
|
|
|
|
if (followVO.getOfferCount() == null) followVO.setOfferCount(0L);
|
|
|
|
if (followVO.getOfferCount() == null) followVO.setOfferCount(0);
|
|
|
|
if (followVO.getEntryCount() == null) followVO.setEntryCount(0L);
|
|
|
|
if (followVO.getEntryCount() == null) followVO.setEntryCount(0);
|
|
|
|
|
|
|
|
|
|
|
|
Optional<PostGrade> optionalPostGrade = postGradeList.stream()
|
|
|
|
Optional<PostGrade> optionalPostGrade = postGradeList.stream()
|
|
|
|
.filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId()))
|
|
|
|
.filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId()))
|
|
|
|