1.新增主页面版显示近日事项图标 2.修改锥形图的到面人数统计
This commit is contained in:
parent
3ccfd29d01
commit
080e513e34
|
@ -4,6 +4,7 @@ import cn.zeroerr.common.annotation.Anonymous;
|
||||||
import cn.zeroerr.common.core.controller.BaseController;
|
import cn.zeroerr.common.core.controller.BaseController;
|
||||||
import cn.zeroerr.common.core.domain.AjaxResult;
|
import cn.zeroerr.common.core.domain.AjaxResult;
|
||||||
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
|
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
|
||||||
|
import cn.zeroerr.domain.dto.AnnouncementDTO;
|
||||||
import cn.zeroerr.domain.dto.FollowDTO;
|
import cn.zeroerr.domain.dto.FollowDTO;
|
||||||
import cn.zeroerr.domain.dto.HomePageDTO;
|
import cn.zeroerr.domain.dto.HomePageDTO;
|
||||||
import cn.zeroerr.domain.dto.PostDetailDTO;
|
import cn.zeroerr.domain.dto.PostDetailDTO;
|
||||||
|
@ -30,6 +31,7 @@ import java.time.LocalDate;
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
import java.time.temporal.TemporalAdjusters;
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -86,19 +88,20 @@ public class HomePageController extends BaseController {
|
||||||
//寻找该月份接受的offer数
|
//寻找该月份接受的offer数
|
||||||
List<ResumeFollowRecord> resumeFollowRecordOfferList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 6);
|
List<ResumeFollowRecord> resumeFollowRecordOfferList = resumeFollowRecordService.getBySelectMonth(req.getHrName(), firstDay, lastDay, 6);
|
||||||
|
|
||||||
|
|
||||||
ResumeStatVO resumeStatVO = new ResumeStatVO();
|
ResumeStatVO resumeStatVO = new ResumeStatVO();
|
||||||
//1.合格简历数量
|
//1.合格简历数量
|
||||||
resumeStatVO.setQualifiedCount(resumeFollowRecordList.size());
|
resumeStatVO.setQualifiedCount(resumeFollowRecordList.size());
|
||||||
//2 .初试通过人数
|
//2 .初试通过人数
|
||||||
resumeStatVO.setFistCount(resumeFollowRecordFirstPassList.stream().filter(record -> Objects.nonNull(record.getFirstPass()) && "1".equals(record.getFirstPass())).count());
|
resumeStatVO.setFistCount(resumeFollowRecordFirstPassList.stream().filter(record -> "1".equals(record.getFirstPass())).count());
|
||||||
//3.通过人数(终面)
|
//3.通过人数(终面)
|
||||||
resumeStatVO.setFinalPassCount(resumeFollowRecordFinalPassList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "1".equals(record.getFinalPass())).count());
|
resumeStatVO.setFinalPassCount(resumeFollowRecordFinalPassList.stream().filter(record -> "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 -> "0".equals(record.getFinalPass())).count());
|
||||||
//5.入职人数("实际"入职日期不为空的数据统计)
|
//5.入职人数("实际"入职日期不为空的数据统计)
|
||||||
resumeStatVO.setEntryCount(entryManageList.size());
|
resumeStatVO.setEntryCount(entryManageList.size());
|
||||||
//6.简历来源:下载
|
//6.简历来源:下载
|
||||||
resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getResumeSource()) && "2".equals(record.getResumeSource())).count());
|
resumeStatVO.setDownLoadCounts(resumeFollowRecordList.stream().filter(record -> "2".equals(record.getResumeSource())).count());
|
||||||
//7.简历处理-自投
|
//7.简历处理-自投
|
||||||
if (resumeHandleRecordList != null) {
|
if (resumeHandleRecordList != null) {
|
||||||
resumeStatVO.setSelfCounts(resumeHandleRecordList.stream()
|
resumeStatVO.setSelfCounts(resumeHandleRecordList.stream()
|
||||||
|
@ -109,7 +112,7 @@ public class HomePageController extends BaseController {
|
||||||
resumeStatVO.setSelfCounts(0);
|
resumeStatVO.setSelfCounts(0);
|
||||||
}
|
}
|
||||||
//8.封装实际到面人数
|
//8.封装实际到面人数
|
||||||
resumeStatVO.setActualArriveCounts(resumeFollowRecordActualArrivedList.stream().filter(record -> Objects.nonNull(record.getFirstReach()) && "1".equals(record.getFirstReach())).count());
|
resumeStatVO.setActualArriveCounts(resumeFollowRecordActualArrivedList.stream().filter(record -> "1".equals(record.getFirstReach())).count());
|
||||||
//9.通过比例(终面)=通过人数(终面)/初面实际到面人数
|
//9.通过比例(终面)=通过人数(终面)/初面实际到面人数
|
||||||
//long totalCount = resumeStatVO.getFinalPassCount() + resumeStatVO.getFinalFailCount();
|
//long totalCount = resumeStatVO.getFinalPassCount() + resumeStatVO.getFinalFailCount();
|
||||||
if (resumeStatVO.getActualArriveCounts() != null) {
|
if (resumeStatVO.getActualArriveCounts() != null) {
|
||||||
|
@ -359,18 +362,22 @@ public class HomePageController extends BaseController {
|
||||||
//封装电话面试通过百分比
|
//封装电话面试通过百分比
|
||||||
//通过电话面试的人数
|
//通过电话面试的人数
|
||||||
//通过
|
//通过
|
||||||
long phonePassCount1 = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "1".equals(record.getIsPass())).count();
|
long phonePassCount1 = allResumeFollowRecordList.stream().filter(record -> "1".equals(record.getIsPass())).count();
|
||||||
//直接邀约
|
//直接邀约
|
||||||
long phonePassCount2 = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getIsPass()) && "4".equals(record.getIsPass())).count();
|
long phonePassCount2 = allResumeFollowRecordList.stream().filter(record -> "4".equals(record.getIsPass())).count();
|
||||||
long phonePassCount = phonePassCount1 + phonePassCount2;
|
long phonePassCount = phonePassCount1 + phonePassCount2;
|
||||||
|
|
||||||
funnelDataList.add(new ResumeStatVO.FunnelData().setName("电面通过:" + phonePassCount + "人").setValue(phonePassCount));
|
funnelDataList.add(new ResumeStatVO.FunnelData().setName("电面通过:" + phonePassCount + "人").setValue(phonePassCount));
|
||||||
|
|
||||||
|
//封装到面人数
|
||||||
|
long arrivedCount = allResumeFollowRecordList.stream().filter(record -> "1".equals(record.getFirstReach())).count();
|
||||||
|
funnelDataList.add(new ResumeStatVO.FunnelData().setName("到面人数:" + arrivedCount + "人").setValue(arrivedCount));
|
||||||
|
|
||||||
//封装初试通过百分比
|
//封装初试通过百分比
|
||||||
long firstReachCount = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFirstPass()) && "1".equals(record.getFirstPass())).count();
|
long firstReachCount = allResumeFollowRecordList.stream().filter(record -> "1".equals(record.getFirstPass())).count();
|
||||||
|
|
||||||
funnelDataList.add(new ResumeStatVO.FunnelData().setName("初试通过:" + firstReachCount + "人").setValue(firstReachCount));
|
funnelDataList.add(new ResumeStatVO.FunnelData().setName("初试通过:" + firstReachCount + "人").setValue(firstReachCount));
|
||||||
|
|
||||||
long finalPassCount = allResumeFollowRecordList.stream().filter(record -> Objects.nonNull(record.getFinalPass()) && "1".equals(record.getFinalPass())).count();
|
long finalPassCount = allResumeFollowRecordList.stream().filter(record -> "1".equals(record.getFinalPass())).count();
|
||||||
//封装终试通过人数
|
//封装终试通过人数
|
||||||
funnelDataList.add(new ResumeStatVO.FunnelData().setName("终试通过:" + finalPassCount + "人").setValue(finalPassCount));
|
funnelDataList.add(new ResumeStatVO.FunnelData().setName("终试通过:" + finalPassCount + "人").setValue(finalPassCount));
|
||||||
|
|
||||||
|
@ -488,4 +495,74 @@ public class HomePageController extends BaseController {
|
||||||
return AjaxResult.success(postListVOList);
|
return AjaxResult.success(postListVOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/getAnnouncement")
|
||||||
|
@ApiOperation(value = "获取公告数据")
|
||||||
|
public AjaxResult getAnnouncement() {
|
||||||
|
//封装公告内容
|
||||||
|
List<AnnouncementDTO> announcementDTOList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 获取近五天的日期范围
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate fiveDaysLater = now.plusDays(5);
|
||||||
|
|
||||||
|
// 获取近五天预计入职的人,并按时间分类
|
||||||
|
Map<LocalDate, List<EntryManage>> groupByJoinDate = entryManageService.getListByWeek(now, fiveDaysLater)
|
||||||
|
.stream().collect(Collectors.groupingBy(EntryManage::getJoinDate));
|
||||||
|
|
||||||
|
// 获取近五天将要面试的人,并按时间分类
|
||||||
|
Map<LocalDate, List<ResumeFollowRecord>> groupByFirstDate = resumeFollowRecordService.getListByWeek(now, fiveDaysLater)
|
||||||
|
.stream().collect(Collectors.groupingBy(ResumeFollowRecord::getFirstDate));
|
||||||
|
|
||||||
|
// 处理预计入职的公告
|
||||||
|
processAnnouncements(announcementDTOList, groupByJoinDate, "预计入职候选人", AnnouncementDTO::setContentEntry);
|
||||||
|
|
||||||
|
// 处理面试公告
|
||||||
|
processAnnouncements(announcementDTOList, groupByFirstDate, "面试候选人", AnnouncementDTO::setContentInterview);
|
||||||
|
|
||||||
|
// 按日期排序
|
||||||
|
announcementDTOList.sort(Comparator.comparing(AnnouncementDTO::getDate));
|
||||||
|
|
||||||
|
return AjaxResult.success(announcementDTOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> void processAnnouncements(List<AnnouncementDTO> announcementDTOList, Map<LocalDate, List<T>> groupedData, String title, BiConsumer<AnnouncementDTO, String> setContentMethod) {
|
||||||
|
int count = 1;
|
||||||
|
for (Map.Entry<LocalDate, List<T>> entry : groupedData.entrySet()) {
|
||||||
|
LocalDate date = entry.getKey();
|
||||||
|
List<T> dataList = entry.getValue();
|
||||||
|
|
||||||
|
Optional<AnnouncementDTO> existingAnnouncement = announcementDTOList.stream()
|
||||||
|
.filter(announcement -> date.equals(announcement.getDate()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
for (T data : dataList) {
|
||||||
|
if (data instanceof EntryManage) {
|
||||||
|
EntryManage entryManage = (EntryManage) data;
|
||||||
|
content.append(entryManage.getUserName()).append(" ").append(entryManage.getPostName()).append(";");
|
||||||
|
} else if (data instanceof ResumeFollowRecord) {
|
||||||
|
ResumeFollowRecord resumeFollowRecord = (ResumeFollowRecord) data;
|
||||||
|
content.append(resumeFollowRecord.getName()).append(" ").append(resumeFollowRecord.getPostName()).append(";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (existingAnnouncement.isPresent()) {
|
||||||
|
AnnouncementDTO announcementDTO = existingAnnouncement.get();
|
||||||
|
setContentMethod.accept(announcementDTO, content.toString());
|
||||||
|
} else {
|
||||||
|
AnnouncementDTO announcementDTO = new AnnouncementDTO();
|
||||||
|
announcementDTO.setId(count++);
|
||||||
|
announcementDTO.setDate(date);
|
||||||
|
announcementDTO.setTitleEntry("预计入职候选人".equals(title) ? title : "预计入职候选人");
|
||||||
|
announcementDTO.setContentEntry("预计入职候选人".equals(title) ? content.toString() : "无");
|
||||||
|
announcementDTO.setTitleInterview("面试候选人".equals(title) ? title : "面试候选人");
|
||||||
|
announcementDTO.setContentInterview("面试候选人".equals(title) ? content.toString() : "无");
|
||||||
|
announcementDTOList.add(announcementDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package cn.zeroerr.domain.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel
|
||||||
|
public class AnnouncementDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "公告id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "日期")
|
||||||
|
private LocalDate date;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预计入职标题")
|
||||||
|
private String titleEntry;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预计入职公告内容")
|
||||||
|
private String contentEntry;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "面试标题")
|
||||||
|
private String titleInterview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "面试公告内容")
|
||||||
|
private String contentInterview;
|
||||||
|
}
|
|
@ -21,6 +21,8 @@ public interface EntryManageMapper extends BaseMapper<EntryManage> {
|
||||||
List<EntryManage> listBySelect(@Param("req") EntryManagerDTO req);
|
List<EntryManage> listBySelect(@Param("req") EntryManagerDTO req);
|
||||||
|
|
||||||
List<EntryManage> getList(@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay);
|
List<EntryManage> getList(@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay);
|
||||||
|
|
||||||
|
List<EntryManage> getListByWeek(@Param("now") LocalDate now, @Param("plusDays") LocalDate plusDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ public interface ResumeFollowRecordMapper extends BaseMapper<ResumeFollowRecord>
|
||||||
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);
|
List<ResumeFollowRecord> getBySelectMonth(@Param("hrName") String hrName, @Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay, @Param("i") int i);
|
||||||
|
|
||||||
|
List<ResumeFollowRecord> getListByWeek(@Param("now") LocalDate now, @Param("plusDays") LocalDate plusDays);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,4 +18,6 @@ public interface EntryManageService extends IService<EntryManage> {
|
||||||
List<EntryManage> listBySelect(EntryManagerDTO req);
|
List<EntryManage> listBySelect(EntryManagerDTO req);
|
||||||
|
|
||||||
List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay);
|
List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay);
|
||||||
|
|
||||||
|
List<EntryManage> getListByWeek(LocalDate now, LocalDate plusDays);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,4 +26,6 @@ public interface ResumeFollowRecordService extends IService<ResumeFollowRecord>
|
||||||
|
|
||||||
|
|
||||||
List<ResumeFollowRecord> getBySelectMonth(String hrName, LocalDate firstDay, LocalDate lastDay, int i);
|
List<ResumeFollowRecord> getBySelectMonth(String hrName, LocalDate firstDay, LocalDate lastDay, int i);
|
||||||
|
|
||||||
|
List<ResumeFollowRecord> getListByWeek(LocalDate now, LocalDate plusDays);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,11 @@ public class EntryManageServiceImpl extends ServiceImpl<EntryManageMapper, Entry
|
||||||
public List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay) {
|
public List<EntryManage> getList(LocalDate firstDay, LocalDate lastDay) {
|
||||||
return baseMapper.getList(firstDay,lastDay);
|
return baseMapper.getList(firstDay,lastDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EntryManage> getListByWeek(LocalDate now, LocalDate plusDays) {
|
||||||
|
return this.baseMapper.getListByWeek(now,plusDays);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,11 @@ public class ResumeFollowRecordServiceImpl extends ServiceImpl<ResumeFollowRecor
|
||||||
return resumeFollowRecordMapper.getBySelectMonth(hrName,firstDay,lastDay,i);
|
return resumeFollowRecordMapper.getBySelectMonth(hrName,firstDay,lastDay,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResumeFollowRecord> getListByWeek(LocalDate now, LocalDate plusDays) {
|
||||||
|
return resumeFollowRecordMapper.getListByWeek(now,plusDays);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,4 +55,13 @@
|
||||||
<if test="firstDay!=null"> and actual_join_date <![CDATA[>=]]> #{firstDay}</if>
|
<if test="firstDay!=null"> and actual_join_date <![CDATA[>=]]> #{firstDay}</if>
|
||||||
<if test="lastDay!=null"> and actual_join_date <![CDATA[<=]]> #{lastDay}</if>
|
<if test="lastDay!=null"> and actual_join_date <![CDATA[<=]]> #{lastDay}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getListByWeek" resultMap="BaseResultMap">
|
||||||
|
select <include refid="Base_Column_List"/>
|
||||||
|
from entry_manage
|
||||||
|
where join_date is not null
|
||||||
|
<if test="now!=null"> and join_date <![CDATA[>=]]> #{now}</if>
|
||||||
|
<if test="plusDays!=null"> and join_date <![CDATA[<=]]> #{plusDays}</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -188,5 +188,11 @@
|
||||||
<if test="hrName!=null and hrName != ''">and hr_name like concat('%', #{hrName}, '%')</if>
|
<if test="hrName!=null and hrName != ''">and hr_name like concat('%', #{hrName}, '%')</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getListByWeek" resultMap="BaseResultMap">
|
||||||
|
select <include refid="Base_Column_List"/>
|
||||||
|
from resume_follow_record
|
||||||
|
where first_date is not null
|
||||||
|
<if test="now!=null"> and first_date <![CDATA[>=]]> #{now}</if>
|
||||||
|
<if test="plusDays!=null"> and first_date <![CDATA[<=]]> #{plusDays}</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue