1.修改主页面板、任务跟踪有关时间的统计方式。
This commit is contained in:
parent
1af6d8c368
commit
ac3c8c1617
|
@ -5,14 +5,14 @@ spring:
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
# master:
|
|
||||||
# url: jdbc:mysql://192.168.1.165:3306/zeoa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
|
||||||
# username: zeoa
|
|
||||||
# password: dHahLWNYB7tD2Mia
|
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.1.165:3306/zeoa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: zeoa
|
||||||
password: zero
|
password: dHahLWNYB7tD2Mia
|
||||||
|
# master:
|
||||||
|
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
# username: root
|
||||||
|
# password: zero
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|
|
@ -7,8 +7,8 @@ ruoyi:
|
||||||
# 版权年份
|
# 版权年份
|
||||||
copyrightYear: 2024
|
copyrightYear: 2024
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: D:/zeroerr/uploadPath
|
#profile: D:/zeroerr/uploadPath
|
||||||
#profile: /home/zeroerr_oa/uploadPath
|
profile: /home/zeroerr_oa/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
# 验证码类型 math 数字计算 char 字符验证
|
||||||
|
@ -69,15 +69,15 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
#host: 192.168.1.189
|
host: 192.168.1.189
|
||||||
host: localhost
|
#host: localhost
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 0
|
||||||
# 密码
|
# 密码
|
||||||
#password: 123456
|
password: 123456
|
||||||
password:
|
#password:
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
|
|
|
@ -65,35 +65,50 @@ public class HomePageController extends BaseController {
|
||||||
List<ResumeFollowRecord> resumeFollowRecordList = resumeFollowRecordService.getBySelect(req.getHrId(), firstDay, lastDay);
|
List<ResumeFollowRecord> resumeFollowRecordList = resumeFollowRecordService.getBySelect(req.getHrId(), firstDay, lastDay);
|
||||||
//寻找《看过简历数》
|
//寻找《看过简历数》
|
||||||
List<ResumeHandleRecord> resumeHandleRecordList = resumeHandleRecordService.getBySelect(req.getHrId(), firstDay, lastDay);
|
List<ResumeHandleRecord> resumeHandleRecordList = resumeHandleRecordService.getBySelect(req.getHrId(), firstDay, lastDay);
|
||||||
|
|
||||||
|
//寻找该月份实际到面的人数
|
||||||
|
List<ResumeFollowRecord> resumeFollowRecordActualArrivedList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,0);
|
||||||
|
|
||||||
|
//寻找该月份终试通过人数
|
||||||
|
List<ResumeFollowRecord> resumeFollowRecordFinalPassList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,1);
|
||||||
|
|
||||||
|
//寻找该月份实际入职人数
|
||||||
|
List<ResumeFollowRecord> resumeFollowRecordActualEntryList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,2);
|
||||||
|
|
||||||
|
//寻找该月份初试通过人数
|
||||||
|
List<ResumeFollowRecord> resumeFollowRecordFirstPassList =resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay,3);
|
||||||
|
|
||||||
ResumeStatVO resumeStatVO = new ResumeStatVO();
|
ResumeStatVO resumeStatVO = new ResumeStatVO();
|
||||||
//1.合格简历数量
|
//1.合格简历数量
|
||||||
resumeStatVO.setQualifiedCount(resumeFollowRecordList.size());
|
resumeStatVO.setQualifiedCount(resumeFollowRecordList.size());
|
||||||
//2 .初试通过人数
|
//2 .初试通过人数
|
||||||
resumeStatVO.setFistCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFirstPass()) && "1".equals(record.getFirstPass())).count());
|
resumeStatVO.setFistCount(resumeFollowRecordFirstPassList.stream().filter(record -> Objects.nonNull(record.getFirstPass()) && "1".equals(record.getFirstPass())).count());
|
||||||
//3.通过人数(终面)
|
//3.通过人数(终面)
|
||||||
resumeStatVO.setFinalPassCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "1".equals(record.getFinalPass())).count());
|
resumeStatVO.setFinalPassCount(resumeFollowRecordFinalPassList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "1".equals(record.getFinalPass())).count());
|
||||||
//4.未通过人数(终面)
|
//4.未通过人数(终面)
|
||||||
resumeStatVO.setFinalFailCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "0".equals(record.getFinalPass())).count());
|
resumeStatVO.setFinalFailCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "0".equals(record.getFinalPass())).count());
|
||||||
//5.入职人数("实际"入职日期不为空的数据统计)
|
//5.入职人数("实际"入职日期不为空的数据统计)
|
||||||
resumeStatVO.setEntryCount(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getActualJoinDate())).count());
|
resumeStatVO.setEntryCount(resumeFollowRecordActualEntryList.stream().filter(record -> Objects.nonNull(record.getActualJoinDate())).count());
|
||||||
//6.简历来源:下载
|
//6.简历来源:下载
|
||||||
resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count());
|
resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count());
|
||||||
//7.简历来源:自投
|
//7.简历来源:自投
|
||||||
resumeStatVO.setSelfCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "1".equals(record.getResumeSource())).count());
|
resumeStatVO.setSelfCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "1".equals(record.getResumeSource())).count());
|
||||||
//8.封装实际到面人数
|
//8.封装实际到面人数
|
||||||
resumeStatVO.setActualArriveCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count());
|
resumeStatVO.setActualArriveCounts(resumeFollowRecordActualArrivedList.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count());
|
||||||
// 9. 通过比例(终面)=通过人数(终面)/(通过人数(终面)+未通过人数(终面))
|
// 9. 通过比例(终面)=通过人数(终面)/初面实际到面人数
|
||||||
long totalCount = resumeStatVO.getFinalPassCount() + resumeStatVO.getFinalFailCount();
|
//long totalCount = resumeStatVO.getFinalPassCount() + resumeStatVO.getFinalFailCount();
|
||||||
if (totalCount != 0L) {
|
if (resumeStatVO.getActualArriveCounts() != null) {
|
||||||
BigDecimal passPercentage = new BigDecimal(resumeStatVO.getFinalPassCount()).divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
if (resumeStatVO.getActualArriveCounts() != 0L) {
|
||||||
|
BigDecimal passPercentage = new BigDecimal(resumeStatVO.getFinalPassCount()).divide(new BigDecimal(resumeStatVO.getActualArriveCounts()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
||||||
resumeStatVO.setPassPercent(passPercentage.doubleValue());
|
resumeStatVO.setPassPercent(passPercentage.doubleValue());
|
||||||
} else {
|
} else {
|
||||||
resumeStatVO.setPassPercent(0d);
|
resumeStatVO.setPassPercent(0d);
|
||||||
}
|
}
|
||||||
//7.入职比例=入职人数/通过人数(终面)
|
}
|
||||||
if (resumeStatVO.getFinalPassCount() != null) {
|
//7.入职比例=入职人数/初面实际到面人数
|
||||||
if (resumeStatVO.getFinalPassCount() != 0L) {
|
if (resumeStatVO.getActualArriveCounts() != null) {
|
||||||
BigDecimal entryPercentage = new BigDecimal(resumeStatVO.getEntryCount()).divide(new BigDecimal(resumeStatVO.getFinalPassCount()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
if (resumeStatVO.getActualArriveCounts() != 0L) {
|
||||||
|
BigDecimal entryPercentage = new BigDecimal(resumeStatVO.getEntryCount()).divide(new BigDecimal(resumeStatVO.getActualArriveCounts()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
||||||
resumeStatVO.setEntryPercent(entryPercentage.doubleValue());
|
resumeStatVO.setEntryPercent(entryPercentage.doubleValue());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,10 +29,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -61,7 +58,7 @@ public class RecruitFollowController extends BaseController {
|
||||||
private ResumeFollowRecordService resumeFollowRecordService;
|
private ResumeFollowRecordService resumeFollowRecordService;
|
||||||
|
|
||||||
|
|
||||||
// @PreAuthorize("@ss.hasPermi('recruit:follow:add')")
|
// @PreAuthorize("@ss.hasPermi('recruit:follow:add')")
|
||||||
// @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT)
|
// @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT)
|
||||||
// @PostMapping("/follow/add")
|
// @PostMapping("/follow/add")
|
||||||
// @ApiOperation(value = "新增招聘计划与统计")
|
// @ApiOperation(value = "新增招聘计划与统计")
|
||||||
|
@ -153,94 +150,58 @@ public class RecruitFollowController extends BaseController {
|
||||||
@GetMapping("/follow/list")
|
@GetMapping("/follow/list")
|
||||||
@ApiOperation(value = "查询招聘计划与统计列表")
|
@ApiOperation(value = "查询招聘计划与统计列表")
|
||||||
public AjaxResult list(FollowDTO req) {
|
public AjaxResult list(FollowDTO req) {
|
||||||
List<FollowVO> followVOList=new ArrayList<>();
|
List<FollowVO> followVOList = new ArrayList<>();
|
||||||
//根据搜索条件,从简历处理表中查询所有符合条件的数据
|
|
||||||
List<ResumeHandleRecord> resumeHandleRecordList=resumeHandleRecordService.listBySelect(req);
|
// 获取符合条件的简历处理记录并按岗位ID分组
|
||||||
Map<Long, List<ResumeHandleRecord>> mapResumeHandleRecord = resumeHandleRecordList.stream().collect(Collectors.groupingBy(ResumeHandleRecord::getPostId));
|
Map<Long, List<ResumeHandleRecord>> mapResumeHandleRecord = resumeHandleRecordService.listBySelect(req)
|
||||||
if(!CollectionUtils.isEmpty(mapResumeHandleRecord)){
|
.stream().collect(Collectors.groupingBy(ResumeHandleRecord::getPostId));
|
||||||
for (Map.Entry<Long, List<ResumeHandleRecord>> entry : mapResumeHandleRecord.entrySet()) {
|
|
||||||
List<ResumeHandleRecord> listByPostId = entry.getValue();
|
if (!mapResumeHandleRecord.isEmpty()) {
|
||||||
if(!CollectionUtils.isEmpty(listByPostId)){
|
mapResumeHandleRecord.forEach((postId, listByPostId) -> {
|
||||||
FollowVO followVO = new FollowVO();
|
if (!listByPostId.isEmpty()) {
|
||||||
ResumeHandleRecord resumeHandleRecord = listByPostId.get(0);
|
ResumeHandleRecord firstRecord = listByPostId.get(0);
|
||||||
followVO.setPostId(resumeHandleRecord.getPostId());
|
FollowVO followVO = new FollowVO();
|
||||||
followVO.setPostName(resumeHandleRecord.getPostName());
|
followVO.setPostId(firstRecord.getPostId());
|
||||||
followVO.setDeptId(resumeHandleRecord.getDeptId());
|
followVO.setPostName(firstRecord.getPostName());
|
||||||
followVO.setDeptName(resumeHandleRecord.getDeptName());
|
followVO.setDeptId(firstRecord.getDeptId());
|
||||||
followVO.setHrId(resumeHandleRecord.getOperatorId());
|
followVO.setDeptName(firstRecord.getDeptName());
|
||||||
followVO.setHrName(resumeHandleRecord.getOperatorName());
|
followVO.setHrId(firstRecord.getOperatorId());
|
||||||
//封装该岗位需求人数
|
followVO.setHrName(firstRecord.getOperatorName());
|
||||||
RecruitStructure postNodeId = recruitStructureService.getByNodeId(followVO.getPostId());
|
|
||||||
if(!ObjectUtils.isEmpty(postNodeId)){
|
RecruitStructure postNodeId = recruitStructureService.getByNodeId(followVO.getPostId());
|
||||||
if(postNodeId.getTaskId()!=null){
|
followVO.setPostCount(postNodeId != null && postNodeId.getTaskId() != null
|
||||||
RecruitProcessTask recruitProcessTask = recruitProcessTaskService.getByTaskId(postNodeId.getTaskId());
|
? recruitProcessTaskService.getByTaskId(postNodeId.getTaskId()).getPostCount()
|
||||||
followVO.setPostCount(recruitProcessTask.getPostCount());
|
: 0);
|
||||||
}else {
|
|
||||||
followVO.setPostCount(0);
|
followVO.setLookResumeCount(listByPostId.stream().mapToInt(ResumeHandleRecord::getGreetNum).sum());
|
||||||
}
|
followVO.setInviteInterviewCount(listByPostId.stream().mapToInt(ResumeHandleRecord::getReceiveInviteNum).sum());
|
||||||
}
|
|
||||||
|
|
||||||
//封装查看的简历数
|
|
||||||
followVO.setLookResumeCount(listByPostId.stream()
|
|
||||||
.mapToInt(ResumeHandleRecord::getGreetNum)
|
|
||||||
.sum());
|
|
||||||
// //封装人力资源通过简历数
|
|
||||||
// followVO.setPassResumeCount(listByPostId.stream()
|
|
||||||
// .mapToInt(ResumeHandleRecord::getQualifiedNum)
|
|
||||||
// .sum());
|
|
||||||
//封装约面人数
|
|
||||||
followVO.setInviteInterviewCount(listByPostId.stream()
|
|
||||||
.mapToInt(ResumeHandleRecord::getReceiveInviteNum)
|
|
||||||
.sum());
|
|
||||||
//封装接受邀约人数
|
|
||||||
// followVO.setAcceptInviteCount(listByPostId.stream()
|
|
||||||
// .mapToInt(ResumeHandleRecord::getReceiveInviteNum)
|
|
||||||
// .sum());
|
|
||||||
followVOList.add(followVO);
|
followVOList.add(followVO);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据搜索条件,从面试跟踪里查询所有符合条件的数据
|
// 获取符合条件的面试跟踪记录并按岗位ID分组
|
||||||
List<ResumeFollowRecord> resumeFollowRecordList=resumeFollowRecordService.listBySelect(req);
|
handleFollowRecords(req, followVOList);
|
||||||
Map<Long, List<ResumeFollowRecord>> mapResumeFollowRecord = resumeFollowRecordList.stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId));
|
|
||||||
if(!CollectionUtils.isEmpty(mapResumeFollowRecord)){
|
// 遍历followVOList,将所有字段(除了deptName)为null的字段设置为0
|
||||||
for (Map.Entry<Long, List<ResumeFollowRecord>> entry : mapResumeFollowRecord.entrySet()) {
|
followVOList.forEach(followVO -> {
|
||||||
//先去followVOList去找有没有对应的岗位
|
if (followVO.getPostId() == null) followVO.setPostId(0L);
|
||||||
Optional<FollowVO> result = followVOList.stream()
|
if (followVO.getPostName() == null) followVO.setPostName("");
|
||||||
.filter(followVO -> followVO.getPostId().equals(entry.getKey()))
|
if (followVO.getDeptId() == null) followVO.setDeptId(0L);
|
||||||
.findFirst();
|
if (followVO.getHrId() == null) followVO.setHrId(0L);
|
||||||
List<ResumeFollowRecord> resumeFollowRecords = entry.getValue();
|
if (followVO.getHrName() == null) followVO.setHrName("");
|
||||||
//如果存在,则插入数据
|
if (followVO.getPostCount() == null) followVO.setPostCount(0);
|
||||||
if(result.isPresent()){
|
if (followVO.getLookResumeCount() == null) followVO.setLookResumeCount(0);
|
||||||
FollowVO followVO = result.get();
|
if (followVO.getInviteInterviewCount() == null) followVO.setInviteInterviewCount(0);
|
||||||
//封装合格简历数
|
if (followVO.getPassResumeCount() == null) followVO.setPassResumeCount(0);
|
||||||
followVO.setPassResumeCount(resumeFollowRecords.size());
|
if (followVO.getFirstInterviewCount() == null) followVO.setFirstInterviewCount(0L);
|
||||||
|
if (followVO.getSecondInterviewCount() == null) followVO.setSecondInterviewCount(0L);
|
||||||
|
if (followVO.getThirdInterviewCount() == null) followVO.setThirdInterviewCount(0L);
|
||||||
|
if (followVO.getSalaryCount() == null) followVO.setSalaryCount(0L);
|
||||||
|
if (followVO.getOfferCount() == null) followVO.setOfferCount(0L);
|
||||||
|
if (followVO.getEntryCount() == null) followVO.setEntryCount(0L);
|
||||||
|
|
||||||
//设置初试人数
|
|
||||||
followVO.setFirstInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter( record -> record.getFirstReach() != null && "1".equals(record.getFirstReach()))
|
|
||||||
.count());
|
|
||||||
//设置复试人数
|
|
||||||
followVO.setSecondInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getSecondReach() != null && "1".equals(record.getSecondReach()))
|
|
||||||
.count());
|
|
||||||
//设置终试人数
|
|
||||||
followVO.setThirdInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getFinalReach() != null && "1".equals(record.getFinalReach()))
|
|
||||||
.count());
|
|
||||||
//设置谈薪人数
|
|
||||||
followVO.setSalaryCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getFinalPass() != null && "1".equals(record.getFinalPass()))
|
|
||||||
.count());
|
|
||||||
//设置拿offer人数
|
|
||||||
followVO.setOfferCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getAcceptOffer() != null && "1".equals(record.getAcceptOffer()))
|
|
||||||
.count());
|
|
||||||
//设置入职人数(实际入职日期不为空的条数)
|
|
||||||
followVO.setEntryCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getActualJoinDate() != null)
|
|
||||||
.count());
|
|
||||||
//封装到面率(一面人数/接受邀约人数)
|
//封装到面率(一面人数/接受邀约人数)
|
||||||
if(followVO.getInviteInterviewCount()!=null&&followVO.getInviteInterviewCount()!=0){
|
if(followVO.getInviteInterviewCount()!=null&&followVO.getInviteInterviewCount()!=0){
|
||||||
BigDecimal arrivePercentage = new BigDecimal(followVO.getFirstInterviewCount()).divide(new BigDecimal(followVO.getInviteInterviewCount()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
BigDecimal arrivePercentage = new BigDecimal(followVO.getFirstInterviewCount()).divide(new BigDecimal(followVO.getInviteInterviewCount()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
||||||
|
@ -256,63 +217,80 @@ public class RecruitFollowController extends BaseController {
|
||||||
followVO.setAchievementRate(0d);
|
followVO.setAchievementRate(0d);
|
||||||
}
|
}
|
||||||
|
|
||||||
//将更新完的数据放回去
|
});
|
||||||
int index = followVOList.indexOf(followVO);
|
|
||||||
if (index >= 0) {
|
|
||||||
followVOList.set(index, followVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//如果不存在则新增数据
|
|
||||||
else {
|
|
||||||
FollowVO followVO = new FollowVO();
|
|
||||||
ResumeFollowRecord resumeFollowRecord = resumeFollowRecords.get(0);
|
|
||||||
followVO.setPostId(resumeFollowRecord.getPostId());
|
|
||||||
followVO.setPostName(resumeFollowRecord.getPostName());
|
|
||||||
followVO.setPassResumeCount(resumeFollowRecords.size());
|
|
||||||
RecruitStructure postNodeId = recruitStructureService.getByNodeId(followVO.getPostId());
|
|
||||||
if(!ObjectUtils.isEmpty(postNodeId)) {
|
|
||||||
if (postNodeId.getTaskId() != null) {
|
|
||||||
RecruitProcessTask recruitProcessTask = recruitProcessTaskService.getByTaskId(postNodeId.getTaskId());
|
|
||||||
followVO.setPostCount(recruitProcessTask.getPostCount());
|
|
||||||
} else {
|
|
||||||
followVO.setPostCount(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
followVO.setHrId(resumeFollowRecord.getHrId());
|
|
||||||
followVO.setHrName(resumeFollowRecord.getHrName());
|
|
||||||
//设置一面人数
|
|
||||||
followVO.setFirstInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter( record -> record.getFirstReach() != null && "1".equals(record.getFirstReach()))
|
|
||||||
.count());
|
|
||||||
//设置二面人数
|
|
||||||
followVO.setSecondInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getSecondReach() != null && "1".equals(record.getSecondReach()))
|
|
||||||
.count());
|
|
||||||
//设置三面人数
|
|
||||||
followVO.setThirdInterviewCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getFinalReach() != null && "1".equals(record.getFinalReach()))
|
|
||||||
.count());
|
|
||||||
//设置谈薪人数
|
|
||||||
followVO.setSalaryCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getFinalPass() != null && "1".equals(record.getFinalPass()))
|
|
||||||
.count());
|
|
||||||
//设置拿offer人数
|
|
||||||
followVO.setOfferCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getAcceptOffer() != null && "1".equals(record.getAcceptOffer()))
|
|
||||||
.count());
|
|
||||||
//设置入职人数(实际入职日期不为空的条数)
|
|
||||||
followVO.setEntryCount(resumeFollowRecords.stream()
|
|
||||||
.filter(record -> record.getActualJoinDate() != null)
|
|
||||||
.count());
|
|
||||||
//插入新数据
|
|
||||||
followVOList.add(followVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success(followVOList);
|
return AjaxResult.success(followVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleFollowRecords(FollowDTO req, List<FollowVO> followVOList) {
|
||||||
|
String hrName = req.getHrName();
|
||||||
|
LocalDate startDate = req.getStartDate();
|
||||||
|
LocalDate endDate = req.getEndDate();
|
||||||
|
|
||||||
|
// 定义所有需要处理的状态及其对应的Map
|
||||||
|
Map<Integer, Map<Long, List<ResumeFollowRecord>>> statusMaps = new HashMap<>();
|
||||||
|
statusMaps.put(-1, resumeFollowRecordService.listBySelect(req).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId)));
|
||||||
|
statusMaps.put(0, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 0).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(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(6, resumeFollowRecordService.getBySelectMonth(hrName, startDate, endDate, 6).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId)));
|
||||||
|
|
||||||
|
// 处理每种状态下的记录
|
||||||
|
for (Map.Entry<Integer, Map<Long, List<ResumeFollowRecord>>> entry : statusMaps.entrySet()) {
|
||||||
|
int status = entry.getKey();
|
||||||
|
Map<Long, List<ResumeFollowRecord>> mapResumeFollowRecord = entry.getValue();
|
||||||
|
|
||||||
|
if (!mapResumeFollowRecord.isEmpty()) {
|
||||||
|
for (Map.Entry<Long, List<ResumeFollowRecord>> recordEntry : mapResumeFollowRecord.entrySet()) {
|
||||||
|
Long postId = recordEntry.getKey();
|
||||||
|
List<ResumeFollowRecord> records = recordEntry.getValue();
|
||||||
|
|
||||||
|
FollowVO followVO = followVOList.stream().filter(f -> f.getPostId().equals(postId)).findFirst().orElseGet(() -> {
|
||||||
|
FollowVO newFollowVO = new FollowVO();
|
||||||
|
ResumeFollowRecord firstRecord = records.get(0);
|
||||||
|
newFollowVO.setPostId(firstRecord.getPostId());
|
||||||
|
newFollowVO.setPostName(firstRecord.getPostName());
|
||||||
|
newFollowVO.setHrId(firstRecord.getHrId());
|
||||||
|
newFollowVO.setHrName(firstRecord.getHrName());
|
||||||
|
RecruitStructure postNodeId = recruitStructureService.getByNodeId(newFollowVO.getPostId());
|
||||||
|
newFollowVO.setPostCount(postNodeId != null && postNodeId.getTaskId() != null
|
||||||
|
? recruitProcessTaskService.getByTaskId(postNodeId.getTaskId()).getPostCount()
|
||||||
|
: 0);
|
||||||
|
followVOList.add(newFollowVO);
|
||||||
|
return newFollowVO;
|
||||||
|
});
|
||||||
|
|
||||||
|
switch (status) {
|
||||||
|
case -1:
|
||||||
|
followVO.setPassResumeCount(records.size());
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
followVO.setFirstInterviewCount(records.stream().filter(r -> "1".equals(r.getFirstReach())).count());
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
followVO.setSecondInterviewCount(records.stream().filter(r -> "1".equals(r.getSecondReach())).count());
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
followVO.setThirdInterviewCount(records.stream().filter(r -> "1".equals(r.getFinalReach())).count());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
followVO.setSalaryCount(records.stream().filter(r -> "1".equals(r.getFinalPass())).count());
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
followVO.setOfferCount(records.stream().filter(r -> "1".equals(r.getAcceptOffer())).count());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
followVO.setEntryCount(records.stream().filter(r -> r.getActualJoinDate() != null).count());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,6 @@ public class RecruitInterviewController extends BaseController {
|
||||||
return toAjax(resumeFollowRecordService.updateById(req));
|
return toAjax(resumeFollowRecordService.updateById(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Log(title = "上传简历", businessType = BusinessType.UPDATE)
|
@Log(title = "上传简历", businessType = BusinessType.UPDATE)
|
||||||
@PreAuthorize("@ss.hasPermi('recruit:interview:add')")
|
@PreAuthorize("@ss.hasPermi('recruit:interview:add')")
|
||||||
@PostMapping("/interview/uploadResume")
|
@PostMapping("/interview/uploadResume")
|
||||||
|
@ -229,7 +228,6 @@ public class RecruitInterviewController extends BaseController {
|
||||||
return error("上传文件异常,请联系管理员");
|
return error("上传文件异常,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:topping')")
|
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:topping')")
|
||||||
@PutMapping("/interview/editTopping")
|
@PutMapping("/interview/editTopping")
|
||||||
@ApiOperation(value = "修改《面试管理》简历跟进记录是否置顶")
|
@ApiOperation(value = "修改《面试管理》简历跟进记录是否置顶")
|
||||||
|
|
|
@ -19,4 +19,7 @@ public class HomePageDTO {
|
||||||
@ApiModelProperty("hrId")
|
@ApiModelProperty("hrId")
|
||||||
private Long hrId;
|
private Long hrId;
|
||||||
|
|
||||||
|
@ApiModelProperty("hrName")
|
||||||
|
private String hrName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ public interface ResumeFollowRecordMapper extends BaseMapper<ResumeFollowRecord>
|
||||||
List<ResumeFollowRecord> getPostEntryList(@Param("postList") List<Long> postList, @Param("firstDay") LocalDate firstDay, @Param("lastDay")LocalDate lastDay);
|
List<ResumeFollowRecord> getPostEntryList(@Param("postList") List<Long> postList, @Param("firstDay") LocalDate firstDay, @Param("lastDay")LocalDate lastDay);
|
||||||
|
|
||||||
List<ResumeFollowRecord> listBySelect(@Param("req") FollowDTO req);
|
List<ResumeFollowRecord> listBySelect(@Param("req") FollowDTO req);
|
||||||
|
|
||||||
|
List<ResumeFollowRecord> getBySelectMonth(@Param("hrName") String hrName, @Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay, @Param("i") int i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,7 @@ public interface ResumeFollowRecordService extends IService<ResumeFollowRecord>
|
||||||
List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay);
|
List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay);
|
||||||
|
|
||||||
List<ResumeFollowRecord> listBySelect(FollowDTO req);
|
List<ResumeFollowRecord> listBySelect(FollowDTO req);
|
||||||
|
|
||||||
|
|
||||||
|
List<ResumeFollowRecord> getBySelectMonth(String hrName, LocalDate firstDay, LocalDate lastDay, int i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,11 @@ public class ResumeFollowRecordServiceImpl extends ServiceImpl<ResumeFollowRecor
|
||||||
return resumeFollowRecordMapper.listBySelect(req);
|
return resumeFollowRecordMapper.listBySelect(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResumeFollowRecord> getBySelectMonth(String hrName, LocalDate firstDay, LocalDate lastDay, int i) {
|
||||||
|
return resumeFollowRecordMapper.getBySelectMonth(hrName,firstDay,lastDay,i);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,5 +128,54 @@
|
||||||
<if test="req.deptId!=null">and dept_id = #{req.deptId}</if>
|
<if test="req.deptId!=null">and dept_id = #{req.deptId}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getBySelectMonth" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from resume_follow_record
|
||||||
|
where name is not null
|
||||||
|
<if test="i == 0">
|
||||||
|
and first_reach is not null
|
||||||
|
and first_reach = 1
|
||||||
|
and first_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and first_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 1">
|
||||||
|
and final_pass is not null
|
||||||
|
and final_pass = 1
|
||||||
|
and final_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and final_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 2">
|
||||||
|
and actual_join_date is not null
|
||||||
|
and actual_join_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and actual_join_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 3">
|
||||||
|
and first_pass is not null
|
||||||
|
and first_pass = 1
|
||||||
|
and first_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and first_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 4">
|
||||||
|
and second_reach is not null
|
||||||
|
and second_reach = 1
|
||||||
|
and second_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and second_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 5">
|
||||||
|
and final_reach is not null
|
||||||
|
and final_reach = 1
|
||||||
|
and final_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and final_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="i == 6">
|
||||||
|
and accept_offer is not null
|
||||||
|
and accept_offer = 1
|
||||||
|
and final_date <![CDATA[>=]]> #{firstDay}
|
||||||
|
and final_date <![CDATA[<=]]> #{lastDay}
|
||||||
|
</if>
|
||||||
|
<if test="hrName!=null and hrName != ''">and hr_name like concat('%', #{hrName}, '%')</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue