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 95d412c..003d595 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 @@ -7,15 +7,13 @@ import cn.zeroerr.common.core.domain.entity.RecruitStructure; 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.vo.PostListVO; import cn.zeroerr.domain.vo.ResumeStatVO; -import cn.zeroerr.service.PostPlanFollowService; -import cn.zeroerr.service.RecruitProcessTaskService; -import cn.zeroerr.service.ResumeFollowRecordService; -import cn.zeroerr.service.ResumeHandleRecordService; +import cn.zeroerr.service.*; import cn.zeroerr.system.service.RecruitStructureService; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import io.swagger.annotations.Api; @@ -49,6 +47,8 @@ public class HomePageController extends BaseController { private ResumeHandleRecordService resumeHandleRecordService; @Autowired private RecruitStructureService recruitStructureService; + @Autowired + private EntryManageService entryManageService; @Anonymous @GetMapping("/getResumeStat") @@ -73,8 +73,9 @@ public class HomePageController extends BaseController { //寻找该月份终试通过人数 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 entryManageList=entryManageService.getList(firstDay, lastDay); //寻找该月份初试通过人数 List resumeFollowRecordFirstPassList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 3); @@ -89,7 +90,7 @@ public class HomePageController extends BaseController { //4.未通过人数(终面) resumeStatVO.setFinalFailCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "0".equals(record.getFinalPass())).count()); //5.入职人数("实际"入职日期不为空的数据统计) - resumeStatVO.setEntryCount(resumeFollowRecordActualEntryList.stream().filter(record -> Objects.nonNull(record.getActualJoinDate())).count()); + resumeStatVO.setEntryCount(entryManageList.size()); //6.简历来源:下载 resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count()); //7.简历处理-自投 @@ -334,33 +335,34 @@ public class HomePageController extends BaseController { List funnelDataList = new ArrayList<>(); + + //找到所有时间一共有多少份录入的简历 + List allResumeFollowRecordList = resumeFollowRecordService.list(); + //找到所有时间一共有多少人实际入职 + List allEntryManageList=entryManageService.getList(null, null); + //封装合格简历 - funnelDataList.add(new ResumeStatVO.FunnelData().setName("合格简历率:" + 100 + "%").setValue(Long.valueOf(resumeFollowRecordList.size()))); + funnelDataList.add(new ResumeStatVO.FunnelData().setName("合格简历:" + allResumeFollowRecordList.size() + "人").setValue((long) allResumeFollowRecordList.size())); //封装电话面试通过百分比 //通过电话面试的人数 //通过 - long phonePassCount1 = resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "1".equals(record.getIsPass())).count(); + long phonePassCount1 = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "1".equals(record.getIsPass())).count(); //直接邀约 - long phonePassCount2 = resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "4".equals(record.getIsPass())).count(); + long phonePassCount2 = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "4".equals(record.getIsPass())).count(); long phonePassCount = phonePassCount1 + phonePassCount2; - BigDecimal phonePassPercentage = new BigDecimal(0d); - if (phonePassCount != 0) { - phonePassPercentage = new BigDecimal(phonePassCount).divide(new BigDecimal(resumeFollowRecordList.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); - } - funnelDataList.add(new ResumeStatVO.FunnelData().setName("电面通过率:" + phonePassPercentage.doubleValue() + "%").setValue(phonePassCount)); + funnelDataList.add(new ResumeStatVO.FunnelData().setName("电面通过:" + phonePassCount + "人").setValue(phonePassCount)); //封装初试通过百分比 - long firstReachCount = resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count(); - BigDecimal firstPassPercentage = new BigDecimal(0d); - if (firstReachCount != 0) { - firstPassPercentage = new BigDecimal(resumeStatVO.getFistCount()).divide(new BigDecimal(firstReachCount), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); + long firstReachCount = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFirstPass()) && "1".equals(record.getFirstPass())).count(); - } - funnelDataList.add(new ResumeStatVO.FunnelData().setName("初试通过率:" + firstPassPercentage.doubleValue() + "%").setValue(resumeStatVO.getFistCount())); - //封装终试通过百分比 - funnelDataList.add(new ResumeStatVO.FunnelData().setName("终试通过:" + resumeStatVO.getPassPercent() + "%").setValue(resumeStatVO.getFinalPassCount())); - //封装入职百分比 - funnelDataList.add(new ResumeStatVO.FunnelData().setName("入职通过:" + resumeStatVO.getEntryPercent() + "%").setValue(resumeStatVO.getEntryCount())); + funnelDataList.add(new ResumeStatVO.FunnelData().setName("初试通过:" + firstReachCount + "人").setValue(firstReachCount)); + + long finalPassCount = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "1".equals(record.getFinalPass())).count(); + //封装终试通过人数 + funnelDataList.add(new ResumeStatVO.FunnelData().setName("终试通过:" + finalPassCount + "人").setValue(finalPassCount)); + + //封装入职人数 + funnelDataList.add(new ResumeStatVO.FunnelData().setName("入职通过:" + allEntryManageList.size() + "人").setValue((long)allEntryManageList.size())); resumeStatVO.setFunnelData(funnelDataList); //查询待我审批的条数 @@ -440,8 +442,6 @@ public class HomePageController extends BaseController { }else { resumeStatVO.setInvitePercent(0d); } - - return success(resumeStatVO); } 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 f34ea8e..47053ad 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 @@ -25,7 +25,7 @@ public class ResumeStatVO { private Long finalFailCount; @ApiModelProperty(value = "入职人数") - private Long entryCount; + private Integer entryCount; // // @ApiModelProperty(value = "内推数") // private Integer internalRecommendedSize; 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 dabba3f..3134879 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 @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.time.LocalDate; import java.util.List; /** @@ -18,6 +19,8 @@ import java.util.List; public interface EntryManageMapper extends BaseMapper { List listBySelect(@Param("req") EntryManagerDTO req); + + List getList(@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay); } 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 c5e8a44..ed8b7a6 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 @@ -4,6 +4,7 @@ import cn.zeroerr.domain.dto.EntryManagerDTO; import cn.zeroerr.domain.entity.EntryManage; import com.baomidou.mybatisplus.extension.service.IService; +import java.time.LocalDate; import java.util.List; /** @@ -15,4 +16,6 @@ public interface EntryManageService extends IService { List listBySelect(EntryManagerDTO req); + + List getList(LocalDate firstDay, LocalDate lastDay); } 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 bb410d4..a422cb3 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 @@ -7,6 +7,7 @@ import cn.zeroerr.service.EntryManageService; import cn.zeroerr.mapper.EntryManageMapper; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.util.List; /** @@ -22,6 +23,11 @@ public class EntryManageServiceImpl extends ServiceImpl listBySelect(EntryManagerDTO req) { return this.baseMapper.listBySelect(req); } + + @Override + public List getList(LocalDate firstDay, LocalDate lastDay) { + return baseMapper.getList(firstDay,lastDay); + } } diff --git a/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml index a4ef935..8030234 100644 --- a/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml +++ b/zeroerr_oa-recruit/src/main/resources/mapper/EntryManageMapper.xml @@ -46,4 +46,12 @@ and is_entry = #{req.isEntry} order by join_date desc + +