1.修改任务跟踪的接受offer人数和入职人数,关联到入职管理的数据

This commit is contained in:
lw 2024-07-29 17:10:08 +08:00
parent 2e0699b8fd
commit 7b7e282e18
6 changed files with 94 additions and 18 deletions

View File

@ -67,6 +67,9 @@ public class RecruitFollowController extends BaseController {
@Autowired
private PostGradeService postGradeService;
@Autowired
private EntryManageService entryManageService;
// @PreAuthorize("@ss.hasPermi('recruit:follow:add')")
// @Log(title = "新增招聘计划与统计", businessType = BusinessType.INSERT)
@ -243,6 +246,33 @@ public class RecruitFollowController extends BaseController {
filteredFollowVOList.add(followVO);
}
);
//获取入职管理的接受offer人数是否确认入职入职人数实际入职日期
List<EntryManage> entryManageList=entryManageService.getOfferCounts(startDate,endDate);
if(!CollectionUtils.isEmpty(entryManageList)){
//筛选出entryManageList里接受offer人数
List<EntryManage> offerLists = entryManageList.stream()
.filter(entry -> "1".equals(entry.getIsEntry()))
.collect(Collectors.toList());
//将这个offerList 根据岗位id进行分组
Map<Long, List<EntryManage>> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
//筛选出entryManageList里入职人数
List<EntryManage> entryList = entryManageList.stream()
.filter(entry -> entry.getActualJoinDate() != null)
.collect(Collectors.toList());
Map<Long, List<EntryManage>> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
filteredFollowVOList.forEach(followVO -> {
List<EntryManage> offer = offerMap.get(followVO.getPostId());
List<EntryManage> entry = entryMap.get(followVO.getPostId());
if (offer != null) {
followVO.setOfferCount(offer.size());
}
if(entry!=null){
followVO.setEntryCount(entry.size());
}
});
}
// filteredFollowVOList将所有字段除了deptName为null的字段设置为0
filteredFollowVOList.forEach(followVO -> {
@ -261,8 +291,8 @@ public class RecruitFollowController extends BaseController {
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);
if (followVO.getOfferCount() == null) followVO.setOfferCount(0);
if (followVO.getEntryCount() == null) followVO.setEntryCount(0);
//再根据岗位公海里绑定的hr进行重新覆盖写入因为有可能某岗位被分配给其他人了
RecruitPost recruitPost = recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getNodeId, followVO.getPostId()));
@ -306,8 +336,6 @@ public class RecruitFollowController extends BaseController {
private void handleFollowRecords(FollowDTO req, List<FollowVO> followVOList,LocalDate startDate,LocalDate endDate) {
String hrName = req.getHrName();
// 定义所有需要处理的状态及其对应的Map
Map<Integer, Map<Long, List<ResumeFollowRecord>>> statusMaps = new HashMap<>();
statusMaps.put(-1, resumeFollowRecordService.listBySelect(req).stream().collect(Collectors.groupingBy(ResumeFollowRecord::getPostId)));
@ -315,8 +343,8 @@ public class RecruitFollowController extends BaseController {
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)));
// 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()) {
@ -359,12 +387,12 @@ public class RecruitFollowController extends BaseController {
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;
// 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;
}
}
}
@ -464,6 +492,34 @@ public class RecruitFollowController extends BaseController {
filteredFollowVOList.add(followVO);
}
);
//获取入职管理的接受offer人数是否确认入职入职人数实际入职日期
List<EntryManage> entryManageList=entryManageService.getOfferCounts(startDate,endDate);
if(!CollectionUtils.isEmpty(entryManageList)){
//筛选出entryManageList里接受offer人数
List<EntryManage> offerLists = entryManageList.stream()
.filter(entry -> "1".equals(entry.getIsEntry()))
.collect(Collectors.toList());
//将这个offerList 根据岗位id进行分组
Map<Long, List<EntryManage>> offerMap = offerLists.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
//筛选出entryManageList里入职人数
List<EntryManage> entryList = entryManageList.stream()
.filter(entry -> entry.getActualJoinDate() != null)
.collect(Collectors.toList());
Map<Long, List<EntryManage>> entryMap = entryList.stream().collect(Collectors.groupingBy(EntryManage::getPostId));
filteredFollowVOList.forEach(followVO -> {
List<EntryManage> offer = offerMap.get(followVO.getPostId());
List<EntryManage> entry = entryMap.get(followVO.getPostId());
if (offer != null) {
followVO.setOfferCount(offer.size());
}
if(entry!=null){
followVO.setEntryCount(entry.size());
}
});
}
//需求人数总数
Integer postCountTotal=0;
//主动打招呼总数
@ -479,9 +535,9 @@ public class RecruitFollowController extends BaseController {
//终试通过人数总数
Long salaryCountTotal=0L;
//接收offer人数总数
Long offerCountTotal=0L;
Integer offerCountTotal=0;
//入职人数总数
Long entryCountTotal=0L;
Integer entryCountTotal=0;
// filteredFollowVOList将所有字段除了deptName为null的字段设置为0
for (FollowVO followVO:filteredFollowVOList){
@ -499,8 +555,8 @@ public class RecruitFollowController extends BaseController {
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);
if (followVO.getOfferCount() == null) followVO.setOfferCount(0);
if (followVO.getEntryCount() == null) followVO.setEntryCount(0);
Optional<PostGrade> optionalPostGrade = postGradeList.stream()
.filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId()))

View File

@ -91,11 +91,11 @@ public class FollowVO {
@ApiModelProperty(value = "offer人数")
@Excel(name = "接受offer人数")
private Long offerCount;
private Integer offerCount;
@ApiModelProperty(value = "入职人数")
@Excel(name = "入职人数")
private Long entryCount;
private Integer entryCount;
// @ApiModelProperty(value = "离职人数")
// private Long leaveCount;

View File

@ -25,6 +25,8 @@ public interface EntryManageMapper extends BaseMapper<EntryManage> {
List<EntryManage> getListByWeek(@Param("now") LocalDate now, @Param("plusDays") LocalDate plusDays);
List<EntryManage> listByYear(@Param("year") String year);
List<EntryManage> getOfferCounts(@Param("startDate")LocalDate startDate, @Param("endDate")LocalDate endDate);
}

View File

@ -22,4 +22,6 @@ public interface EntryManageService extends IService<EntryManage> {
List<EntryManage> getListByWeek(LocalDate now, LocalDate plusDays);
List<EntryManage> listByYear(String year);
List<EntryManage> getOfferCounts(LocalDate startDate, LocalDate endDate);
}

View File

@ -38,6 +38,11 @@ public class EntryManageServiceImpl extends ServiceImpl<EntryManageMapper, Entry
public List<EntryManage> listByYear(String year) {
return this.baseMapper.listByYear(year);
}
@Override
public List<EntryManage> getOfferCounts(LocalDate startDate, LocalDate endDate) {
return this.baseMapper.getOfferCounts(startDate,endDate);
}
}

View File

@ -76,4 +76,15 @@
CONCAT(#{year}, '-12-31')
AND join_date is not null
</select>
<select id="getOfferCounts" resultMap="BaseResultMap">
SELECT *
FROM entry_manage
WHERE
join_date IS NOT NULL
AND join_date BETWEEN #{startDate} AND #{endDate}
</select>
</mapper>