调整主页的具体岗位展示的信息
This commit is contained in:
parent
080e513e34
commit
a42aa31423
|
@ -8,14 +8,12 @@ import cn.zeroerr.domain.dto.AnnouncementDTO;
|
|||
import cn.zeroerr.domain.dto.FollowDTO;
|
||||
import cn.zeroerr.domain.dto.HomePageDTO;
|
||||
import cn.zeroerr.domain.dto.PostDetailDTO;
|
||||
import cn.zeroerr.domain.entity.EntryManage;
|
||||
import cn.zeroerr.domain.entity.RecruitProcessTask;
|
||||
import cn.zeroerr.domain.entity.ResumeFollowRecord;
|
||||
import cn.zeroerr.domain.entity.ResumeHandleRecord;
|
||||
import cn.zeroerr.domain.entity.*;
|
||||
import cn.zeroerr.domain.vo.PostListVO;
|
||||
import cn.zeroerr.domain.vo.ResumeStatVO;
|
||||
import cn.zeroerr.service.*;
|
||||
import cn.zeroerr.system.service.RecruitStructureService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -51,6 +49,8 @@ public class HomePageController extends BaseController {
|
|||
private RecruitStructureService recruitStructureService;
|
||||
@Autowired
|
||||
private EntryManageService entryManageService;
|
||||
@Autowired
|
||||
private PostGradeService postGradeService;
|
||||
|
||||
@Anonymous
|
||||
@GetMapping("/getResumeStat")
|
||||
|
@ -133,68 +133,6 @@ public class HomePageController extends BaseController {
|
|||
resumeStatVO.setEntryPercent(0d);
|
||||
}
|
||||
|
||||
// // 使用流进行分组并求和
|
||||
// Map<Long, Integer> groupedSum = resumeHandleRecordList.stream()
|
||||
// .collect(Collectors.groupingBy(ResumeHandleRecord::getPostId,
|
||||
// Collectors.summingInt(ResumeHandleRecord::getSeenNum)));
|
||||
//
|
||||
// // 将 Map.Entry 转换为 PostIdSeenNum 对象并排序
|
||||
// List<Long> postList = groupedSum.entrySet().stream()
|
||||
// .map(entry -> new PostIdSeenNumDTO(entry.getKey(), entry.getValue()))
|
||||
// .sorted(Comparator.comparingInt(PostIdSeenNumDTO::getSeenNum).reversed())
|
||||
// .map(PostIdSeenNumDTO::getPostId)
|
||||
// .collect(Collectors.toList());
|
||||
// // 根据 postId 去重
|
||||
// List<ResumeHandleRecord> distinctRecords = new ArrayList<>(resumeHandleRecordList.stream()
|
||||
// .collect(Collectors.toMap(ResumeHandleRecord::getPostId, record -> record, (existing, replacement) -> existing))
|
||||
// .values());
|
||||
//
|
||||
// //8.某月份,某岗位面试人数List 9.某月份,某岗位入职人数List 10.某月份,优先级高的七个岗位名字
|
||||
// //找到面试跟踪里,该岗位的面试(终试)人数
|
||||
// List<ResumeFollowRecord> interviewList = resumeFollowRecordService.getPostInterViewList(postList, firstDay, lastDay);
|
||||
// //根据岗位分组
|
||||
// Map<Long, List<ResumeFollowRecord>> postInterviewMap = new HashMap<>();
|
||||
// if (!CollectionUtils.isEmpty(interviewList)) {
|
||||
// postInterviewMap = interviewList.stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId));
|
||||
// }
|
||||
// //找到面试跟踪里,该岗位的入职人数
|
||||
// List<ResumeFollowRecord> entryList = resumeFollowRecordService.getPostEntryList(postList, firstDay, lastDay);
|
||||
// Map<Long, List<ResumeFollowRecord>> postEntryMap = new HashMap<>();
|
||||
// if (!CollectionUtils.isEmpty(entryList)) {
|
||||
// postEntryMap = entryList.stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId));
|
||||
// }
|
||||
// //岗位list
|
||||
// List<String> postNameList = new ArrayList<>();
|
||||
// //面试人数
|
||||
// List<Integer> postInterviewCounts = new ArrayList<>();
|
||||
// //入职人数
|
||||
// List<Integer> postEntryCounts = new ArrayList<>();
|
||||
//
|
||||
// for (ResumeHandleRecord resumeHandleRecord :distinctRecords) {
|
||||
// //保存该岗位的名字
|
||||
// postNameList.add(resumeHandleRecord.getPostName());
|
||||
// //根据岗位id找到该岗位在筛选时间内 面试(终试)人数
|
||||
// if (!CollectionUtils.isEmpty(postInterviewMap.get(resumeHandleRecord.getPostId()))) {
|
||||
// postInterviewCounts.add(postInterviewMap.get(resumeHandleRecord.getPostId()).size());
|
||||
// } else {
|
||||
// postInterviewCounts.add(0);
|
||||
// }
|
||||
//
|
||||
// //根据岗位id找到该岗位在筛选时间内 入职人数
|
||||
// if (!CollectionUtils.isEmpty(postEntryMap.get(resumeHandleRecord.getPostId()))) {
|
||||
// postEntryCounts.add(postEntryMap.get(resumeHandleRecord.getPostId()).size());
|
||||
// } else {
|
||||
// postEntryCounts.add(0);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// resumeStatVO.setPostEntryCounts(postEntryCounts);
|
||||
// resumeStatVO.setPostInterviewCounts(postInterviewCounts);
|
||||
// resumeStatVO.setPostNameList(postNameList);
|
||||
|
||||
|
||||
//11.合格简历百分比:100 ;电话面试通过百分比:电话通过人数/简历合格数 ; 初试通过百分比: 初试通过人数/初试到面人数 ; 终试通过百分比:终试通过人数/终试到面人数。
|
||||
|
||||
|
||||
// 对resumeFollowRecordList根据postId进行分组
|
||||
Map<Long, List<ResumeFollowRecord>> groupedResumeFollowRecords = resumeFollowRecordList.stream()
|
||||
|
@ -231,13 +169,13 @@ public class HomePageController extends BaseController {
|
|||
//某月份,某岗位约面人数
|
||||
List<Integer> postInviteCounts = new ArrayList<>();
|
||||
//某月份,某岗位到面(初试)人数
|
||||
List<Long> postArriveCounts = new ArrayList<>();
|
||||
List<Integer> postArriveCounts = new ArrayList<>();
|
||||
//某月份,某岗位的终试人数
|
||||
List<Long> postFinalCounts = new ArrayList<>();
|
||||
List<Integer> postFinalCounts = new ArrayList<>();
|
||||
//某月份,某岗位接受offer数
|
||||
List<Long> postOfferCounts = new ArrayList<>();
|
||||
//某月份,某岗位的入职数
|
||||
List<Long> postEntryCounts = new ArrayList<>();
|
||||
List<Integer> postEntryCounts = new ArrayList<>();
|
||||
//某月份,岗位名字
|
||||
List<String> postNameList = new ArrayList<>();
|
||||
//某月份,岗位ids
|
||||
|
@ -311,12 +249,12 @@ public class HomePageController extends BaseController {
|
|||
postDetailDTO.setPostInviteCounts(0);
|
||||
}
|
||||
|
||||
//封装到面数
|
||||
if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) {
|
||||
postDetailDTO.setPostArriveCounts(resumeFollowRecordListByPostId.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count());
|
||||
} else {
|
||||
postDetailDTO.setPostArriveCounts(0L);
|
||||
}
|
||||
// //封装到面数
|
||||
// if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) {
|
||||
// postDetailDTO.setPostArriveCounts(resumeFollowRecordListByPostId.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count());
|
||||
// } else {
|
||||
// postDetailDTO.setPostArriveCounts(0L);
|
||||
// }
|
||||
postDetailDTOList.add(postDetailDTO);
|
||||
}
|
||||
);
|
||||
|
@ -329,7 +267,7 @@ public class HomePageController extends BaseController {
|
|||
post -> {
|
||||
postIdsList.add(post.getPostId());
|
||||
postNameList.add(post.getPostName());
|
||||
postArriveCounts.add(post.getPostArriveCounts());
|
||||
//postArriveCounts.add(post.getPostArriveCounts());
|
||||
postInviteCounts.add(post.getPostInviteCounts());
|
||||
postDownLoadCounts.add(post.getPostDownLoadCounts());
|
||||
postSelfCounts.add(post.getPostSelfCounts());
|
||||
|
@ -345,10 +283,36 @@ public class HomePageController extends BaseController {
|
|||
resumeStatVO.setPostSelfCounts(postSelfCounts);
|
||||
resumeStatVO.setPostDownLoadCounts(postDownLoadCounts);
|
||||
resumeStatVO.setPostInviteCounts(postInviteCounts);
|
||||
resumeStatVO.setPostArriveCounts(postArriveCounts);
|
||||
//resumeStatVO.setPostArriveCounts(postArriveCounts);
|
||||
resumeStatVO.setPostNameList(postNameList);
|
||||
resumeStatVO.setPostIdsList(postIdsList);
|
||||
|
||||
//根据postIdsList,封装里面每个岗位的到面数(初试数)、终试数、入职数。
|
||||
if(!CollectionUtils.isEmpty(postIdsList)){
|
||||
postIdsList.forEach(
|
||||
postId->{
|
||||
//寻找该岗位该月份的实际到面人数(初面人数)
|
||||
List<ResumeFollowRecord> filteredFirstReachList = resumeFollowRecordActualArrivedList.stream()
|
||||
.filter(record -> record.getPostId().equals(postId))
|
||||
.collect(Collectors.toList());
|
||||
postArriveCounts.add(filteredFirstReachList.size());
|
||||
//寻找该岗位的终试人数
|
||||
List<ResumeFollowRecord> filteredFinalReachList = resumeFollowRecordFinalArrivedList.stream()
|
||||
.filter(record -> record.getPostId().equals(postId))
|
||||
.collect(Collectors.toList());
|
||||
postFinalCounts.add(filteredFinalReachList.size());
|
||||
//寻找该岗位的入职人数
|
||||
// List<EntryManage> filteredEntryReachList = entryManageList.stream()
|
||||
// .filter(record -> record.getPostId().equals(postId))
|
||||
// .collect(Collectors.toList());
|
||||
// postEntryCounts.add(filteredEntryReachList.size());
|
||||
}
|
||||
);
|
||||
}
|
||||
resumeStatVO.setPostArriveCounts(postArriveCounts);
|
||||
resumeStatVO.setPostFinalCounts(postFinalCounts);
|
||||
//resumeStatVO.setPostEntryCounts(postEntryCounts);
|
||||
|
||||
|
||||
List<ResumeStatVO.FunnelData> funnelDataList = new ArrayList<>();
|
||||
|
||||
|
@ -503,9 +467,9 @@ public class HomePageController extends BaseController {
|
|||
//封装公告内容
|
||||
List<AnnouncementDTO> announcementDTOList = new ArrayList<>();
|
||||
|
||||
// 获取近五天的日期范围
|
||||
// 获取近七天的日期范围
|
||||
LocalDate now = LocalDate.now();
|
||||
LocalDate fiveDaysLater = now.plusDays(5);
|
||||
LocalDate fiveDaysLater = now.plusDays(7);
|
||||
|
||||
// 获取近五天预计入职的人,并按时间分类
|
||||
Map<LocalDate, List<EntryManage>> groupByJoinDate = entryManageService.getListByWeek(now, fiveDaysLater)
|
||||
|
|
|
@ -64,7 +64,13 @@ public class ResumeStatVO {
|
|||
private List<Integer> postInviteCounts;
|
||||
|
||||
@ApiModelProperty(value = "某月份,某岗位到面人数")
|
||||
private List<Long> postArriveCounts;
|
||||
private List<Integer> postArriveCounts;
|
||||
|
||||
@ApiModelProperty(value = "某月份,某岗位终面人数")
|
||||
private List<Integer> postFinalCounts;
|
||||
|
||||
@ApiModelProperty(value = "某月份,某岗位入职人数")
|
||||
private List<Integer> postEntryCounts;
|
||||
|
||||
@ApiModelProperty(value = "某月份,岗位名字")
|
||||
private List<String> postNameList;
|
||||
|
|
Loading…
Reference in New Issue