【HR专用】Vue+SpringBoot,实现人才招聘库的开发(后端部分)

人才招聘库是企业用于储存和管理潜在候选人信息的数据库。通常情况下,这些候选人可能已经应聘过公司的职位,也可能是通过其他途径获取的,例如社交网络、招聘网站等。

对于一个中小公司来说,人力资源部绝对是一个重要部门,有着举足轻重的作用。

人才招聘库可以帮助企业更好地利用和管理人力资源,在公司需要新员工时,能够及时查找并联系到合适的候选人。此外,人才招聘库还能够提高企业对人才储备的掌握程度,有助于发现和培养优秀的人才,并提高企业的竞争力。人才招聘库通常包含候选人的基本信息、教育背景、工作经历、技能证书以及推荐信等资料,这些信息都可以帮助企业更全面地了解候选人的能力和素质。

对于人力资源部来说,如果靠纸质或Excel来维护人才档案,效率低下,所以功能完整的人才招聘库模块,还是非常重要的,本文旨在完成人才招聘库的设计和实现。

在这里插入图片描述

目录

  • 一、实体类(entity)设计
  • 二、数据链路层(Mapper)设计
  • 二、服务层(Service)设计
  • 三、控制器层(Controller)设计
    • 3.1 人才类型管理接口
      • 3.1.1 查询人才类型
      • 3.1.2 新增人才类型
      • 3.1.3 编辑人才类型
      • 3.1.4 删除人才类型
    • 3.2 人才库标签接口
      • 3.2.1 查询人才库标签
      • 3.2.2 新增人才库标签
      • 3.2.3 编辑人才库标签
      • 3.2.4 删除人才库标签
    • 3.3 人才库档案接口
      • 3.3.1 查询人才
      • 3.3.2 新增人才
      • 3.3.3 编辑人才
      • 3.3.4 删除人才
    • 3.4 面试记录接口
      • 3.4.1 新增面试记录
      • 3.4.2 编辑面试记录
      • 3.4.3 删除面试记录
    • 3.5 沟通记录接口
      • 3.5.1 新增沟通记录
      • 3.5.2 编辑沟通记录
      • 3.5.3 删除沟通记录
    • 3.6 简历接口
      • 3.6.1 新增简历
      • 3.6.2 编辑简历
      • 3.6.3 删除简历
  • 四、总结


一、实体类(entity)设计

实体类是面向对象编程中的一个重要概念,用于描述现实世界中的实体或概念,并将其抽象为程序中的一个类。在设计实体类时,需要考虑实体之间的关系以及它们的属性和行为。

在设计功能模块之前,首先要对实体进行设计,本文设计的实体有以下几个。

  • 人才库档案(a_talent_pool)
  • 人才库标签关系(a_talent_pool_and_label)
  • 人才类型关系表(a_talent_pool_and_type)
  • 人才面试记录(a_talent_pool_interview_record)
  • 人才库标签(a_talent_pool_label)
  • 人才简历(a_talent_pool_resume)
  • 人才沟通记录(a_talent_pool_say_record)
  • 人才类型(a_talent_pool_type)

实体类设计代码如下。

@Table(name = "a_talent_pool")
@TableName("a_talent_pool")
@ApiModel(value = "人才库档案")
public class TalentPool extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "人才姓名")
    private String userName;

    @ApiModelProperty(value = "人才性别")
    private String userSex;

    @ApiModelProperty(value = "人才手机号")
    private String userMobile;

    @ApiModelProperty(value = "人才意向")
    private String userMean;

    @ApiModelProperty(value = "人才优势")
    private String advantage;

    @ApiModelProperty(value = "人才状态")
    private String status;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "应聘岗位ID")
    private String postOffer;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "应聘岗位名称")
    private String postTitle;

    @ApiModelProperty(value = "备注")
    private String remark;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "人才标签")
    private List<TalentPoolLabel> labelList;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "沟通记录")
    private List<TalentPoolSayRecord> sayList;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "面试记录")
    private List<TalentPoolInterviewRecord> interviewList;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "简历档案")
    private List<TalentPoolResume> resumeList;
}
@Table(name = "a_talent_pool_and_label")
@TableName("a_talent_pool_and_label")
@ApiModel(value = "人才库标签关系")
public class TalentPoolAndLabel extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标签ID")
    private String labelId;

    @ApiModelProperty(value = "人才Id")
    private String talentId;
}
@Table(name = "a_talent_pool_and_type")
@TableName("a_talent_pool_and_type")
@ApiModel(value = "人才类型关系表")
public class TalentPoolAndType extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "类型ID")
    private String typeId;

    @ApiModelProperty(value = "人才Id")
    private String talentId;
}
@Table(name = "a_talent_pool_interview_record")
@TableName("a_talent_pool_interview_record")
@ApiModel(value = "人才面试记录")
public class TalentPoolInterviewRecord extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "人才Id")
    private String talentId;

    @ApiModelProperty(value = "面试日期")
    private String interviewDate;

    @ApiModelProperty(value = "入职意向")
    private String inMean;

    @ApiModelProperty(value = "面试评价")
    private String interviewAns;

    @ApiModelProperty(value = "备注")
    private String remark;
}
@Table(name = "a_talent_pool_label")
@TableName("a_talent_pool_label")
@ApiModel(value = "人才库标签")
public class TalentPoolLabel extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "名称")
    private String title;

    @ApiModelProperty(value = "分类")
    private String type;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty(value = "排序值")
    private BigDecimal sortOrder;
}
@Table(name = "a_talent_pool_resume")
@TableName("a_talent_pool_resume")
@ApiModel(value = "人才简历")
public class TalentPoolResume extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "人才Id")
    private String talentId;

    @ApiModelProperty(value = "查收日期")
    private String date;

    @ApiModelProperty(value = "简历文件")
    private String url;

    @ApiModelProperty(value = "备注")
    private String remark;
}
@Table(name = "a_talent_pool_say_record")
@TableName("a_talent_pool_say_record")
@ApiModel(value = "人才沟通记录")
public class TalentPoolSayRecord extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "人才Id")
    private String talentId;

    @ApiModelProperty(value = "沟通日期")
    private String sayDate;

    @ApiModelProperty(value = "沟通内容")
    private String sayContent;

    @ApiModelProperty(value = "沟通反馈")
    private String sayAns;

    @ApiModelProperty(value = "备注")
    private String remark;
}
@Table(name = "a_talent_pool_type")
@TableName("a_talent_pool_type")
@ApiModel(value = "人才类型")
public class TalentPoolType extends ZwzBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "是否展开直子节点")
    private boolean expand = true;

    @ApiModelProperty(value = "禁用")
    private boolean disabled = false;

    @ApiModelProperty(value = "是否选中")
    private boolean selected = false;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "子类型")
    private List<TalentPoolType> children = new ArrayList<>();

    @ApiModelProperty(value = "排序值")
    @Column(precision = 10, scale = 2)
    private BigDecimal sortOrder = BigDecimal.TEN;

    @ApiModelProperty(value = "父id")
    private String parentId;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "父类型名称")
    private String parentTitle;
}

