Compare commits

..

10 Commits

36 changed files with 804 additions and 100 deletions

View File

@ -5,14 +5,14 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver
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:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: zero
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:
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: zero
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -7,8 +7,8 @@ ruoyi:
# 版权年份
copyrightYear: 2024
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/zeroerr/uploadPath
#profile: /home/zeroerr_oa/uploadPath
#profile: D:/zeroerr/uploadPath
profile: /home/zeroerr_oa/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
@ -58,9 +58,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 20MB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 40MB
# 服务模块
devtools:
restart:
@ -69,15 +69,15 @@ spring:
# redis 配置
redis:
# 地址
#host: 192.168.1.189
host: localhost
host: 192.168.1.189
#host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
#password: 123456
password:
password: 123456
#password:
# 连接超时时间
timeout: 10s
lettuce:

View File

@ -16,7 +16,11 @@
</description>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>easyexcel</artifactId>-->
<!-- <version>2.2.6</version>-->
<!-- </dependency>-->
<!-- Spring框架基本的核心工具 -->
<dependency>
<groupId>org.springframework</groupId>

View File

@ -35,6 +35,11 @@
<artifactId>zeroerr_oa-common</artifactId>
</dependency>
<dependency>
<groupId>cn.zeroerr</groupId>
<artifactId>zeroerr_oa-recruit</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,8 +1,20 @@
package cn.zeroerr.quartz.task;
import cn.zeroerr.domain.entity.PostGrade;
import cn.zeroerr.service.PostGradeService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import cn.zeroerr.common.utils.StringUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 定时任务调度测试
*
@ -11,6 +23,8 @@ import cn.zeroerr.common.utils.StringUtils;
@Component("ryTask")
public class RyTask
{
@Autowired
private PostGradeService postGradeService;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
@ -25,4 +39,45 @@ public class RyTask
{
System.out.println("执行无参方法");
}
public void handleGrade(){
LocalDate now = LocalDate.now();
// 获取上个月的日期
LocalDate lastMonth = now.minusMonths(1);
// 定义日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
// 格式化日期
String lastMonthData = lastMonth.format(formatter);
String currentMonthData = now.format(formatter);
//获取上个月的所有岗位评级
List<PostGrade> lastList = postGradeService.list(
new LambdaQueryWrapper<PostGrade>()
.eq(PostGrade::getMonth, lastMonthData)
);
//获取这个月的所有岗位评级
List<PostGrade> currentList = postGradeService.list(
new LambdaQueryWrapper<PostGrade>()
.eq(PostGrade::getMonth, currentMonthData)
);
List<PostGrade> postGradeList=new ArrayList<>();
if (!CollectionUtils.isEmpty(lastList)) {
// 获取这个月所有的postId
List<Long> currentPostIds = currentList.stream()
.map(PostGrade::getPostId)
.collect(Collectors.toList());
for (PostGrade last : lastList) {
if (!currentPostIds.contains(last.getPostId())) {
last.setMonth(currentMonthData);
postGradeList.add(last);
}
}
}
//将收集到需要添加的当月评级数据导入
postGradeService.saveBatch(postGradeList);
}
}

View File

@ -18,6 +18,11 @@
</properties>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>cn.zeroerr</groupId>
<artifactId>zeroerr_oa-common</artifactId>

View File

@ -11,6 +11,7 @@ import cn.zeroerr.common.utils.poi.ExcelUtil;
import cn.zeroerr.domain.dto.EntryManagerDTO;
import cn.zeroerr.domain.entity.EntryManage;
import cn.zeroerr.domain.entity.ResumeFollowRecord;
import cn.zeroerr.domain.vo.EntryStatisticsVO;
import cn.zeroerr.domain.vo.UserVO;
import cn.zeroerr.service.EntryManageService;
import cn.zeroerr.service.ResumeFollowRecordService;
@ -27,10 +28,15 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/recruit/entryManage")
@ -110,19 +116,6 @@ public class EntryManageController extends BaseController {
@ApiOperation(value = "下载入职管理记录")
@Log(title = "下载入职管理记录", businessType = BusinessType.EXPORT)
public void export(HttpServletResponse response, EntryManagerDTO req) {
// boolean isHr = false;
// List<SysRole> sysRoles = iSysRoleService.rolesByUserId(getUserId());
// if (!CollectionUtils.isEmpty(sysRoles)) {
// for (SysRole sysRole : sysRoles) {
// //如果角色是hr
// if (sysRole.getRoleKey().equals("hr") || sysRole.getRoleKey().equals("hrleader")) {
// isHr = true;
// }
// }
// }
// if (isHr) {
// req.setHrId(getUserId());
// }
List<EntryManage> entryManageList = entryManageService.listBySelect(req);
//将序号重新排列
for (int i = 0; i < entryManageList.size(); i++) {
@ -133,4 +126,45 @@ public class EntryManageController extends BaseController {
util.exportExcel(response, entryManageList, "入职管理数据");
}
@GetMapping("/getStatistics/{year}")
@PreAuthorize("@ss.hasAnyPermi('recruit:entry:statistics')")
@ApiOperation(value = "查看入职管理统计")
public AjaxResult getStatistics(@PathVariable("year") String year) {
EntryStatisticsVO entryStatisticsVO = new EntryStatisticsVO();
List<Integer> expectEntryCounts=new ArrayList<>();
List<Integer> confirmEntryCounts=new ArrayList<>();
List<Integer> refuseEntryCounts=new ArrayList<>();
//找出所有该年份的入职信息预计入职不为空的
List<EntryManage> entryList = entryManageService.listByYear(year);
//根据月份进行分组
if (!CollectionUtils.isEmpty(entryList)) {
Map<Integer, List<EntryManage>> listByMonth = entryList.stream().collect(Collectors.groupingBy(x -> x.getJoinDate().getMonthValue()));
//从1月份开始因为防止有月份没有数据导致错乱
for(int month =1 ;month<=12 ;month++){
List<EntryManage> entryManageList = listByMonth.get(month);
//如果该月份有数据
if(!CollectionUtils.isEmpty(entryManageList)){
//统计该月份的预计入职人数
expectEntryCounts.add(entryManageList.size());
//统计该月份实际入职人数
confirmEntryCounts.add((int) entryManageList.stream().filter(x -> x.getIsEntry().equals("1")).count());
//统计该月份拒绝入职人数
refuseEntryCounts.add((int) entryManageList.stream().filter(x -> x.getIsEntry().equals("0")).count());
}
//如果该月份没有数据
else {
expectEntryCounts.add(null);
confirmEntryCounts.add(null);
refuseEntryCounts.add(null);
}
}
}
entryStatisticsVO.setExpectEntryCounts(expectEntryCounts);
entryStatisticsVO.setConfirmEntryCounts(confirmEntryCounts);
entryStatisticsVO.setRefuseEntryCounts(refuseEntryCounts);
return AjaxResult.success(entryStatisticsVO);
}
}

View File

@ -1,30 +1,43 @@
package cn.zeroerr.controller;
import cn.zeroerr.common.annotation.Anonymous;
import cn.zeroerr.common.annotation.Log;
import cn.zeroerr.common.core.controller.BaseController;
import cn.zeroerr.common.core.domain.AjaxResult;
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.HomePageDTO;
import cn.zeroerr.domain.dto.PostDetailDTO;
import cn.zeroerr.common.enums.BusinessType;
import cn.zeroerr.domain.dto.*;
import cn.zeroerr.domain.entity.*;
import cn.zeroerr.domain.vo.PostListVO;
import cn.zeroerr.domain.vo.ResumeStatVO;
import cn.zeroerr.service.*;
import cn.zeroerr.system.service.RecruitStructureService;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.github.xiaoymin.knife4j.core.util.StrUtil;
import com.google.common.collect.Lists;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
@ -517,6 +530,7 @@ public class HomePageController extends BaseController {
if (interviewList != null) {
Collections.sort(interviewList, Comparator.comparing(interview -> LocalTime.parse(interview.getInterviewTime(), formatter)));
}
}
return AjaxResult.success(announcementDTOList);
}
@ -626,12 +640,12 @@ public class HomePageController extends BaseController {
announcementNode.setInterviewFirstResult("待定");
}
//如果初试有日期但是未到面则视为放弃
else if(resumeFollowRecord.getFirstDate()!=null ){
if(resumeFollowRecord.getFirstReach().equals("0")|| resumeFollowRecord.getFirstReach().isEmpty()){
} else if (resumeFollowRecord.getFirstDate() != null && resumeFollowRecord.getFirstReach() != null) {
if (resumeFollowRecord.getFirstReach().equals("0")) {
announcementNode.setInterviewFirstResult("放弃");
}
}
}
if (resumeFollowRecord.getFinalPass() != null) {
if (resumeFollowRecord.getFinalPass().equals("1")) {
announcementNode.setInterviewFinalResult("通过");
@ -646,6 +660,19 @@ public class HomePageController extends BaseController {
}
}
if (resumeFollowRecord.getIsAttend() != null) {
if (resumeFollowRecord.getIsAttend().equals("1")) {
announcementNode.setIsAttend("参与");
} else if (resumeFollowRecord.getIsAttend().equals("0")) {
announcementNode.setIsAttend("不参与");
} else if (resumeFollowRecord.getIsAttend().equals("2")) {
announcementNode.setIsAttend("待定");
}
}
if (resumeFollowRecord.getManagerTime() != null) {
announcementNode.setManagerTime(resumeFollowRecord.getManagerTime().toLocalTime().toString());
}
if (tip.equals("first")) {
//面试-时间
announcementNode.setInterviewTime(getFormattedTime(resumeFollowRecord.getFirstDate()));
@ -672,4 +699,198 @@ public class HomePageController extends BaseController {
return dateTime.format(timeFormatter);
}
private List<List<String>> head1() {
List<List<String>> headTitles = Lists.newArrayList();
headTitles.add(Lists.newArrayList("面试候选人", "日期"));
headTitles.add(Lists.newArrayList("面试候选人", "时间"));
headTitles.add(Lists.newArrayList("面试候选人", "姓名"));
headTitles.add(Lists.newArrayList("面试候选人", "状态"));
headTitles.add(Lists.newArrayList("面试候选人", "岗位"));
headTitles.add(Lists.newArrayList("面试候选人", "招聘HR"));
headTitles.add(Lists.newArrayList("面试候选人", "初试结果"));
headTitles.add(Lists.newArrayList("面试候选人", "终试结果"));
headTitles.add(Lists.newArrayList("面试候选人", "总经理预计面试时间"));
return headTitles;
}
private List<List<String>> head2() {
List<List<String>> headTitles = Lists.newArrayList();
headTitles.add(Lists.newArrayList("预计入职候选人", "日期"));
headTitles.add(Lists.newArrayList("预计入职候选人", "姓名"));
headTitles.add(Lists.newArrayList("预计入职候选人", "部门"));
headTitles.add(Lists.newArrayList("预计入职候选人", "岗位"));
headTitles.add(Lists.newArrayList("预计入职候选人", "招聘HR"));
return headTitles;
}
private static HorizontalCellStyleStrategy setConfigure() {
// 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 背景色
headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE1.getIndex());
WriteFont headWriteFont = new WriteFont();
// 加粗/**/
headWriteFont.setBold(true);
headWriteFont.setFontHeightInPoints((short) 14); // 设置行高不重要
headWriteCellStyle.setWriteFont(headWriteFont);
//headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
headWriteCellStyle.setShrinkToFit(true);
// 内容的策略
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// 字体策略
WriteFont contentWriteFont = new WriteFont();
// 字体大小
// contentWriteFont.setFontHeightInPoints((short) 14);
contentWriteCellStyle.setWriteFont(contentWriteFont);
//边框
//导出数据垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//导出数据水平居中
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
contentWriteCellStyle.setBorderLeft(BorderStyle.NONE);
contentWriteCellStyle.setBorderTop(BorderStyle.NONE);
contentWriteCellStyle.setBorderRight(BorderStyle.NONE);
contentWriteCellStyle.setBorderBottom(BorderStyle.NONE);
//设置 自动换行
contentWriteCellStyle.setWrapped(true);
//设置
// 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
}
@PostMapping("/export")
@ApiOperation(value = "下载近日事项")
@Log(title = "下载入职管理记录", businessType = BusinessType.EXPORT)
public void export(HttpServletResponse response) throws IOException {
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("近日事项","UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
List<List<Object>> interviewData=new ArrayList<>();
List<List<Object>> entryData=new ArrayList<>();
handleData(interviewData,entryData);
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream())
.registerWriteHandler(setConfigure())
//.registerWriteHandler(new CustomCellWriteHandler())
.build()) {
//第一个sheet
WriteSheet writeSheet = EasyExcel.writerSheet(0, "面试候选人").build();
writeSheet.setHead(head1());
excelWriter.write(interviewData, writeSheet);
//第二个sheet...
WriteSheet writeSheet2 = EasyExcel.writerSheet(1, "预计入职候选人").build();
writeSheet2.setHead(head2());
excelWriter.write(entryData, writeSheet2);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public void handleData(List<List<Object>> interviewData ,List<List<Object>> entryData){
//封装公告内容
List<AnnouncementDTO> announcementDTOList = new ArrayList<>();
// 获取从昨天开始的近七天的日期范围
LocalDate yesterday = LocalDate.now().plusDays(-1);
LocalDate plusDays = yesterday.plusDays(7);
// 获取近七天预计入职的人并按时间分类
Map<LocalDate, List<EntryManage>> groupByJoinDate = entryManageService.getListByWeek(yesterday, plusDays)
.stream().collect(Collectors.groupingBy(EntryManage::getJoinDate));
// 获取近七天将要初试的人并按时间分类
List<ResumeFollowRecord> resumeFollowRecordList1 = resumeFollowRecordService.getFirstInterviewList(yesterday, plusDays);
Map<LocalDate, List<ResumeFollowRecord>> collect1 = resumeFollowRecordList1.stream().collect(Collectors.groupingBy(record -> record.getFirstDate().toLocalDate()));
// 获取近七天将要终试的人并按时间分类
List<ResumeFollowRecord> resumeFollowRecordList2 = resumeFollowRecordService.getFinalInterviewList(yesterday, plusDays);
Map<LocalDate, List<ResumeFollowRecord>> collect2 = resumeFollowRecordList2.stream().collect(Collectors.groupingBy(record -> record.getFinalDate().toLocalDate()));
// 获取近七天将要初试/终试的人并按时间分类
List<ResumeFollowRecord> resumeFollowRecordList3 = resumeFollowRecordService.getFirstAndFinalInterviewList(yesterday, plusDays);
Map<LocalDate, List<ResumeFollowRecord>> collect3 = resumeFollowRecordList3.stream().collect(Collectors.groupingBy(record -> record.getFirstDate().toLocalDate()));
// 处理初试
processAnnouncements(announcementDTOList, collect1, plusDays, "first");
// 处理终试
processAnnouncements(announcementDTOList, collect2, plusDays, "final");
// 处理初/终试
processAnnouncements(announcementDTOList, collect3, plusDays, "mix");
// 处理预计入职的公告
processAnnouncements(announcementDTOList, groupByJoinDate, plusDays, "entry");
// 按日期排序
announcementDTOList.sort(Comparator.comparing(AnnouncementDTO::getDate));
//获取到每个List<AnnouncementDTO> announcementDTOList 里的 AnnouncementDTO 的private List<AnnouncementDTO.AnnouncementInterview> announcementInterviewList;announcementInterviewList的interviewTime字段进行时间排序
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
List<AnnouncementDTO.AnnouncementInterview> list1 = new ArrayList<>();
List<AnnouncementDTO.AnnouncementEntry> list2 = new ArrayList<>();
for (AnnouncementDTO announcement : announcementDTOList) {
List<AnnouncementDTO.AnnouncementInterview> interviewList = announcement.getAnnouncementInterviewList();
List<AnnouncementDTO.AnnouncementEntry> entryList = announcement.getAnnouncementEntryList();
if (interviewList != null) {
Collections.sort(interviewList, Comparator.comparing(interview -> LocalTime.parse(interview.getInterviewTime(), formatter)));
interviewList.forEach(
x -> {
x.setDate(announcement.getDate().toString());
}
);
list1.addAll(interviewList);
}
if (entryList != null) {
entryList.forEach(
x -> {
x.setDate(announcement.getDate().toString());
}
);
list2.addAll(entryList);
}
}
if(!CollectionUtils.isEmpty(list1)){
list1.forEach(
x->{
List<Object> element=new ArrayList<>();
element.add(x.getDate());
element.add(x.getInterviewTime());
element.add(x.getInterviewName());
element.add(x.getInterviewType());
element.add(x.getInterviewPostName());
element.add(x.getInterviewHrName());
element.add(x.getInterviewFirstResult());
element.add(x.getInterviewFinalResult());
element.add(x.getManagerTime());
interviewData.add(element);
}
);
}
if(!CollectionUtils.isEmpty(list2)){
list2.forEach(
x->{
List<Object> element=new ArrayList<>();
element.add(x.getDate());
element.add(x.getEntryName());
element.add(x.getEntryDept());
element.add(x.getEntryPostName());
element.add(x.getEntryHrName());
entryData.add(element);
}
);
}
}
}

View File

@ -17,12 +17,14 @@ import cn.zeroerr.service.*;
import cn.zeroerr.system.service.ISysDeptService;
import cn.zeroerr.system.service.ISysUserService;
import cn.zeroerr.system.service.RecruitStructureService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@ -65,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)
@ -241,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 -> {
@ -250,7 +282,8 @@ public class RecruitFollowController extends BaseController {
if (followVO.getDeptName() == null) followVO.setDeptName(handleDeptName(followVO.getPostId()));
if (followVO.getHrId() == null) followVO.setHrId(0L);
if (followVO.getHrName() == null) followVO.setHrName("");
if (followVO.getPostCount() == null) followVO.setPostCount(0);
//如果需求的岗位是空则是突发生成的岗位没有绑定jd的所以默认为1
if (followVO.getPostCount() == null||followVO.getPostCount()==0) followVO.setPostCount(1);
if (followVO.getLookResumeCount() == null) followVO.setLookResumeCount(0);
if (followVO.getInviteInterviewCount() == null) followVO.setInviteInterviewCount(0);
if (followVO.getPassResumeCount() == null) followVO.setPassResumeCount(0);
@ -258,8 +291,15 @@ 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()));
if(!ObjectUtils.isEmpty(recruitPost)){
followVO.setHrId(recruitPost.getHrId());
followVO.setHrName(recruitPost.getHrName());
}
Optional<PostGrade> optionalPostGrade = postGradeList.stream()
.filter(postGrade -> Objects.equals(postGrade.getPostId(), followVO.getPostId()))
@ -296,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)));
@ -305,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()) {
@ -349,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;
}
}
}
@ -454,9 +492,55 @@ 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;
//主动打招呼总数
Integer lookResumeCountTotal=0;
//合格简历总数
Integer passResumeCountTotal=0;
//约面人数总数
Integer inviteInterviewCountTotal=0;
//初试总数
Long firstInterviewCountTotal=0L;
//终试总数
Long thirdInterviewCountTotal=0L;
//终试通过人数总数
Long salaryCountTotal=0L;
//接收offer人数总数
Integer offerCountTotal=0;
//入职人数总数
Integer entryCountTotal=0;
// filteredFollowVOList将所有字段除了deptName为null的字段设置为0
filteredFollowVOList.forEach(followVO -> {
for (FollowVO followVO:filteredFollowVOList){
if (followVO.getPostId() == null) followVO.setPostId(0L);
if (followVO.getPostName() == null) followVO.setPostName("");
if (followVO.getDeptId() == null) followVO.setDeptId(0L);
@ -471,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()))
@ -495,10 +579,34 @@ public class RecruitFollowController extends BaseController {
}else {
followVO.setAchievementRate(0d);
}
postCountTotal+=followVO.getPostCount();
lookResumeCountTotal+=followVO.getLookResumeCount();
passResumeCountTotal+=followVO.getPassResumeCount();
inviteInterviewCountTotal+=followVO.getInviteInterviewCount();
firstInterviewCountTotal+=followVO.getFirstInterviewCount();
thirdInterviewCountTotal+=followVO.getThirdInterviewCount();
salaryCountTotal+=followVO.getSalaryCount();
offerCountTotal+= followVO.getOfferCount();
entryCountTotal+=followVO.getEntryCount();
}
});
filteredFollowVOList.sort(Comparator.comparing(followVO -> Integer.parseInt(followVO.getGrade())));
//在这里添加一个合计
FollowVO followVOTotal = new FollowVO();
followVOTotal.setDeptName("总计");
followVOTotal.setPostCount(postCountTotal);
followVOTotal.setLookResumeCount(lookResumeCountTotal);
followVOTotal.setPassResumeCount(passResumeCountTotal);
followVOTotal.setInviteInterviewCount(inviteInterviewCountTotal);
followVOTotal.setFirstInterviewCount(firstInterviewCountTotal);
followVOTotal.setThirdInterviewCount(thirdInterviewCountTotal);
followVOTotal.setSalaryCount(salaryCountTotal);
followVOTotal.setOfferCount(offerCountTotal);
followVOTotal.setEntryCount(entryCountTotal);
filteredFollowVOList.add(followVOTotal);
ExcelUtil<FollowVO> util = new ExcelUtil<FollowVO>(FollowVO.class);
util.exportExcel(response,filteredFollowVOList, "任务跟踪");
}

