修改入职人数的统计方式

This commit is contained in:
lw 2024-07-04 14:08:13 +08:00
parent 2519af477d
commit 67fb03e958
6 changed files with 48 additions and 28 deletions

View File

@ -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<ResumeFollowRecord> resumeFollowRecordFinalPassList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 1);
//寻找该月份实际入职人数
List<ResumeFollowRecord> resumeFollowRecordActualEntryList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 2);
//寻找该月份实际入职人数(以入职管理里的为准)
//List<ResumeFollowRecord> resumeFollowRecordActualEntryList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 2);
List<EntryManage> entryManageList=entryManageService.getList(firstDay, lastDay);
//寻找该月份初试通过人数
List<ResumeFollowRecord> 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<ResumeStatVO.FunnelData> funnelDataList = new ArrayList<>();
//找到所有时间一共有多少份录入的简历
List<ResumeFollowRecord> allResumeFollowRecordList = resumeFollowRecordService.list();
//找到所有时间一共有多少人实际入职
List<EntryManage> 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);
}

View File

@ -25,7 +25,7 @@ public class ResumeStatVO {
private Long finalFailCount;
@ApiModelProperty(value = "入职人数")
private Long entryCount;
private Integer entryCount;
//
// @ApiModelProperty(value = "内推数")
// private Integer internalRecommendedSize;

View File

@ -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<EntryManage> {
List<EntryManage> listBySelect(@Param("req") EntryManagerDTO req);
List<EntryManage> getList(@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay);
}

View File

@ -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<EntryManage> {
List<EntryManage> listBySelect(EntryManagerDTO req);
List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay);
}

View File

@ -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<EntryManageMapper, Entry
public List<EntryManage> listBySelect(EntryManagerDTO req) {
return this.baseMapper.listBySelect(req);
}
@Override
public List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay) {
return baseMapper.getList(firstDay,lastDay);
}
}

View File

@ -46,4 +46,12 @@
<if test="req.isEntry!=null">and is_entry = #{req.isEntry}</if>
order by join_date desc
</select>
<select id="getList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from entry_manage
where actual_join_date is not null
<if test="firstDay!=null"> and actual_join_date <![CDATA[>=]]> #{firstDay}</if>
<if test="lastDay!=null"> and actual_join_date <![CDATA[<=]]> #{lastDay}</if>
</select>
</mapper>