二、数据链路层(Mapper)设计

在Java MVC模式中,Mapper层是指用于持久化数据的一层,通常负责与数据库交互,以及将数据库中的数据转换为应用程序中的对象。具体来说,Mapper层通常包括以下几个部分:

  • 数据库连接:Mapper层需要与数据库进行交互,因此需要建立数据库连接。通常来说,这可以通过JDBC或ORM框架来实现。

  • 数据映射:Mapper层需要将数据库中的数据映射到Java对象中。通常来说,这可以通过ORM框架如Hibernate、MyBatis等来完成。

  • 数据访问:Mapper层需要提供对数据库的读写操作,包括增删改查等基本操作。通常来说,这可以通过使用SQL语句或ORM框架提供的API来实现。

  • 事务管理:Mapper层需要处理数据库事务,保证数据的完整性和一致性。通常来说,这可以通过使用JDBC的事务机制或者ORM框架提供的事务管理器来实现。

总之,Mapper层在Java MVC模式中起着很重要的作用,它负责将数据库和应用程序之间的数据交互进行封装,并提供了一些有价值的功能,例如数据访问、数据映射和事务管理等,大大简化了应用程序开发人员的工作,同时也提高了应用程序的可维护性和扩展性。

人才招聘库的数据链路层接口,只需要继承 MybatisPlusBaseMapper 类即可,设计代码如下。

/**
 * 人才库标签关系数据处理层
 * @author 郑为中
 */
public interface TalentPoolAndLabelMapper extends BaseMapper<TalentPoolAndLabel> {

}
/**
 * 人才类型关系表数据处理层
 * @author 郑为中
 */
public interface TalentPoolAndTypeMapper extends BaseMapper<TalentPoolAndType> {

}
/**
 * 人才面试记录数据处理层
 * @author 郑为中
 */
public interface TalentPoolInterviewRecordMapper extends BaseMapper<TalentPoolInterviewRecord> {

}
/**
 * 人才库标签数据处理层
 * @author 郑为中
 */
public interface TalentPoolLabelMapper extends BaseMapper<TalentPoolLabel> {

}
/**
 * 人才库档案数据处理层
 * @author 郑为中
 */
public interface TalentPoolMapper extends BaseMapper<TalentPool> {

}
/**
 * 人才简历数据处理层
 * @author 郑为中
 */
public interface TalentPoolResumeMapper extends BaseMapper<TalentPoolResume> {

}
/**
 * 人才沟通记录数据处理层
 * @author 郑为中
 */
public interface TalentPoolSayRecordMapper extends BaseMapper<TalentPoolSayRecord> {

}
/**
 * 人才类型数据处理层
 * @author 郑为中
 */
public interface TalentPoolTypeMapper extends BaseMapper<TalentPoolType> {

}

二、服务层(Service)设计

在Java MVC模式中,Service层通常负责处理业务逻辑和数据处理。具体来说,Service层通常包括以下几个部分:

  • 业务逻辑:Service层负责实现应用程序的业务逻辑,例如验证用户输入、处理表单数据、生成报告等。

  • 数据处理:Service层负责将数据库操作从Controller层中分离出来,包括查询、更新、删除和插入数据等操作。

  • 事务管理:Service层需要保证事务的完整性和一致性,并且需要提供回滚和提交事务的功能。

  • 异常处理:Service层需要处理可能发生的异常,例如数据库连接错误、数据访问异常等。

总之,Service层在Java MVC模式中承担着很重要的角色,它负责处理业务逻辑和数据处理,可以有效地将Controller层与DAO层分离开来,使代码更加清晰和易于维护。此外,Service层还可以通过统一的接口为多个Controller层提供服务,大大简化了应用程序的设计和开发过程。