View File

@ -39,6 +39,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@ -273,16 +274,24 @@ public class RecruitProcessController extends BaseController {
if(req.getResult().equals(ProcessResult.approved.name())){
RecruitProcessTask recruitProcessTask = recruitProcessTaskService.getByTaskId(req.getTaskId());
//新增岗位,未绑定hr
RecruitPost recruitPost = RecruitPost.builder()
.taskId(req.getTaskId())
.nodeId(recruitProcessTask.getStructurePostId())
.postName(recruitProcessTask.getPostName())
.deptId(recruitProcessTask.getDeptId())
.deptName(recruitProcessTask.getDeptName())
//默认未分配
.isAllocation(0)
.createTime(LocalDate.now())
.build();
RecruitPost recruitPost = new RecruitPost();
recruitPost.setNodeId(recruitProcessTask.getStructurePostId());
recruitPost.setTaskId(req.getTaskId());
recruitPost.setPostName(recruitProcessTask.getPostName());
recruitPost.setDeptId(recruitProcessTask.getDeptId());
recruitPost.setDeptName(recruitProcessTask.getDeptName());
recruitPost.setIsAllocation(0);
recruitPost.setCreateTime(LocalDate.now());
// RecruitPost recruitPost = RecruitPost.builder()
// .taskId(req.getTaskId())
// .nodeId(recruitProcessTask.getStructurePostId())
// .postName(recruitProcessTask.getPostName())
// .deptId(recruitProcessTask.getDeptId())
// .deptName(recruitProcessTask.getDeptName())
// //默认未分配
// .isAllocation(0)
// .createTime(LocalDate.now())
// .build();
recruitPostService.save(recruitPost);
if(recruitProcessTask.getStructurePostId()!=null){
//将该审批绑定的组织架构节点给更新成招聘中的状态
@ -372,6 +381,16 @@ public class RecruitProcessController extends BaseController {
}
@PreAuthorize("@ss.hasPermi('recruit:jd:list')")
@GetMapping("/jd/list")
@ApiOperation(value = "审批-《我已审批》分页/条件查询获取表单")
public TableDataInfo jdList(RecruitProcessTask task) {
startPage();
List<RecruitProcessTask> taskList = recruitProcessTaskService.listAllPass(task);
//把taskList的taskId变成字符串
return getDataTable(taskList);
}
@GetMapping("/pending/getHr")
@ApiOperation(value = "审批-《待我审批》查询所有的hr")
@ -397,8 +416,17 @@ public class RecruitProcessController extends BaseController {
@ApiOperation(value = "岗位公海-分页/条件查询获取表单")
public TableDataInfo postseaList(RecruitPost req) {
startPage();
//List<RecruitProcessTask> taskList = recruitProcessTaskService.listPostSea(task);
List<RecruitPost> recruitPostList= recruitPostService.listPostSea(req);
List<Long> nodeIds = recruitPostList.stream().map(RecruitPost::getNodeId).collect(Collectors.toList());
List<RecruitStructure> recruitStructureList=recruitStructureService.getNodeList(nodeIds);
Map<Long, List<RecruitStructure>> recruitStructureMap = recruitStructureList.stream().collect(Collectors.groupingBy(RecruitStructure::getNodeId));
recruitPostList.forEach(
recruitPost -> {
if(recruitStructureMap.get(recruitPost.getNodeId()).size()>0){
recruitPost.setPostType(recruitStructureMap.get(recruitPost.getNodeId()).get(0).getPostType());
}
}
);
//把taskList的taskId变成字符串
return getDataTable(recruitPostList);
}
@ -412,21 +440,25 @@ public class RecruitProcessController extends BaseController {
//查询该hr的信息
SysUser sysUser = iSysUserService.selectUserById(req.getUserId());
//更新岗位绑定该hr负责
if(req.getTaskId()!=null){
recruitProcessTaskService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getTaskId());
recruitPostService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getTaskId());
}
recruitPostService.updateBindHR(sysUser.getUserId(), sysUser.getNickName(), req.getPostId());
}else {
if(req.getTaskId()!=null){
recruitProcessTaskService.updateUnBindHR(req.getTaskId());
recruitPostService.updateUnBindHR(req.getTaskId());
}
recruitPostService.updateUnBindHR(req.getPostId());
}
return success("成功分配");
}
@PreAuthorize("@ss.hasPermi('recruit:postsea:distribution')")
@GetMapping("/mypost/getOne/{taskId}")
@GetMapping("/mypost/getOne/{postId}")
@ApiOperation(value = "岗位公海-获取某个岗位的hr分配数据")
public AjaxResult getPostList(@PathVariable("taskId")String taskId) {
return AjaxResult.success(recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getTaskId, taskId)));
public AjaxResult getPostList(@PathVariable("postId")Long postId) {
return AjaxResult.success(recruitPostService.getOne(new LambdaQueryWrapper<RecruitPost>().eq(RecruitPost::getPostId, postId)));
}
@PreAuthorize("@ss.hasPermi('recruit:mypost:list')")

