From 6af7e4207ce9133274cfb6d8bfd35e804dd47fe9 Mon Sep 17 00:00:00 2001 From: lw <532810027@qq.com> Date: Tue, 2 Jul 2024 19:46:26 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E8=B7=9F?= =?UTF-8?q?=E8=B8=AA=E4=B8=AD=EF=BC=8C=E9=83=A8=E9=97=A8=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84bug=202.=E4=BC=98=E5=8C=96=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=92=8C=E9=9D=A2=E8=AF=95=E7=AE=A1=E7=90=86=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 12 +- .../controller/HomePageController.java | 119 +++++++++++------- .../controller/RecruitFollowController.java | 7 ++ .../domain/entity/ResumeHandleRecord.java | 6 + .../cn/zeroerr/domain/vo/ResumeStatVO.java | 8 +- .../mapper/ResumeFollowRecordMapper.xml | 11 ++ .../mapper/ResumeHandleRecordMapper.xml | 3 +- .../system/mapper/RecruitStructureMapper.java | 2 + .../service/RecruitStructureService.java | 2 + .../impl/RecruitStructureServiceImpl.java | 5 + .../mapper/system/RecruitStructureMapper.xml | 95 ++++++++------ 11 files changed, 177 insertions(+), 93 deletions(-) diff --git a/zeroerr_oa-admin/src/main/resources/application.yml b/zeroerr_oa-admin/src/main/resources/application.yml index 3d7e309..f44ce9a 100644 --- a/zeroerr_oa-admin/src/main/resources/application.yml +++ b/zeroerr_oa-admin/src/main/resources/application.yml @@ -7,8 +7,8 @@ ruoyi: # 版权年份 copyrightYear: 2024 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - #profile: D:/zeroerr/uploadPath - profile: /home/zeroerr_oa/uploadPath + profile: D:/zeroerr/uploadPath + #profile: /home/zeroerr_oa/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数字计算 char 字符验证 @@ -69,15 +69,15 @@ spring: # redis 配置 redis: # 地址 - host: 192.168.1.189 - #host: localhost + #host: 192.168.1.189 + host: localhost # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: 123456 - #password: + #password: 123456 + password: # 连接超时时间 timeout: 10s lettuce: diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java index e6c6fae..7c76054 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/controller/HomePageController.java @@ -67,16 +67,22 @@ public class HomePageController extends BaseController { List resumeHandleRecordList = resumeHandleRecordService.getBySelect(req.getHrId(), firstDay, lastDay); //寻找该月份实际到面的人数 - List resumeFollowRecordActualArrivedList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,0); + List resumeFollowRecordActualArrivedList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 0); //寻找该月份终试通过人数 - List resumeFollowRecordFinalPassList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,1); + List resumeFollowRecordFinalPassList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 1); //寻找该月份实际入职人数 - List resumeFollowRecordActualEntryList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,2); + List resumeFollowRecordActualEntryList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 2); //寻找该月份初试通过人数 - List resumeFollowRecordFirstPassList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,3); + List resumeFollowRecordFirstPassList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 3); + + //寻找该月份内部推荐的人数 + List resumeFollowRecordInternalRecommendedList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 7); + + //寻找该月份内部竞聘的人数 + List resumeFollowRecordInternalCompetitionList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 8); ResumeStatVO resumeStatVO = new ResumeStatVO(); //1.合格简历数量 @@ -92,7 +98,15 @@ public class HomePageController extends BaseController { //6.简历来源:下载 resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count()); //7.简历来源:自投 - resumeStatVO.setSelfCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "1".equals(record.getResumeSource())).count()); + if(resumeHandleRecordList!=null){ + resumeStatVO.setSelfCounts(resumeHandleRecordList.stream() + .filter(record -> record.getSelfCounts() != null) + .mapToInt(ResumeHandleRecord::getSelfCounts) + .sum()); + }else { + resumeStatVO.setSelfCounts(0); + } + //8.封装实际到面人数 resumeStatVO.setActualArriveCounts(resumeFollowRecordActualArrivedList.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count()); // 9. 通过比例(终面)=通过人数(终面)/初面实际到面人数 @@ -105,7 +119,7 @@ public class HomePageController extends BaseController { resumeStatVO.setPassPercent(0d); } } - //7.入职比例=入职人数/初面实际到面人数 + //10.入职比例=入职人数/初面实际到面人数 if (resumeStatVO.getActualArriveCounts() != null) { if (resumeStatVO.getActualArriveCounts() != 0L) { BigDecimal entryPercentage = new BigDecimal(resumeStatVO.getEntryCount()).divide(new BigDecimal(resumeStatVO.getActualArriveCounts()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); @@ -114,6 +128,18 @@ public class HomePageController extends BaseController { } else { resumeStatVO.setEntryPercent(0d); } + //11. 处理 内竞数/内推数 + int internalRecommendedSize = 0; + int internalCompetitionSize = 0; + if (resumeFollowRecordInternalRecommendedList != null) { + internalRecommendedSize = resumeFollowRecordInternalRecommendedList.size(); + } + if (resumeFollowRecordInternalCompetitionList != null) { + internalCompetitionSize = resumeFollowRecordInternalCompetitionList.size(); + } + resumeStatVO.setInternalRecommendedSize(internalRecommendedSize); + resumeStatVO.setInternalCompetitionSize(internalCompetitionSize); + // // 使用流进行分组并求和 // Map groupedSum = resumeHandleRecordList.stream() // .collect(Collectors.groupingBy(ResumeHandleRecord::getPostId, @@ -174,7 +200,6 @@ public class HomePageController extends BaseController { // resumeStatVO.setPostNameList(postNameList); - //11.合格简历百分比:100 ;电话面试通过百分比:电话通过人数/简历合格数 ; 初试通过百分比: 初试通过人数/初试到面人数 ; 终试通过百分比:终试通过人数/终试到面人数。 @@ -197,111 +222,111 @@ public class HomePageController extends BaseController { .map(ResumeHandleRecord::getPostId) .collect(Collectors.toList())); - List postDetailDTOList=new ArrayList<>(); + List postDetailDTOList = new ArrayList<>(); // 将Set转换为List List uniquePostIdList = new ArrayList<>(uniquePostIds); //某月份,某岗位查看简历数 - List postLookResumeCounts=new ArrayList<>(); + List postLookResumeCounts = new ArrayList<>(); //某月份,某岗位合格简历数 - List postQualifiedResumeCounts=new ArrayList<>(); + List postQualifiedResumeCounts = new ArrayList<>(); //某月份,某岗位简历自投数 - List postSelfCounts=new ArrayList<>(); + List postSelfCounts = new ArrayList<>(); //某月份,某岗位简历下载数 - List postDownLoadCounts=new ArrayList<>(); + List postDownLoadCounts = new ArrayList<>(); //某月份,某岗位约面人数 - List postInviteCounts=new ArrayList<>(); + List postInviteCounts = new ArrayList<>(); //某月份,某岗位到面人数 - List postArriveCounts=new ArrayList<>(); + List postArriveCounts = new ArrayList<>(); //某月份,岗位名字 - List postNameList=new ArrayList<>(); + List postNameList = new ArrayList<>(); //某月份,岗位ids - List postIdsList=new ArrayList<>(); + List postIdsList = new ArrayList<>(); //筛除已经招聘到的岗位 //List postIdList=recruitStructureService.filterByPostIdList(uniquePostIdList); - if(!CollectionUtils.isEmpty(uniquePostIdList)){ + if (!CollectionUtils.isEmpty(uniquePostIdList)) { uniquePostIdList.forEach( - uniquePostId->{ + uniquePostId -> { List resumeFollowRecordListByPostId = groupedResumeFollowRecords.get(uniquePostId); List resumeHandleRecordListByPostId = groupedResumeHandleRecords.get(uniquePostId); PostDetailDTO postDetailDTO = new PostDetailDTO(); postDetailDTO.setPostId(uniquePostId); - if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ + if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) { postDetailDTO.setPostName(resumeFollowRecordListByPostId.get(0).getPostName()); - }else if(!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)) { + } else if (!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)) { postDetailDTO.setPostName(resumeHandleRecordListByPostId.get(0).getPostName()); - }else { + } else { postDetailDTO.setPostName(""); } //封装该岗位浏览简历数 - if(!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)){ - postDetailDTO.setPostLookResumeCounts( resumeHandleRecordListByPostId.stream() + if (!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)) { + postDetailDTO.setPostLookResumeCounts(resumeHandleRecordListByPostId.stream() .mapToInt(ResumeHandleRecord::getSeenNum) .sum()); - }else { + } else { postDetailDTO.setPostLookResumeCounts(0); } //封装该岗位合格简历数 - if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ + if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) { // postDetailDTO.setPostQualifiedResumeCounts( resumeHandleRecordListByPostId.stream() // .mapToInt(ResumeHandleRecord::getQualifiedNum) // .sum()); postDetailDTO.setPostQualifiedResumeCounts(resumeFollowRecordListByPostId.size()); - }else { + } else { postDetailDTO.setPostQualifiedResumeCounts(0); } //封装该岗位的自投数 - if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ + if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) { postDetailDTO.setPostSelfCounts(resumeFollowRecordListByPostId.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "1".equals(record.getResumeSource())).count()); - }else { + } else { postDetailDTO.setPostSelfCounts(0L); } //封装该岗位的下载数 - if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ + if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) { postDetailDTO.setPostDownLoadCounts(resumeFollowRecordListByPostId.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count()); - }else { + } else { postDetailDTO.setPostDownLoadCounts(0L); } //封装约面数 - if(!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)){ - postDetailDTO.setPostInviteCounts( resumeHandleRecordListByPostId.stream() + if (!CollectionUtils.isEmpty(resumeHandleRecordListByPostId)) { + postDetailDTO.setPostInviteCounts(resumeHandleRecordListByPostId.stream() .mapToInt(ResumeHandleRecord::getReceiveInviteNum) .sum()); - }else { + } else { postDetailDTO.setPostInviteCounts(0); } //封装到面数 - if(!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)){ + if (!CollectionUtils.isEmpty(resumeFollowRecordListByPostId)) { postDetailDTO.setPostArriveCounts(resumeFollowRecordListByPostId.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count()); - }else { + } else { postDetailDTO.setPostArriveCounts(0L); } postDetailDTOList.add(postDetailDTO); } ); - if(!CollectionUtils.isEmpty(postDetailDTOList)){ + if (!CollectionUtils.isEmpty(postDetailDTOList)) { //根据《岗位查看》简历数进行排序 List sortedList = postDetailDTOList.stream() .sorted(Comparator.comparingInt(PostDetailDTO::getPostLookResumeCounts).reversed()) // 从大到小排序 .collect(Collectors.toList()); sortedList.forEach( - post -> { - postIdsList.add(post.getPostId()); - postNameList.add(post.getPostName()); - postArriveCounts.add(post.getPostArriveCounts()); - postInviteCounts.add(post.getPostInviteCounts()); - postDownLoadCounts.add(post.getPostDownLoadCounts()); - postSelfCounts.add(post.getPostSelfCounts()); - postQualifiedResumeCounts.add(post.getPostQualifiedResumeCounts()); - postLookResumeCounts.add(post.getPostLookResumeCounts()); - } - ); + post -> { + postIdsList.add(post.getPostId()); + postNameList.add(post.getPostName()); + postArriveCounts.add(post.getPostArriveCounts()); + postInviteCounts.add(post.getPostInviteCounts()); + postDownLoadCounts.add(post.getPostDownLoadCounts()); + postSelfCounts.add(post.getPostSelfCounts()); + postQualifiedResumeCounts.add(post.getPostQualifiedResumeCounts()); + postLookResumeCounts.add(post.getPostLookResumeCounts()); + } + ); } } 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 99ec03a..94f566e 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 @@ -189,6 +189,7 @@ public class RecruitFollowController extends BaseController { if (followVO.getPostId() == null) followVO.setPostId(0L); if (followVO.getPostName() == null) followVO.setPostName(""); if (followVO.getDeptId() == null) followVO.setDeptId(0L); + if (followVO.getDeptName() == null) followVO.setDeptName(handleDeptName(followVO.getPostId())); if (followVO.getHrId() == null) followVO.setHrId(0L); if (followVO.getHrName() == null) followVO.setHrName(""); if (followVO.getPostCount() == null) followVO.setPostCount(0); @@ -224,6 +225,10 @@ public class RecruitFollowController extends BaseController { return AjaxResult.success(followVOList); } + private String handleDeptName(Long postId) { + return recruitStructureService.findTopLevelDepartmentNameByNodeId(postId); + } + private void handleFollowRecords(FollowDTO req, List followVOList) { String hrName = req.getHrName(); LocalDate startDate = req.getStartDate(); @@ -293,4 +298,6 @@ public class RecruitFollowController extends BaseController { } + + } diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/ResumeHandleRecord.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/ResumeHandleRecord.java index e78bfae..8d7b2a1 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/ResumeHandleRecord.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/entity/ResumeHandleRecord.java @@ -103,6 +103,12 @@ public class ResumeHandleRecord implements Serializable { @TableField(value = "dept_name") private String deptName; + /** + * 自投数量 + */ + @TableField(value = "self_counts") + private Integer selfCounts; + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/ResumeStatVO.java b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/ResumeStatVO.java index b267da3..4e57284 100644 --- a/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/ResumeStatVO.java +++ b/zeroerr_oa-recruit/src/main/java/cn/zeroerr/domain/vo/ResumeStatVO.java @@ -27,6 +27,12 @@ public class ResumeStatVO { @ApiModelProperty(value = "入职人数") private Long entryCount; + @ApiModelProperty(value = "内推数") + private Integer internalRecommendedSize; + + @ApiModelProperty(value = "内竞数") + private Integer internalCompetitionSize; + @ApiModelProperty(value = "通过比例(终面)") private Double passPercent; @@ -79,7 +85,7 @@ public class ResumeStatVO { private Integer findResumeCounts; @ApiModelProperty(value = "自投数量") - private Long selfCounts; + private Integer selfCounts; @ApiModelProperty(value = "下载数量") private Long downLoadCounts; diff --git a/zeroerr_oa-recruit/src/main/resources/mapper/ResumeFollowRecordMapper.xml b/zeroerr_oa-recruit/src/main/resources/mapper/ResumeFollowRecordMapper.xml index 3a0030e..4be2f46 100644 --- a/zeroerr_oa-recruit/src/main/resources/mapper/ResumeFollowRecordMapper.xml +++ b/zeroerr_oa-recruit/src/main/resources/mapper/ResumeFollowRecordMapper.xml @@ -174,6 +174,17 @@ and final_date =]]> #{firstDay} and final_date #{lastDay} + + and recruitment_channel = 4 + and receive_date =]]> #{firstDay} + and receive_date #{lastDay} + + + and recruitment_channel = 8 + and receive_date =]]> #{firstDay} + and receive_date #{lastDay} + + and hr_name like concat('%', #{hrName}, '%') diff --git a/zeroerr_oa-recruit/src/main/resources/mapper/ResumeHandleRecordMapper.xml b/zeroerr_oa-recruit/src/main/resources/mapper/ResumeHandleRecordMapper.xml index 5f21510..75fc871 100644 --- a/zeroerr_oa-recruit/src/main/resources/mapper/ResumeHandleRecordMapper.xml +++ b/zeroerr_oa-recruit/src/main/resources/mapper/ResumeHandleRecordMapper.xml @@ -14,6 +14,7 @@ + @@ -25,7 +26,7 @@ id,post_id,post_name, handle_date,recruitment_channel,seen_num, greet_num,submit_num,qualified_num, - receive_invite_num,operator_id,operator_name,dept_id,dept_name + receive_invite_num,operator_id,operator_name,dept_id,dept_name,self_counts select * from recruit_structure - where node_id=#{nodeId} + where node_id = #{nodeId} - where d.del_flag = '0' and type=0 @@ -249,16 +251,18 @@ - WITH RECURSIVE cte AS ( - SELECT - node_id, - parent_id, - type, - node_name - FROM - recruit_structure - WHERE - node_id = #{nodeId} + SELECT node_id, + parent_id, + type, + node_name + FROM recruit_structure + WHERE node_id = #{nodeId} UNION ALL - SELECT - rs.node_id, - rs.parent_id, - rs.type, - rs.node_name - FROM - recruit_structure rs - INNER JOIN - cte ON rs.node_id = cte.parent_id + SELECT rs.node_id, + rs.parent_id, + rs.type, + rs.node_name + FROM recruit_structure rs + INNER JOIN + cte ON rs.node_id = cte.parent_id ) - SELECT - node_id, - parent_id, - type, - node_name - FROM - cte - WHERE - type = 0 - ORDER BY - parent_id ASC - LIMIT 1 + SELECT node_id, + parent_id, + type, + node_name + FROM cte + WHERE type = 0 + ORDER BY parent_id ASC LIMIT 1 @@ -320,4 +315,28 @@ + + +