1.新增hr只能看的自己上传的简历 2.新增面试管理-置顶功能

This commit is contained in:
lw 2024-06-17 13:41:39 +08:00
parent 5805dbfb36
commit 09125338e4
7 changed files with 122 additions and 21 deletions

View File

@ -5,6 +5,7 @@ import cn.zeroerr.common.config.RuoYiConfig;
import cn.zeroerr.common.constant.Constants; import cn.zeroerr.common.constant.Constants;
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.SysRole;
import cn.zeroerr.common.core.domain.entity.SysUser; import cn.zeroerr.common.core.domain.entity.SysUser;
import cn.zeroerr.common.core.domain.model.LoginUser; import cn.zeroerr.common.core.domain.model.LoginUser;
import cn.zeroerr.common.core.page.TableDataInfo; import cn.zeroerr.common.core.page.TableDataInfo;
@ -13,6 +14,7 @@ import cn.zeroerr.common.utils.StringUtils;
import cn.zeroerr.common.utils.file.FileUploadUtils; import cn.zeroerr.common.utils.file.FileUploadUtils;
import cn.zeroerr.common.utils.file.FileUtils; import cn.zeroerr.common.utils.file.FileUtils;
import cn.zeroerr.common.utils.file.MimeTypeUtils; import cn.zeroerr.common.utils.file.MimeTypeUtils;
import cn.zeroerr.domain.dto.ToppingDTO;
import cn.zeroerr.domain.entity.PostPlanFollow; import cn.zeroerr.domain.entity.PostPlanFollow;
import cn.zeroerr.domain.entity.RecruitPost; import cn.zeroerr.domain.entity.RecruitPost;
import cn.zeroerr.domain.entity.ResumeFollowRecord; import cn.zeroerr.domain.entity.ResumeFollowRecord;
@ -36,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -79,9 +82,33 @@ public class RecruitInterviewController extends BaseController {
@ApiOperation(value = "获取《面试管理》简历跟进记录列表") @ApiOperation(value = "获取《面试管理》简历跟进记录列表")
public TableDataInfo getResumeRecordList(ResumeFollowRecord req){ public TableDataInfo getResumeRecordList(ResumeFollowRecord req){
startPage(); startPage();
//获取操作人的角色 //获取操作人的角色,如果是hr或者hr其他角色则只显示自己的信息
List<ResumeFollowRecord> resumeFollowRecordList= resumeFollowRecordService.listByQuery(req); //根据用户id获取所有的该审批人的角色ids
return getDataTable(resumeFollowRecordList); 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<ResumeFollowRecord> resumeFollowRecordListTopping= resumeFollowRecordService.listByQuery(req,true);
//找出所有非置顶的排序数据
List<ResumeFollowRecord> resumeFollowRecordListUnTopping= resumeFollowRecordService.listByQueryUnTopping(req,false);
// 将非置顶数据追加到置顶数据的列表后面
resumeFollowRecordListTopping.addAll(resumeFollowRecordListUnTopping);
// 最终的排序列表
List<ResumeFollowRecord> sortedResumeFollowRecordList = resumeFollowRecordListTopping;
return getDataTable(sortedResumeFollowRecordList);
} }
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:add')") @PreAuthorize("@ss.hasAnyPermi('recruit:interview:add')")
@ -94,11 +121,11 @@ public class RecruitInterviewController extends BaseController {
RecruitPost post = recruitPostService.getById(req.getPostId()); RecruitPost post = recruitPostService.getById(req.getPostId());
req.setPostName(post.getPostName()); req.setPostName(post.getPostName());
req.setCreateDate(LocalDate.now()); req.setCreateDate(LocalDate.now());
//默认不置顶
req.setTopping(false);
return toAjax(resumeFollowRecordService.save(req)); return toAjax(resumeFollowRecordService.save(req));
} }
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:query')") @PreAuthorize("@ss.hasAnyPermi('recruit:interview:query')")
@GetMapping("/interview/{id}") @GetMapping("/interview/{id}")
@ApiOperation(value = "获取《面试管理》简历跟进记录列表") @ApiOperation(value = "获取《面试管理》简历跟进记录列表")
@ -106,7 +133,7 @@ public class RecruitInterviewController extends BaseController {
return success(resumeFollowRecordService.getById(id)); return success(resumeFollowRecordService.getById(id));
} }
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:query')") @PreAuthorize("@ss.hasAnyPermi('recruit:interview:delete')")
@DeleteMapping("/interview/{id}") @DeleteMapping("/interview/{id}")
@ApiOperation(value = "获取《面试管理》简历跟进记录列表") @ApiOperation(value = "获取《面试管理》简历跟进记录列表")
public AjaxResult deleteResumeRecordList(@PathVariable ("id")Long id){ public AjaxResult deleteResumeRecordList(@PathVariable ("id")Long id){
@ -136,4 +163,15 @@ public class RecruitInterviewController extends BaseController {
return error("上传文件异常,请联系管理员"); return error("上传文件异常,请联系管理员");
} }
@PreAuthorize("@ss.hasAnyPermi('recruit:interview:edit')")
@PutMapping("/interview/editTopping")
@ApiOperation(value = "修改《面试管理》简历跟进记录是否置顶")
public AjaxResult editTopping(@RequestBody ToppingDTO req){
LocalDateTime localDateTime=LocalDateTime.now();
if(req.getTopping()){
return AjaxResult.success(resumeFollowRecordService.update(new LambdaUpdateWrapper<ResumeFollowRecord>().set(ResumeFollowRecord::getTopping,req.getTopping()).set(ResumeFollowRecord::getToppingTime,localDateTime).eq(ResumeFollowRecord::getId,req.getId())));
}
return AjaxResult.success(resumeFollowRecordService.update(new LambdaUpdateWrapper<ResumeFollowRecord>().set(ResumeFollowRecord::getTopping,req.getTopping()).set(ResumeFollowRecord::getToppingTime,null).set(ResumeFollowRecord::getToppingTime,localDateTime).eq(ResumeFollowRecord::getId,req.getId())));
}
} }

View File

@ -0,0 +1,18 @@
package cn.zeroerr.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
@Data
@ApiModel
public class ToppingDTO {
@ApiModelProperty(value = "简历跟进记录id")
private Long id;
@ApiModelProperty(value = "是否置顶")
private Boolean topping;
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -247,13 +248,27 @@ public class ResumeFollowRecord implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate actualJoinDate; private LocalDate actualJoinDate;
/** /**
* 上传的简历 * 上传的简历
*/ */
@TableField(value = "file") @TableField(value = "file")
private String file; private String file;
/**
* 是否置顶
*/
@TableField(value = "topping")
private Boolean topping;
/**
* 置顶时间
*/
@TableField(value = "topping_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime toppingTime;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -17,13 +17,15 @@ import java.util.List;
@Repository @Repository
public interface ResumeFollowRecordMapper extends BaseMapper<ResumeFollowRecord> { public interface ResumeFollowRecordMapper extends BaseMapper<ResumeFollowRecord> {
List<ResumeFollowRecord> listByQuery(ResumeFollowRecord req); List<ResumeFollowRecord> listByQuery(@Param("req") ResumeFollowRecord req,@Param("topping") Boolean topping);
List<ResumeFollowRecord> getBySelect(@Param("hrId") Long hrId, @Param("firstDay") LocalDate firstDay,@Param("endDay") LocalDate lastDay); List<ResumeFollowRecord> getBySelect(@Param("hrId") Long hrId, @Param("firstDay") LocalDate firstDay,@Param("endDay") LocalDate lastDay);
List<ResumeFollowRecord> getPostInterViewList(@Param("postList") List<Long> postList,@Param("firstDay") LocalDate firstDay, @Param("lastDay") LocalDate lastDay); List<ResumeFollowRecord> getPostInterViewList(@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> getPostEntryList(@Param("postList") List<Long> postList, @Param("firstDay") LocalDate firstDay, @Param("lastDay")LocalDate lastDay);
List<ResumeFollowRecord> listByQueryUnTopping(@Param("req")ResumeFollowRecord req, @Param("topping")boolean topping);
} }

View File

@ -13,11 +13,13 @@ import java.util.List;
*/ */
public interface ResumeFollowRecordService extends IService<ResumeFollowRecord> { public interface ResumeFollowRecordService extends IService<ResumeFollowRecord> {
List<ResumeFollowRecord> listByQuery(ResumeFollowRecord req); List<ResumeFollowRecord> listByQuery(ResumeFollowRecord req,Boolean topping);
List<ResumeFollowRecord> getBySelect(Long hrId, LocalDate firstDay, LocalDate lastDay); List<ResumeFollowRecord> getBySelect(Long hrId, LocalDate firstDay, LocalDate lastDay);
List<ResumeFollowRecord> getPostInterViewList(List<Long> postList, LocalDate firstDay, LocalDate lastDay); List<ResumeFollowRecord> getPostInterViewList(List<Long> postList, LocalDate firstDay, LocalDate lastDay);
List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay); List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay);
List<ResumeFollowRecord> listByQueryUnTopping(ResumeFollowRecord req, boolean topping);
} }

View File

@ -23,8 +23,8 @@ public class ResumeFollowRecordServiceImpl extends ServiceImpl<ResumeFollowRecor
private ResumeFollowRecordMapper resumeFollowRecordMapper; private ResumeFollowRecordMapper resumeFollowRecordMapper;
@Override @Override
public List<ResumeFollowRecord> listByQuery(ResumeFollowRecord req) { public List<ResumeFollowRecord> listByQuery(ResumeFollowRecord req,Boolean topping) {
return resumeFollowRecordMapper.listByQuery(req); return resumeFollowRecordMapper.listByQuery(req,topping);
} }
@Override @Override
@ -41,6 +41,12 @@ public class ResumeFollowRecordServiceImpl extends ServiceImpl<ResumeFollowRecor
public List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay) { public List<ResumeFollowRecord> getPostEntryList(List<Long> postList, LocalDate firstDay, LocalDate lastDay) {
return resumeFollowRecordMapper.getPostEntryList(postList,firstDay,lastDay); return resumeFollowRecordMapper.getPostEntryList(postList,firstDay,lastDay);
} }
@Override
public List<ResumeFollowRecord> listByQueryUnTopping(ResumeFollowRecord req, boolean topping) {
return resumeFollowRecordMapper.listByQueryUnTopping(req,topping);
}
} }