人才招聘库的服务层接口,只需要继承 MybatisPlusIService 类即可。

人才招聘库的服务层接口实现,只需要继承 MybatisPlusServiceImpl 类,实现对应的服务层接口即可,设计代码如下。

  • 人才库标签关系接口
public interface ITalentPoolAndLabelService extends IService<TalentPoolAndLabel> {

}
  • 人才库标签关系接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolAndLabelServiceImpl extends ServiceImpl<TalentPoolAndLabelMapper, TalentPoolAndLabel> implements ITalentPoolAndLabelService {

    @Autowired
    private TalentPoolAndLabelMapper talentPoolAndLabelMapper;
}
  • 人才类型关系接口
public interface ITalentPoolAndTypeService extends IService<TalentPoolAndType> {

}
  • 人才类型关系接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolAndTypeServiceImpl extends ServiceImpl<TalentPoolAndTypeMapper, TalentPoolAndType> implements ITalentPoolAndTypeService {

    @Autowired
    private TalentPoolAndTypeMapper talentPoolAndTypeMapper;
}
  • 人才面试记录接口
public interface ITalentPoolInterviewRecordService extends IService<TalentPoolInterviewRecord> {

}
  • 人才面试记录接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolInterviewRecordServiceImpl extends ServiceImpl<TalentPoolInterviewRecordMapper, TalentPoolInterviewRecord> implements ITalentPoolInterviewRecordService {

    @Autowired
    private TalentPoolInterviewRecordMapper talentPoolInterviewRecordMapper;
}
  • 人才库标签接口
public interface ITalentPoolLabelService extends IService<TalentPoolLabel> {

}
  • 人才库标签接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolLabelServiceImpl extends ServiceImpl<TalentPoolLabelMapper, TalentPoolLabel> implements ITalentPoolLabelService {

    @Autowired
    private TalentPoolLabelMapper talentPoolLabelMapper;
}
  • 人才简历接口
/**
 * 人才简历接口
 * @author 郑为中
 */
public interface ITalentPoolResumeService extends IService<TalentPoolResume> {

}
  • 人才简历接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolResumeServiceImpl extends ServiceImpl<TalentPoolResumeMapper, TalentPoolResume> implements ITalentPoolResumeService {

    @Autowired
    private TalentPoolResumeMapper talentPoolResumeMapper;
}
  • 人才沟通记录接口
public interface ITalentPoolSayRecordService extends IService<TalentPoolSayRecord> {

}
  • 人才沟通记录接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolSayRecordServiceImpl extends ServiceImpl<TalentPoolSayRecordMapper, TalentPoolSayRecord> implements ITalentPoolSayRecordService {

    @Autowired
    private TalentPoolSayRecordMapper talentPoolSayRecordMapper;
}
  • 人才库档案接口
public interface ITalentPoolService extends IService<TalentPool> {

}
  • 人才库档案接口
@Slf4j
@Service
@Transactional
public class ITalentPoolServiceImpl extends ServiceImpl<TalentPoolMapper, TalentPool> implements ITalentPoolService {

    @Autowired
    private TalentPoolMapper talentPoolMapper;
}
  • 人才类型接口
public interface ITalentPoolTypeService extends IService<TalentPoolType> {

}
  • 人才类型接口实现
@Slf4j
@Service
@Transactional
public class ITalentPoolTypeServiceImpl extends ServiceImpl<TalentPoolTypeMapper, TalentPoolType> implements ITalentPoolTypeService {

    @Autowired
    private TalentPoolTypeMapper talentPoolTypeMapper;
}

三、控制器层(Controller)设计

在Java MVC模式中,Controller层是指用于接收用户请求并处理请求的一层。Controller层通常负责业务流程控制和调度,将用户请求传递给Service层完成相关业务逻辑处理,并将结果返回给前端视图(View)层进行展示,具体来说,Controller层通常包括以下几个部分:

  • URL路由:Controller层需要根据不同的URL路由来匹配对应的请求处理方法。

  • 请求参数解析:Controller层需要解析HTTP请求中的参数,并进行校验和验证。

  • 业务逻辑处理:Controller层需要将请求转发给Service层进行业务逻辑处理,并获取处理结果。

  • 视图渲染:Controller层需要将处理结果传递给View层进行渲染和展示。

总之,Controller层在Java MVC模式中起着很重要的作用,它负责接收用户请求、处理请求、调度业务逻辑和协调其他层之间的交互,大大简化了应用程序开发人员的工作,同时也提高了应用程序的可维护性和扩展性。

人才招聘库的控制器层接口,需要自行编写业务相关的接口,给前端提供数据支持。

3.1 人才类型管理接口

人才类型控制器用于提供人才类型的一级新增、子节点新增、编辑、删除接口。

因为人才类型用到了树形结构,需要用到深搜(dfs)算法进行查询回显。

在这里插入图片描述

首先创建 TalentPoolTypeController 类,注入 ITalentPoolTypeService 服务,代码如下。

@RestController
@Api(tags = "人才类型接口")
@RequestMapping("/zwz/talentPoolType")
@Transactional
public class TalentPoolTypeController {

    @Autowired
    private ITalentPoolTypeService iTalentPoolTypeService;
}

3.1.1 查询人才类型

在设计人才类似的实体时,我们设计了 parentId 字段。

@ApiModelProperty(value = "父id")
private String parentId;

只需要指定一级标题的 parentId0,其余节点的 parentId 是父节点的 id

设计深搜方法 dfsFindTalentPoolTypeChildren

@ApiOperation(value = "深搜查询人才库类型")
private void dfsFindTalentPoolTypeChildren(List<TalentPoolType> allList,TalentPoolType talentPoolType) {
    boolean flag = false;
    for (TalentPoolType type : allList) {
        if(Objects.equals(talentPoolType.getId(),type.getParentId())) {
            type.setParentTitle(talentPoolType.getTitle());
            talentPoolType.getChildren().add(type);
            flag = true;
        }
    }
    if(flag) {
        for (TalentPoolType child : talentPoolType.getChildren()) {
            dfsFindTalentPoolTypeChildren(allList,child);
        }
    }
}

接着编写查询人才类型的 getAll 方法。

@RequestMapping(value = "/getAll", method = RequestMethod.GET)
@ApiOperation(value = "查询人才库类型")
public Result<List<TalentPoolType>> getAll(){
    QueryWrapper<TalentPoolType> qw = new QueryWrapper<>();
    qw.eq("parent_id","0");
    qw.orderByAsc("sort_order");
    List<TalentPoolType> oneList = iTalentPoolTypeService.list(qw);
    List<TalentPoolType> allList = iTalentPoolTypeService.list();
    for (TalentPoolType type : oneList) {
        type.setParentTitle("顶级类型");
        dfsFindTalentPoolTypeChildren(allList,type);
    }
    return new ResultUtil<List<TalentPoolType>>().setData(oneList);
}

3.1.2 新增人才类型

对于新增人才类型的业务,前端传来父节点 id、类型名称和排序值,即可完成新增操作,代码如下。

在这里插入图片描述

@RequestMapping(value = "/insertType", method = RequestMethod.POST)
@ApiOperation(value = "新增类型")
public Result<TalentPoolType> insert(@RequestParam String id,@RequestParam String title,@RequestParam(required = false,defaultValue = "10") float sortOrder){
    if(!Objects.equals("0",id)) {
        TalentPoolType type = iTalentPoolTypeService.getById(id);
        if(type == null) {
            return ResultUtil.error("上级类型已被删除");
        }
    }
    TalentPoolType talentPoolType = new TalentPoolType();
    talentPoolType.setTitle(title);
    talentPoolType.setParentId(id);
    talentPoolType.setSortOrder(BigDecimal.valueOf(sortOrder));
    iTalentPoolTypeService.saveOrUpdate(talentPoolType);
    return ResultUtil.success();
}

3.1.3 编辑人才类型

对于编辑人才类型的业务,前端传来类型 id、父节点 id、类型名称和排序值,即可完成编辑操作,代码如下。

在这里插入图片描述

@RequestMapping(value = "/editType", method = RequestMethod.POST)
@ApiOperation(value = "编辑类型")
public Result<TalentPoolType> editType(@RequestParam String id,@RequestParam String title,@RequestParam String parentId,@RequestParam float sortOrder){
    if(!Objects.equals("0",id)) {
        TalentPoolType type = iTalentPoolTypeService.getById(parentId);
        if(type == null) {
            return ResultUtil.error("上级类型已被删除");
        }
    }
    if(Objects.equals(id,parentId)) {
        return ResultUtil.error("自己不能是自己的父节点");
    }
    TalentPoolType talentPoolType = iTalentPoolTypeService.getById(id);
    if(talentPoolType == null) {
        return ResultUtil.error("类型已被删除");
    }
    talentPoolType.setTitle(title);
    talentPoolType.setParentId(parentId);
    talentPoolType.setSortOrder(BigDecimal.valueOf(sortOrder));
    iTalentPoolTypeService.saveOrUpdate(talentPoolType);
    return ResultUtil.success();
}

3.1.4 删除人才类型

对于删除人才类型的业务,前端传来类型 id,即可调用 removeById 方法完成删除操作,代码如下。

在这里插入图片描述

@RequestMapping(value = "/deleteType", method = RequestMethod.POST)
@ApiOperation(value = "删除类型")
public Result<Object> deleteType(@RequestParam String id){
    iTalentPoolTypeService.removeById(id);
    return ResultUtil.success();
}

3.2 人才库标签接口

人才库标签是用于对个人简历或职位信息进行分类和标记的关键词或短语。通过给人才库中的信息打上标签,可以方便地进行分类、筛选和搜索,提高招聘效率和准确性。
人才类型控制器用于提供人才类型的一级新增、子节点新增、编辑、删除接口。

在这里插入图片描述

首先创建 TalentPoolLabelController 类,注入 ITalentPoolLabelService 服务,代码如下。

@RestController
@Api(tags = "人才库标签接口")
@RequestMapping("/zwz/talentPoolLabel")
@Transactional
public class TalentPoolLabelController {

    @Autowired
    private ITalentPoolLabelService iTalentPoolLabelService;
}

3.2.1 查询人才库标签

查询人才库标签的核心代码如下。

@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询人才库标签")
public Result<IPage<TalentPoolLabel>> getByPage(@ModelAttribute TalentPoolLabel label,@ModelAttribute PageVo page) {
    QueryWrapper<TalentPoolLabel> qw = new QueryWrapper<>();
    if(!ZwzNullUtils.isNull(label.getTitle())) {
        qw.like("title",label.getTitle());
    }
    if(!ZwzNullUtils.isNull(label.getType())) {
        qw.eq("type",label.getType());
    }
    IPage<TalentPoolLabel> data = iTalentPoolLabelService.page(PageUtil.initMpPage(page),qw);
    return new ResultUtil<IPage<TalentPoolLabel>>().setData(data);
}

3.2.2 新增人才库标签

新增人才库标签的核心代码如下。

在这里插入图片描述

@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "新增人才库标签")
public Result<TalentPoolLabel> insert(TalentPoolLabel talentPoolLabel){
    iTalentPoolLabelService.saveOrUpdate(talentPoolLabel);
    return ResultUtil.success();
}

3.2.3 编辑人才库标签

编辑人才库标签的核心代码如下。

在这里插入图片描述

@RequestMapping(value = "/update", method = RequestMethod.POST)
@ApiOperation(value = "编辑人才库标签")
public Result<TalentPoolLabel> update(TalentPoolLabel talentPoolLabel){
    if(iTalentPoolLabelService.saveOrUpdate(talentPoolLabel)){
        return ResultUtil.success();
    }
    return ResultUtil.error();
}

3.2.4 删除人才库标签

删除人才库标签的核心代码如下。

在这里插入图片描述

@RequestMapping(value = "/delByIds", method = RequestMethod.POST)
@ApiOperation(value = "删除人才库标签")
public Result<Object> delByIds(@RequestParam String[] ids){
    for(String id : ids){
        iTalentPoolLabelService.removeById(id);
    }
    return ResultUtil.success();
}

3.3 人才库档案接口

人才库是企业用于储存和管理潜在候选人信息的数据库,也称为人才储备库或简历库。通常情况下,这些候选人可能已经应聘过公司的职位。

首先创建 TalentPoolController 类,注入相关服务,代码如下。

@Slf4j
@RestController
@Api(tags = "人才库档案管理接口")
@RequestMapping("/zwz/talentPool")
@Transactional
public class TalentPoolController {
    @Autowired
    private ITalentPoolService iTalentPoolService;

    @Autowired
    private ITalentPoolAndLabelService iTalentPoolAndLabelService;

    @Autowired
    private ITalentPoolInterviewRecordService iTalentPoolInterviewRecordService;

    @Autowired
    private ITalentPoolLabelService iTalentPoolLabelService;

    @Autowired
    private ITalentPoolResumeService iTalentPoolResumeService;

    @Autowired
    private ITalentPoolSayRecordService iTalentPoolSayRecordService;

    @Autowired
    private IZwzRosterUserService iZwzRosterUserService;

    @Autowired
    private ITalentPoolAndTypeService iTalentPoolAndTypeService;

    @Autowired
    private ITalentPoolTypeService iTalentPoolTypeService;
}

3.3.1 查询人才

查询人才库的代码如下,需要在查询时带出岗位、面试记录、沟通记录、简历档案和标签信息。

@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "查询人才库")
public Result<IPage<TalentPool>> getByPage(@ModelAttribute TalentPool talentPool,@ModelAttribute PageVo page) {
    QueryWrapper<TalentPool> qw = new QueryWrapper<>();
    if(!ZwzNullUtils.isNull(talentPool.getUserName())) {
        qw.like("user_name",talentPool.getUserName());
    }
    if(!ZwzNullUtils.isNull(talentPool.getUserMean())) {
        qw.eq("user_mean",talentPool.getUserMean());
    }
    if(!ZwzNullUtils.isNull(talentPool.getStatus())) {
        qw.eq("status",talentPool.getStatus());
    }
    if(!ZwzNullUtils.isNull(talentPool.getUserSex())) {
        qw.eq("user_sex",talentPool.getUserSex());
    }
    if(!ZwzNullUtils.isNull(talentPool.getPostOffer())) {
        qw.inSql("id","SELECT id FROM t_talent_pool WHERE id IN(SELECT DISTINCT talent_id FROM t_talent_pool_and_type WHERE type_id IN (" + changePostOfferSplitToStr(talentPool.getPostOffer()) + "))");
    }
    IPage<TalentPool> data = iTalentPoolService.page(PageUtil.initMpPage(page),qw);
    List<TalentPoolLabel> labelList = iTalentPoolLabelService.list();
    for (TalentPool tp : data.getRecords()) {
        /**
         * 查询岗位
         */
        ZwzPair zwzPair = getTypeTitleByTalentId(tp.getId());
        tp.setPostOffer(zwzPair.getTitle());
        tp.setPostTitle(zwzPair.getValue());
        /**
         * 面试记录
         */
        QueryWrapper<TalentPoolInterviewRecord> intQw = new QueryWrapper<>();
        intQw.eq("talent_id",tp.getId());
        tp.setInterviewList(iTalentPoolInterviewRecordService.list(intQw));
        /**
         * 沟通记录
         */
        QueryWrapper<TalentPoolSayRecord> sayQw = new QueryWrapper<>();
        sayQw.eq("talent_id",tp.getId());
        tp.setSayList(iTalentPoolSayRecordService.list(sayQw));
        /**
         * 简历档案
         */
        QueryWrapper<TalentPoolResume> resQw = new QueryWrapper<>();
        resQw.eq("talent_id",tp.getId());
        tp.setResumeList(iTalentPoolResumeService.list(resQw));
        /**
         * 标签
         */
        QueryWrapper<TalentPoolAndLabel> labelQw = new QueryWrapper<>();
        labelQw.eq("talent_id",tp.getId());
        tp.setLabelList(getTalentInLabelList(labelList,iTalentPoolAndLabelService.list(labelQw)));
    }
    return new ResultUtil<IPage<TalentPool>>().setData(data);
}