View File

@ -7,6 +7,8 @@ import cn.zeroerr.common.core.domain.AjaxResult;
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
import cn.zeroerr.common.enums.BusinessType;
import cn.zeroerr.common.utils.StringUtils;
import cn.zeroerr.domain.entity.RecruitPost;
import cn.zeroerr.service.RecruitPostService;
import cn.zeroerr.system.service.RecruitStructureService;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
@ -24,6 +26,11 @@ import static cn.zeroerr.common.core.domain.AjaxResult.error;
public class RecruitStructureController extends BaseController {
@Autowired
private RecruitStructureService recruitStructureService;
@Autowired
private RecruitPostService recruitPostService;
/**
* 新增节点
*/
@ -32,12 +39,20 @@ public class RecruitStructureController extends BaseController {
@PostMapping
public AjaxResult add(@Validated @RequestBody RecruitStructure node)
{
if (!recruitStructureService.checkNodeNameUnique(node))
{
return error("新增节点'" + node.getNodeName() + "'失败,节点名称已存在");
}
node.setCreateBy(getUsername());
return toAjax(recruitStructureService.insertNode(node));
recruitStructureService.insertNode(node);
node.setNodeId(node.getNodeId());
RecruitStructure deptByNodeId = recruitStructureService.getDeptByNodeId(node.getNodeId());
//如果是已招聘状态则自动新增岗位在公海里等待被分配给具体的hr
if(node.getPostType().equals(2)){
recruitPostService.newRecruitPost(node,deptByNodeId.getNodeId(),deptByNodeId.getNodeName());
}
return AjaxResult.success();
}

View File

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@ -29,6 +30,9 @@ public class AnnouncementDTO {
@Accessors(chain = true)
@ApiModel
public static class AnnouncementInterview {
@ApiModelProperty(value = "面试-日期")
private String date;
@ApiModelProperty(value = "面试-时间 HH:ss")
private String interviewTime;
@ -50,12 +54,21 @@ public class AnnouncementDTO {
@ApiModelProperty(value = "面试-终试")
private String interviewFinalResult;
@ApiModelProperty(value = "面试-总经理预计面试时间")
private String managerTime;
@ApiModelProperty(value = "总经理参与否")
private String isAttend;
}
@Data
@Accessors(chain = true)
@ApiModel
public static class AnnouncementEntry {
@ApiModelProperty(value = "预计入职-日期")
private String date;
@ApiModelProperty(value = "预计入职-姓名")
private String entryName;

View File

@ -139,6 +139,25 @@ public class EntryManage implements Serializable {
@Excel(name = "档案", cellType = Excel.ColumnType.TEXT)
private String dossier;
/**
* 岗位等级
*/
@TableField(value = "rank")
@Excel(name = "岗位等级",dictType = "recruit_post_rank")
private String rank;
@TableField(value = "regular_date",updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "转正时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate regularDate;
@TableField(value = "termination_date",updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "离职时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDate terminationDate;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -116,6 +116,9 @@ public class PostGrade implements Serializable {
@Excel(name = "备注")
private String remark;
@TableField(exist = false)
private Integer postType;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -18,7 +18,6 @@ import lombok.Data;
*/
@TableName(value ="recruit_post")
@Data
@Builder
public class RecruitPost implements Serializable {
/**
*
@ -86,6 +85,9 @@ public class RecruitPost implements Serializable {
@TableField(value = "is_allocation")
private Integer isAllocation;
@TableField(exist = false)
private Integer postType;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -325,6 +325,47 @@ public class ResumeFollowRecord implements Serializable {
@TableField(exist = false)
private List<String> fail;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startFirstDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endFirstDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startFinalDate;
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endFinalDate;
/**
* 预计总经理参与时间
*/
@TableField(value = "manager_time",updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
@Excel(name = "预计总经理参与时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
private LocalDateTime managerTime;
/**
* 总经理是否参与
*/
@TableField(value = "is_attend")
@Excel(name = "总经理是否参与", dictType = "recruit_interview_pass")
private String isAttend;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -20,5 +20,7 @@ public class ApprovedResultVO {
private String remark;
@ApiModelProperty("hr的用户id如果需要打回则需要选择一个hr进行修改。")
private Long userId;
@ApiModelProperty("岗位公海的id非真正的岗位id")
private String postId;
}

View File

@ -0,0 +1,20 @@
package cn.zeroerr.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel
public class EntryStatisticsVO {
@ApiModelProperty(value = "预计入职人数")
List<Integer> expectEntryCounts;
@ApiModelProperty(value = "确认入职人数")
List<Integer> confirmEntryCounts;
@ApiModelProperty(value = "拒绝入职人数")
List<Integer> refuseEntryCounts;
}

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

@ -23,6 +23,10 @@ public interface EntryManageMapper extends BaseMapper<EntryManage> {
List<EntryManage> getList(@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay);
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

@ -18,11 +18,11 @@ public interface RecruitPostMapper extends BaseMapper<RecruitPost> {
List<RecruitPost> listPostSea(@Param("req") RecruitPost req);
void updateBindHR(@Param("userId") Long userId, @Param("nickName") String nickName, @Param("taskId") String taskId);
void updateBindHR(@Param("userId") Long userId, @Param("nickName") String nickName, @Param("postId") String postId);
List<RecruitPost> listMyPost(@Param("userId") Long userId);
void updateUnBindHR(@Param("taskId") String taskId);
void updateUnBindHR(@Param("postId") String postId);
}

View File

@ -44,6 +44,8 @@ public interface RecruitProcessTaskMapper extends BaseMapper<RecruitProcessTask>
void updateReapply(@Param("taskId") String taskId);
void updateUnBindHR(@Param("taskId") String taskId);
List<RecruitProcessTask> listAllPass(RecruitProcessTask task);
}

View File

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

View File

@ -1,5 +1,6 @@
package cn.zeroerr.service;
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
import cn.zeroerr.domain.entity.RecruitPost;
import com.baomidou.mybatisplus.extension.service.IService;
@ -14,9 +15,11 @@ public interface RecruitPostService extends IService<RecruitPost> {
List<RecruitPost> listPostSea(RecruitPost req);
void updateBindHR(Long userId, String nickName, String taskId);
void updateBindHR(Long userId, String nickName, String postId);
List<RecruitPost> listMyPost(Long userId);
void updateUnBindHR(String taskId);
void updateUnBindHR(String postId);
void newRecruitPost(RecruitStructure node,Long deptId,String deptName);
}

View File

@ -44,4 +44,6 @@ public interface RecruitProcessTaskService extends IService<RecruitProcessTask>
void updateReapply(String taskId);
void updateUnBindHR(String taskId);
List<RecruitProcessTask> listAllPass(RecruitProcessTask task);
}

View File

@ -33,6 +33,16 @@ public class EntryManageServiceImpl extends ServiceImpl<EntryManageMapper, Entry
public List<EntryManage> getListByWeek(LocalDate now, LocalDate plusDays) {
return this.baseMapper.getListByWeek(now,plusDays);
}
@Override
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

@ -1,11 +1,13 @@
package cn.zeroerr.service.impl;
import cn.zeroerr.common.core.domain.entity.RecruitStructure;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.zeroerr.domain.entity.RecruitPost;
import cn.zeroerr.service.RecruitPostService;
import cn.zeroerr.mapper.RecruitPostMapper;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
/**
@ -23,8 +25,8 @@ public class RecruitPostServiceImpl extends ServiceImpl<RecruitPostMapper, Recru
}
@Override
public void updateBindHR(Long userId, String nickName, String taskId) {
this.baseMapper.updateBindHR(userId,nickName,taskId);
public void updateBindHR(Long userId, String nickName, String postId) {
this.baseMapper.updateBindHR(userId,nickName,postId);
}
@Override
@ -33,8 +35,30 @@ public class RecruitPostServiceImpl extends ServiceImpl<RecruitPostMapper, Recru
}
@Override
public void updateUnBindHR(String taskId) {
this.baseMapper.updateUnBindHR(taskId);
public void updateUnBindHR(String postId) {
this.baseMapper.updateUnBindHR(postId);
}
@Override
public void newRecruitPost(RecruitStructure node,Long deptId,String deptName) {
RecruitPost recruitPost = new RecruitPost();
recruitPost.setNodeId(node.getNodeId());
recruitPost.setPostName(node.getNodeName());
recruitPost.setDeptId(deptId);
recruitPost.setDeptName(deptName);
recruitPost.setIsAllocation(0);
recruitPost.setCreateTime(LocalDate.now());
// RecruitPost recruitPost = RecruitPost.builder()
// .nodeId(node.getNodeId())
// .postName(node.getNodeName())
// .deptId(deptId)
// .deptName(deptName)
// //默认未分配
// .isAllocation(0)
// .createTime(LocalDate.now())
// .build();
this.baseMapper.insert(recruitPost);
}
}

View File

@ -146,6 +146,11 @@ public class RecruitProcessTaskServiceImpl extends ServiceImpl<RecruitProcessTas
recruitProcessTaskMapper.updateUnBindHR(taskId);
}
@Override
public List<RecruitProcessTask> listAllPass(RecruitProcessTask task) {
return recruitProcessTaskMapper.listAllPass(task);
}
/**
* 处理流程节点

View File

@ -18,8 +18,11 @@
<result property="finalPassDate" column="final_pass_date" jdbcType="DATE"/>
<result property="joinDate" column="join_date" jdbcType="DATE"/>
<result property="actualJoinDate" column="actual_join_date" jdbcType="DATE"/>
<result property="regularDate" column="regular_date" jdbcType="DATE"/>
<result property="terminationDate" column="termination_date" jdbcType="DATE"/>
<result property="entryFailReason" column="entry_fail_reason" />
<result property="isEntry" column="is_entry" />
<result property="rank" column="rank" />
</resultMap>
<sql id="Base_Column_List">
@ -27,7 +30,7 @@
post_id,post_name,
user_name,hr_id,hr_name,
final_pass_date,join_date,actual_join_date,
entry_fail_reason,is_entry,file,dossier
entry_fail_reason,is_entry,file,dossier,rank,regular_date,termination_date
</sql>
<select id="listBySelect" resultMap="BaseResultMap">
@ -64,5 +67,26 @@
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>
and is_entry =1
</select>
<select id="listByYear" parameterType="String" resultMap="BaseResultMap">
SELECT *
FROM entry_manage
WHERE join_date BETWEEN
CONCAT(#{year}, '-01-01') AND
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>

View File

@ -38,7 +38,7 @@
<update id="updateBindHR">
update recruit_post set hr_id=#{userId} ,hr_name=#{nickName} ,is_allocation=1 where task_id=#{taskId}
update recruit_post set hr_id=#{userId} ,hr_name=#{nickName} ,is_allocation=1 where post_id=#{postId}
</update>
<select id="listMyPost" resultMap="BaseResultMap">
@ -46,6 +46,6 @@
</select>
<update id="updateUnBindHR">
update recruit_post set hr_id=null ,hr_name=null,is_allocation=0 where task_id=#{taskId}
update recruit_post set hr_id=null ,hr_name=null,is_allocation=0 where post_id=#{postId}
</update>
</mapper>

View File

@ -266,4 +266,20 @@
update recruit_process_task set hr_id=null ,hr_name=null where task_id=#{taskId}
</update>
<select id="listAllPass" resultMap="BaseResultMap">
select * from recruit_process_task where status='approved'
<if test="postName != null and postName != ''">
and post_name like concat('%', #{postName}, '%')
</if>
<if test="applyDate != null">
and apply_date = #{applyDate}
</if>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="status != null">
and status = #{status}
</if>
order by apply_date desc
</select>
</mapper>

View File

@ -44,6 +44,8 @@
<result property="topping" column="topping" />
<result property="toppingTime" column="topping_time" />
<result property="file" column="file" />
<result property="isAttend" column="is_attend"/>
<result property="managerTime" column="manager_time"/>
</resultMap>
<sql id="Base_Column_List">
@ -58,7 +60,7 @@
second_reach,second_interviewer_ids,second_pass,
final_date,final_reach,final_interviewer_ids,
final_pass,accept_offer,join_date,create_date,update_date,actual_join_date,
fail_reason,special_reason,file,topping,topping_time,tags
fail_reason,special_reason,file,topping,topping_time,tags,is_attend,manager_time
</sql>
<select id="listByQuery" resultMap="BaseResultMap">
@ -74,6 +76,10 @@
<if test="req.secondPass!=null and req.secondPass!=''">and second_pass = #{req.secondPass}</if>
<if test="req.finalPass!=null and req.finalPass!=''">and final_pass = #{req.finalPass}</if>
<if test="req.isPass!=null and req.isPass!=''">and is_pass = #{req.isPass}</if>
<if test="req.startFirstDate!=null">and first_date is not null and first_date <![CDATA[>=]]> #{req.startFirstDate}</if>
<if test="req.endFirstDate!=null">and first_date is not null and first_date <![CDATA[<=]]> #{req.endFirstDate}</if>
<if test="req.startFinalDate!=null">and final_date is not null and final_date <![CDATA[>=]]> #{req.startFinalDate}</if>
<if test="req.endFinalDate!=null">and final_date is not null and final_date <![CDATA[<=]]> #{req.endFinalDate}</if>
<if test="req.id!=null">and id = #{req.id}</if>
order by
case when topping = b'1' then 0 else 1 end,

View File

@ -17,7 +17,7 @@ public interface RecruitStructureMapper extends BaseMapper<RecruitStructure> {
RecruitStructure selectNodeById(@Param("parentId") Long parentId);
int insertNode(RecruitStructure node);
Long insertNode(RecruitStructure node);
List<RecruitStructure> selectNodeList(RecruitStructure node);
@ -61,4 +61,6 @@ public interface RecruitStructureMapper extends BaseMapper<RecruitStructure> {
List<Long> filterByPostIdList(@Param("uniquePostIdList") List<Long> uniquePostIdList);
String findTopLevelDepartmentNameByNodeId(Long postId);
List<RecruitStructure> getNodeList(@Param("nodeIds")List<Long> nodeIds);
}

View File

@ -10,7 +10,7 @@ import java.util.List;
public interface RecruitStructureService extends IService<RecruitStructure> {
boolean checkNodeNameUnique(RecruitStructure node);
int insertNode(RecruitStructure node);
Long insertNode(RecruitStructure node);
List<RecruitStructure> selectNodeList(RecruitStructure node);
@ -51,4 +51,7 @@ public interface RecruitStructureService extends IService<RecruitStructure> {
List<Long> filterByPostIdList(List<Long> uniquePostIdList);
String findTopLevelDepartmentNameByNodeId(Long postId);
List<RecruitStructure> getNodeList(List<Long> nodeIds);
}

View File

@ -50,7 +50,7 @@ public class RecruitStructureServiceImpl extends ServiceImpl<RecruitStructureMap
* @return 结果
*/
@Override
public int insertNode(RecruitStructure node) {
public Long insertNode(RecruitStructure node) {
RecruitStructure info = this.baseMapper.selectNodeById(node.getParentId());
// 如果父节点不为正常状态,则不允许新增子节点
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
@ -196,6 +196,17 @@ public class RecruitStructureServiceImpl extends ServiceImpl<RecruitStructureMap
return recruitStructureMapper.findTopLevelDepartmentNameByNodeId(postId);
}
@Override
public List<RecruitStructure> getNodeList(List<Long> nodeIds) {
return recruitStructureMapper.getNodeList(nodeIds);
}
// @Override
// public List<RecruitStructure> getByNodeIds(List<Long> nodeIds) {
// return recruitStructureMapper.getByNodeIds(nodeIds);
// }
private List<TreeSelect> buildDeptTreeSelect(List<RecruitStructure> depts) {
List<RecruitStructure> deptTrees = buildDeptTree(depts);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());

View File

@ -68,7 +68,7 @@
where d.node_id = #{parentId}
</select>
<insert id="insertNode" parameterType="cn.zeroerr.common.core.domain.entity.RecruitStructure">
<insert id="insertNode" parameterType="cn.zeroerr.common.core.domain.entity.RecruitStructure" useGeneratedKeys="true" keyProperty="nodeId">
insert into recruit_structure(
<if test="nodeId != null and nodeId != 0">node_id,</if>
<if test="type != null ">type,</if>
@ -342,4 +342,13 @@
ORDER BY node_id LIMIT 1
</select>
<select id="getNodeList" resultMap="RecruitStructureResult">
select * from recruit_structure
where node_id in
<foreach collection="nodeIds" item="nodeId" open="(" separator="," close=")">
#{nodeId}
</foreach>
</select>
</mapper>