View File

@ -40,6 +40,8 @@
<result property="updateDate" column="update_date" jdbcType="DATE"/> <result property="updateDate" column="update_date" jdbcType="DATE"/>
<result property="actualJoinDate" column="actual_join_date" jdbcType="DATE"/> <result property="actualJoinDate" column="actual_join_date" jdbcType="DATE"/>
<result property="specialReason" column="special_reason" jdbcType="VARCHAR"/> <result property="specialReason" column="special_reason" jdbcType="VARCHAR"/>
<result property="topping" column="topping" />
<result property="toppingTime" column="topping_time" />
<result property="file" column="file" /> <result property="file" column="file" />
</resultMap> </resultMap>
@ -55,22 +57,23 @@
second_reach,second_interviewer_ids,second_pass, second_reach,second_interviewer_ids,second_pass,
final_date,final_reach,final_interviewer_ids, final_date,final_reach,final_interviewer_ids,
final_pass,accept_offer,join_date,create_date,update_date,actual_join_date, final_pass,accept_offer,join_date,create_date,update_date,actual_join_date,
fail_reason,special_reason,file fail_reason,special_reason,file,topping,topping_time
</sql> </sql>
<select id="listByQuery" resultMap="BaseResultMap"> <select id="listByQuery" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from resume_follow_record where name is not null from resume_follow_record where name is not null
<if test="postName!=null">and post_name like concat('%', #{postName}, '%')</if> <if test="topping!=null">and topping =#{topping}</if>
<if test="name!=null">and name like concat('%', #{name}, '%')</if> <if test="req.postName!=null">and post_name like concat('%', #{req.postName}, '%')</if>
<if test="interviewDate!=null">and interview_date =#{interviewDate}</if> <if test="req.name!=null">and name like concat('%', #{req.name}, '%')</if>
<if test="hrId!=null">and hr_id =#{hrId}</if> <if test="req.interviewDate!=null">and interview_date =#{req.interviewDate}</if>
<if test="firstPass!=null and firstPass!=''">and first_pass=#{firstPass}</if> <if test="req.hrId!=null">and hr_id =#{req.hrId}</if>
<if test="secondPass!=null and secondPass!=''">and second_pass =#{secondPass}</if> <if test="req.firstPass!=null and req.firstPass!=''">and first_pass=#{req.firstPass}</if>
<if test="finalPass!=null and finalPass!=''">and final_pass=#{finalPass}</if> <if test="req.secondPass!=null and req.secondPass!=''">and second_pass =#{req.secondPass}</if>
<if test="isPass!=null and isPass!=''">and is_pass=#{isPass}</if> <if test="req.finalPass!=null and req.finalPass!=''">and final_pass=#{req.finalPass}</if>
order by receive_date desc <if test="req.isPass!=null and req.isPass!=''">and is_pass=#{req.isPass}</if>
order by topping_time desc
</select> </select>
<select id="getBySelect" resultMap="BaseResultMap"> <select id="getBySelect" resultMap="BaseResultMap">
@ -107,4 +110,21 @@
#{postId} #{postId}
</foreach> </foreach>
</select> </select>
<select id="listByQueryUnTopping" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from resume_follow_record where name is not null
<if test="topping!=null">and topping =#{topping}</if>
<if test="req.postName!=null">and post_name like concat('%', #{req.postName}, '%')</if>
<if test="req.name!=null">and name like concat('%', #{req.name}, '%')</if>
<if test="req.interviewDate!=null">and interview_date =#{req.interviewDate}</if>
<if test="req.hrId!=null">and hr_id =#{req.hrId}</if>
<if test="req.firstPass!=null and req.firstPass!=''">and first_pass=#{req.firstPass}</if>
<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>
order by receive_date desc
</select>
</mapper> </mapper>