3.3.2 新增人才

新增人才的核心代码如下。

在这里插入图片描述

@RequestMapping(value = "/insert", method = RequestMethod.POST)
@ApiOperation(value = "新增人才")
public Result<TalentPool> insert(TalentPool talentPool) {
    String postOffer = talentPool.getPostOffer();
    if(postOffer == null) {
        return ResultUtil.error("应聘岗位不能为空");
    }
    iTalentPoolService.saveOrUpdate(talentPool);
    /**
     * 新增现有岗位
     */
    String[] offerList = postOffer.split(",");
    for (String offer : offerList) {
        TalentPoolType type = iTalentPoolTypeService.getById(offer);
        if(type != null) {
            TalentPoolAndType tpat = new TalentPoolAndType();
            tpat.setTalentId(talentPool.getId());
            tpat.setTypeId(type.getId());
            iTalentPoolAndTypeService.saveOrUpdate(tpat);
        }
    }
    return ResultUtil.success();
}

3.3.3 编辑人才

编辑人才的核心代码如下。

在这里插入图片描述

@RequestMapping(value = "/update", method = RequestMethod.POST)
@ApiOperation(value = "编辑人才")
public Result<TalentPool> update(TalentPool talentPool) {
    String postOffer = talentPool.getPostOffer();
    if(postOffer == null) {
        return ResultUtil.error("应聘岗位不能为空");
    }
    iTalentPoolService.saveOrUpdate(talentPool);
    /**
     * 删除原有岗位
     */
    QueryWrapper<TalentPoolAndType> qw = new QueryWrapper<>();
    qw.eq("talent_id",talentPool.getId());
    iTalentPoolAndTypeService.remove(qw);
    /**
     * 新增现有岗位
     */
    String[] offerList = postOffer.split(",");
    for (String offer : offerList) {
        TalentPoolType type = iTalentPoolTypeService.getById(offer);
        if(type != null) {
            TalentPoolAndType tpat = new TalentPoolAndType();
            tpat.setTalentId(talentPool.getId());
            tpat.setTypeId(type.getId());
            iTalentPoolAndTypeService.saveOrUpdate(tpat);
        }
    }
    return ResultUtil.success();
}

3.3.4 删除人才

删除人才的核心代码如下。

@RequestMapping(value = "/delByIds", method = RequestMethod.POST)
@ApiOperation(value = "删除人才")
public Result<Object> delByIds(@RequestParam String[] ids){
    for(String id : ids){
        iTalentPoolService.removeById(id);
    }
    return ResultUtil.success();
}

3.4 面试记录接口

人才库是企业用于储存和管理潜在候选人信息的数据库,也称为人才储备库或简历库。通常情况下,这些候选人可能已经应聘过公司的职位。

面试记录相关接口也在 TalentPoolController 类中编写。

在这里插入图片描述

3.4.1 新增面试记录

新增面试记录的核心代码如下。

@RequestMapping(value = "/addInterview", method = RequestMethod.POST)
@ApiOperation(value = "新增面试记录")
public Result<Object> addInterview(@RequestParam String id,@RequestParam String interviewDate,@RequestParam String inMean,@RequestParam String interviewAns,@RequestParam String remark) {
    TalentPoolInterviewRecord record = new TalentPoolInterviewRecord();
    record.setTalentId(id);
    record.setInterviewDate(interviewDate);
    record.setInMean(inMean);
    record.setInterviewAns(interviewAns);
    record.setRemark(remark);
    iTalentPoolInterviewRecordService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.4.2 编辑面试记录

编辑面试记录的核心代码如下。

@RequestMapping(value = "/editInterview", method = RequestMethod.POST)
@ApiOperation(value = "编辑面试记录")
public Result<Object> editInterview(@RequestParam String id,@RequestParam String interviewDate,@RequestParam String inMean,@RequestParam String interviewAns,@RequestParam String remark) {
    TalentPoolInterviewRecord record = iTalentPoolInterviewRecordService.getById(id);
    if(record == null) {
        return ResultUtil.error("面试记录已被删除");
    }
    record.setInterviewDate(interviewDate);
    record.setInMean(inMean);
    record.setInterviewAns(interviewAns);
    record.setRemark(remark);
    iTalentPoolInterviewRecordService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.4.3 删除面试记录

@RequestMapping(value = "/deleteInterview", method = RequestMethod.POST)
@ApiOperation(value = "删除面试记录")
public Result<Object> deleteInterview(@RequestParam String id) {
    iTalentPoolInterviewRecordService.removeById(id);
    return ResultUtil.success();
}

3.5 沟通记录接口

3.5.1 新增沟通记录

新增沟通记录的核心代码如下。

@RequestMapping(value = "/addSay", method = RequestMethod.POST)
@ApiOperation(value = "新增沟通记录")
public Result<Object> addSay(@RequestParam String id,@RequestParam String sayDate,@RequestParam String sayContent,@RequestParam String sayAns,@RequestParam String remark) {
    TalentPoolSayRecord record = new TalentPoolSayRecord();
    record.setTalentId(id);
    record.setSayDate(sayDate);
    record.setSayContent(sayContent);
    record.setSayAns(sayAns);
    record.setRemark(remark);
    iTalentPoolSayRecordService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.5.2 编辑沟通记录

编辑沟通记录的核心代码如下。

@RequestMapping(value = "/editSay", method = RequestMethod.POST)
@ApiOperation(value = "编辑沟通记录")
public Result<Object> editSay(@RequestParam String id,@RequestParam String sayDate,@RequestParam String sayContent,@RequestParam String sayAns,@RequestParam String remark) {
    TalentPoolSayRecord record = iTalentPoolSayRecordService.getById(id);
    if(record == null) {
        return ResultUtil.error("面试记录已被删除");
    }
    record.setSayDate(sayDate);
    record.setSayContent(sayContent);
    record.setSayAns(sayAns);
    record.setRemark(remark);
    iTalentPoolSayRecordService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.5.3 删除沟通记录

删除沟通记录的核心代码如下。

@RequestMapping(value = "/deleteSay", method = RequestMethod.POST)
@ApiOperation(value = "删除沟通记录")
public Result<Object> deleteSay(@RequestParam String id) {
    iTalentPoolSayRecordService.removeById(id);
    return ResultUtil.success();
}

3.6 简历接口

3.6.1 新增简历

新增简历的核心代码如下,传入 id、日期、简历文件、备注数据,即可实现新增操作。

@RequestMapping(value = "/addResume", method = RequestMethod.POST)
@ApiOperation(value = "新增简历")
public Result<Object> addResume(@RequestParam String id,@RequestParam String date,@RequestParam String url,@RequestParam String remark) {
    TalentPoolResume record = new TalentPoolResume();
    record.setTalentId(id);
    record.setDate(date);
    record.setUrl(url);
    record.setRemark(remark);
    iTalentPoolResumeService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.6.2 编辑简历

编辑简历的核心代码如下。

@RequestMapping(value = "/editResume", method = RequestMethod.POST)
@ApiOperation(value = "编辑简历")
public Result<Object> editResume(@RequestParam String id,@RequestParam String date,@RequestParam String url,@RequestParam String remark) {
    TalentPoolResume record = new TalentPoolResume();
    if(record == null) {
        return ResultUtil.error("简历已被删除");
    }
    record.setDate(date);
    record.setUrl(url);
    record.setRemark(remark);
    iTalentPoolResumeService.saveOrUpdate(record);
    return ResultUtil.success();
}

3.6.3 删除简历

删除简历的核心代码如下。

@RequestMapping(value = "/deleteResume", method = RequestMethod.POST)
@ApiOperation(value = "删除简历记录")
public Result<Object> deleteResume(@RequestParam String id) {
    iTalentPoolResumeService.removeById(id);
    return ResultUtil.success();
}

四、总结

本文讲解了人才招聘库设计开发的后端部分,完成了八大实体的设计和实现,将在后续更新人才招聘库的前端开发内容。

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/26416.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

测试类型(单元、集成、系统或手动测试)

测试类型(单元、集成、系统或手动测试) 单元测试 单元是系统的单个组件&#xff0c;例如类或单个方法。孤立地测试单元称为单元测试。 优点&#xff1a;速度快/易控/易写 缺点&#xff1a;缺乏现实性/无法捕获所有错误&#xff08;例如与其他组件或服务的交互&#xff09; 单元…

Arthas-JVM相关命令使用

tip&#xff1a;作为程序员一定学习编程之道&#xff0c;一定要对代码的编写有追求&#xff0c;不能实现就完事了。我们应该让自己写的代码更加优雅&#xff0c;即使这会费时费力。 开头&#xff1a; 我们先说下生产使用频率较高的有哪些&#xff1a;dashboard、heapdump、jvm…

【连续介质力学】二阶张量的图像表示

二阶张量在特定方向的投影 法向和切向分量 二阶张量T投影到 n ^ \hat n n^方向的结果是 t ⃗ ( n ^ ) T ⋅ n ^ \vec t^{(\hat n)}T \cdot \hat n t (n^)T⋅n^&#xff0c;其中 t ⃗ ( n ^ ) \vec t^{(\hat n)} t (n^)可以分解成&#xff1a; t ⃗ ( n ^ ) T ⃗ N T ⃗ S…

2023年上半年系统规划与管理师上午真题及答案解析

1.香农用概率来定量描述信息的公式如下&#xff0c;其中H(x)表示X的( )&#xff0c;Pi是( )出现第i种状态的( )。 A.信息熵 事件 概率 B.总熵 单位 概率 C.信息熵 单位 概率 D.总熵 单位 度量 2.信息传输模型中&#xff0c;( )负责信息的向外传播&#xff0c;( )负责…

VSLAM视觉里程计总结

相机模型是理解视觉里程计之前的基础。视觉里程计&#xff08;VIO&#xff09;主要分为特征法和直接法。如果说特征点法关注的是像素的位置差&#xff0c;那么&#xff0c;直接法关注的则是像素的颜色差。特征点法通常会把图像抽象成特征点的集合&#xff0c;然后去缩小特征点之…

Android 应用快捷ShortcutManager与ShortcutManagerCompat详解与实战(二)

一、介绍 之前我已通过一篇文章介绍了应用快捷的接入与Demo。如果还未看过上一篇的文章可以先了解入门。 传送门&#xff1a;Android 应用快捷(shortcut)功能的详解(一)_蜗牛、Z的博客-CSDN博客 有创建自然就会有管理&#xff0c;否则一个完美的方案不应该这么被推荐出来。如何…

Zemax Lumerical | 二维光栅出瞳扩展系统优化(下)

简介 本文提出并演示了一种以二维光栅耦出的光瞳扩展&#xff08;EPE&#xff09;系统优化和公差分析的仿真方法。 在这个工作流程中&#xff0c;我们将使用3个软件进行不同的工作 &#xff0c;以实现优化系统的大目标。首先&#xff0c;我们使用 Lumerical 构建光栅模型并使用…

数据库实验报告--安全性实验

一、 实验目的 &#xff08;1&#xff09;理解SQL Server验证用户身份的过程&#xff0c;掌握设置身份验证模式的方法。 &#xff08;2&#xff09;理解登录账号的概念&#xff0c;掌握混合认证模式下登录账号的建立与取消方法。 &#xff08;3&#xff09;掌握混合认证模式…

Centos7中mysql安装配置

前提&#xff1a;先关闭防火墙或开启tcp的3306端口 1、查看服务器上是否有现成的安装包 yum list mysql* 2、去mysql官网的yum资源库找到对应的rpm文件的下载链接 确定系统版本 cat /etc/redhat-release 到mysql官网复制对应版本的资源下载链接 MySQL :: Download MySQL Yum…

git Husky

虽然我们已经要求项目使用eslint了&#xff0c;但是不能保证组员提交代码之前都将eslint中的问题解决掉了&#xff1a; 也就是我们希望保证代码仓库中的代码都是符合eslint规范的&#xff1b; 那么我们需要在组员执行 git commit 命令的时候对其进行校验&#xff0c;如果不符合…

说说验证码功能的实现

前言 大家好&#xff0c;我是 god23bin&#xff0c;今天说说验证码功能的实现&#xff0c;相信大家都经常接触到验证码的&#xff0c;毕竟平时上网也能遇到各种验证码&#xff0c;需要我们输入验证码进行验证我们是人类&#xff0c;而不是机器人。 验证码有多种类型&#xff…

项目中使用es(一):使用springboot操作elasticsearch

使用springboot操作es 写在前面搭建项目环境和选择合适版本具体的代码实现&#xff08;1&#xff09;继承ProductInfoRepository具体的代码实现&#xff08;2&#xff09;使用ElasticsearchRestTemplate操作问题总结最后放个demo 写在前面 对于elasticsearch的搭建&#xff0c…

5款提高工作效率的无广告软件

今天推荐一些可以大幅度提升办公效率的小软件&#xff0c;安全无毒&#xff0c;下载简单&#xff0c;最重要的是没有广告&#xff01; 1.照片处理——Darktable Darktable是一款用于处理和管理数码照片的工具。它可以让你对RAW格式的照片进行非破坏性的编辑,并提供多种模块和…

设计模式之~观察者模式

观察者模式又叫做发布-订阅&#xff08;Publish/Subscribe&#xff09;模式。 观察者模式observer&#xff1a;定义了一种一对多的依赖关系&#xff0c;让多个观察者对象同时监听某个主题对象。这个主题对象在状态发生变化时&#xff0c;会通知所有观察者对象&#xff0c;使他们…

Linux系统下imx6ull QT编程—— C++构造函数、析构函数、this指针(四)

Linux QT编程 文章目录 Linux QT编程一、什么是构造函数&#xff1f;二、什么是析构函数&#xff1f;三、示例四、this指针 一、什么是构造函数&#xff1f; 构造函数在对象实例化时被系统自动调用&#xff0c;仅且调用一次。前面我们学过类&#xff0c;实际上定义类时&#x…

【Spring】— 动态SQL :<if>元素

动态SQL &#xff1a;元素 在MyBatis中&#xff0c;<if>元素是常用的判断语句&#xff0c;主要用于实现某些简单的条件选择。在实际应用中&#xff0c;我们可能会通过多个条件来精确地查询某个数据。 【示例8-1】下面通过一个具体的案例来演示元素的使用。 &#xff0…

基于RPC协议的接口自动化测试可以用Python语言实现

基于RPC协议的接口自动化测试可以用Python语言实现。下面是实现步骤&#xff1a; 1、安装依赖库&#xff0c;如protobuf、grpc。 2、编写.proto文件定义接口参数和返回值。 3、使用protoc编译.proto文件生成Python代码。 4、编写客户端代码调用远程接口进行测试。 具体实现…

数据结构与算法练习(三)二叉树

文章目录 1、树2、二叉树3、满二叉树4、完全二叉树5、二叉树的遍历&#xff08;前序、中序、后序&#xff09;二叉树删除节点或树 6、顺序存储二叉树顺序存储二叉树遍历&#xff08;前序、中序、后序&#xff09; 7、线索化二叉树中序线索二叉树前序线索二叉树后序线索二叉树 1…

悲观锁、乐观锁、自旋锁

悲观锁、乐观锁、自旋锁 &#xff08;1&#xff09;乐观锁 乐观锁是一种乐观的思想&#xff0c;即认为读多写少&#xff0c;遇到并发的可能性低&#xff0c;每次拿数据时都认为别人不会修改&#xff0c;所以不会上锁&#xff0c;但是在更新的时候会判断一下在此期间别人有没有…

开源赋能 普惠未来|中软国际寄语 2023 开放原子全球开源峰会

中软国际作为行业领先的全球化软件与信息技术服务企业及数字化转型服务商&#xff0c;近年来积极布局开源生态&#xff08;OpenHarmony、openEuler&#xff09;、智能云、ERP、AIGC、教育科技、智能车六大赛道&#xff0c;加速业务转型创新。 中软国际为开放原子开源基金会白金…
最新文章