新增面试邀约功能
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.ruoyi.cms.controller.app;
|
||||
|
||||
import com.ruoyi.cms.domain.InterviewInvitation;
|
||||
import com.ruoyi.cms.service.InterviewInvitationService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 移动端:面试邀约
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-10-10 10:42:16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/interview")
|
||||
@Api(tags = "移动端:面试邀约")
|
||||
public class AppInterviewController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private InterviewInvitationService interviewInvitationService;
|
||||
|
||||
/**
|
||||
* 我的面试邀约列表
|
||||
*/
|
||||
@ApiOperation("我的面试邀约列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(){
|
||||
InterviewInvitation query = new InterviewInvitation();
|
||||
query.setUserId(SiteSecurityUtils.getUserId());
|
||||
startPage();
|
||||
List<InterviewInvitation> list = interviewInvitationService.getInterviewInvitationList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@ApiOperation("面试邀约详情")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id){
|
||||
return AjaxResult.success(interviewInvitationService.getInterviewInvitationById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新面试邀约状态(接受/拒绝)
|
||||
*/
|
||||
@ApiOperation("更新面试邀约状态")
|
||||
@PutMapping("/status/{id}")
|
||||
public AjaxResult updateStatus(@PathVariable Long id, @RequestParam String status){
|
||||
return toAjax(interviewInvitationService.updateInterviewStatus(id, status));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ruoyi.cms.controller.cms;
|
||||
|
||||
import com.ruoyi.cms.domain.InterviewInvitation;
|
||||
import com.ruoyi.cms.service.InterviewInvitationService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 面试邀约
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-10-10 10:42:16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/cms/interview")
|
||||
@Api(tags = "后台:面试邀约")
|
||||
public class CmsInterviewController extends BaseController {
|
||||
@Autowired
|
||||
private InterviewInvitationService interviewInvitationService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@ApiOperation("面试邀约列表")
|
||||
@PreAuthorize("@ss.hasPermi('cms:interview:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InterviewInvitation interviewInvitation){
|
||||
startPage();
|
||||
List<InterviewInvitation> list = interviewInvitationService.getInterviewInvitationList(interviewInvitation);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation("新增面试邀约")
|
||||
@PreAuthorize("@ss.hasPermi('cms:interview:add')")
|
||||
@Log(title = "面试邀约", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody InterviewInvitation interviewInvitation){
|
||||
return toAjax(interviewInvitationService.insertInterviewInvitation(interviewInvitation));
|
||||
}
|
||||
|
||||
@ApiOperation("修改面试邀约")
|
||||
@PreAuthorize("@ss.hasPermi('cms:interview:edit')")
|
||||
@Log(title = "面试邀约", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody InterviewInvitation interviewInvitation){
|
||||
return toAjax(interviewInvitationService.updateInterviewInvitation(interviewInvitation));
|
||||
}
|
||||
|
||||
@ApiOperation("删除面试邀约")
|
||||
@PreAuthorize("@ss.hasPermi('cms:interview:remove')")
|
||||
@Log(title = "面试邀约", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(interviewInvitationService.deleteInterviewInvitationIds(ids));
|
||||
}
|
||||
|
||||
@ApiOperation("面试邀约详情")
|
||||
@PreAuthorize("@ss.hasPermi('cms:interview:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id)
|
||||
{
|
||||
return AjaxResult.success(interviewInvitationService.getInterviewInvitationById(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 面试邀约
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-10-10 10:42:16
|
||||
*/
|
||||
@Data
|
||||
@TableName("interview_invitation")
|
||||
public class InterviewInvitation extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
/**
|
||||
* 企业id
|
||||
*/
|
||||
@ApiModelProperty("企业id")
|
||||
private Long companyId;
|
||||
/**
|
||||
* 岗位id
|
||||
*/
|
||||
@ApiModelProperty("岗位id")
|
||||
private Long jobId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 申请id
|
||||
*/
|
||||
@ApiModelProperty("申请id")
|
||||
private Long applyId;
|
||||
/**
|
||||
* 面试时间
|
||||
*/
|
||||
@ApiModelProperty("面试时间")
|
||||
private String interviewTime;
|
||||
/**
|
||||
* 面试方式(online/offline)
|
||||
*/
|
||||
@ApiModelProperty("面试方式")
|
||||
private String interviewMethod;
|
||||
/**
|
||||
* 腾讯会议链接
|
||||
*/
|
||||
@ApiModelProperty("腾讯会议链接")
|
||||
private String meetingLink;
|
||||
/**
|
||||
* 会议密码
|
||||
*/
|
||||
@ApiModelProperty("会议密码")
|
||||
private String meetingPassword;
|
||||
/**
|
||||
* 面试地点
|
||||
*/
|
||||
@ApiModelProperty("面试地点")
|
||||
private String interviewLocation;
|
||||
/**
|
||||
* 面试官联系方式
|
||||
*/
|
||||
@ApiModelProperty("面试官联系方式")
|
||||
private String contactPhone;
|
||||
/**
|
||||
* 状态(pending/accepted/rejected/completed)
|
||||
*/
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.cms.domain.InterviewInvitation;
|
||||
import java.util.List;
|
||||
|
||||
public interface InterviewInvitationMapper extends BaseMapper<InterviewInvitation> {
|
||||
List<InterviewInvitation> getInterviewInvitationList(InterviewInvitation interviewInvitation);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.InterviewInvitation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 面试邀约
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2025-10-10 10:42:16
|
||||
*/
|
||||
public interface InterviewInvitationService {
|
||||
|
||||
List<InterviewInvitation> getInterviewInvitationList(InterviewInvitation interviewInvitation);
|
||||
|
||||
int insertInterviewInvitation(InterviewInvitation interviewInvitation);
|
||||
|
||||
int updateInterviewInvitation(InterviewInvitation interviewInvitation);
|
||||
|
||||
int deleteInterviewInvitationIds(Long[] ids);
|
||||
|
||||
InterviewInvitation getInterviewInvitationById(Long id);
|
||||
|
||||
int updateInterviewStatus(Long id, String status);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.ruoyi.cms.domain.InterviewInvitation;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.JobApply;
|
||||
import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.cms.mapper.InterviewInvitationMapper;
|
||||
import com.ruoyi.cms.mapper.JobApplyMapper;
|
||||
import com.ruoyi.cms.mapper.JobMapper;
|
||||
import com.ruoyi.cms.mapper.NoticeMapper;
|
||||
import com.ruoyi.cms.service.InterviewInvitationService;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class InterviewInvitationServiceImpl implements InterviewInvitationService {
|
||||
|
||||
@Autowired
|
||||
InterviewInvitationMapper interviewInvitationMapper;
|
||||
@Autowired
|
||||
private JobApplyMapper jobApplyMapper;
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
@Autowired
|
||||
private JobMapper jobMapper;
|
||||
|
||||
@Override
|
||||
public List<InterviewInvitation> getInterviewInvitationList(InterviewInvitation interviewInvitation) {
|
||||
return interviewInvitationMapper.getInterviewInvitationList(interviewInvitation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertInterviewInvitation(InterviewInvitation interviewInvitation) {
|
||||
int t = interviewInvitationMapper.insert(interviewInvitation);
|
||||
if (t > 0) {
|
||||
// 获取岗位和申请信息
|
||||
Job job = jobMapper.getJobInfo(interviewInvitation.getJobId());
|
||||
JobApply jobApply = jobApplyMapper.selectById(interviewInvitation.getApplyId());
|
||||
// 创建面试邀约通知
|
||||
Notice notice = createInterviewNotice(interviewInvitation, job, jobApply);
|
||||
if (notice != null) {
|
||||
noticeMapper.insert(notice);
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateInterviewInvitation(InterviewInvitation interviewInvitation) {
|
||||
return interviewInvitationMapper.updateById(interviewInvitation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteInterviewInvitationIds(Long[] ids) {
|
||||
return interviewInvitationMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterviewInvitation getInterviewInvitationById(Long id) {
|
||||
return interviewInvitationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateInterviewStatus(Long id, String status) {
|
||||
InterviewInvitation invitation = new InterviewInvitation();
|
||||
invitation.setId(id);
|
||||
invitation.setStatus(status);
|
||||
return interviewInvitationMapper.updateById(invitation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建面试邀约通知
|
||||
*/
|
||||
private Notice createInterviewNotice(InterviewInvitation invitation, Job job, JobApply jobApply) {
|
||||
Notice notice = new Notice();
|
||||
Long userId = invitation.getUserId();
|
||||
if (userId == null && jobApply != null) {
|
||||
userId = jobApply.getUserId();
|
||||
}
|
||||
notice.setUserId(userId);
|
||||
notice.setBussinessId(invitation.getJobId());
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
notice.setTitle("面试邀约通知");
|
||||
notice.setSubTitle("面试邀约");
|
||||
notice.setNoticeType(NoticeUtils.NOTICE_TYPE_XTLX);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
|
||||
// 拼装通知内容
|
||||
String jobTitle = job != null ? job.getJobTitle() : "";
|
||||
String methodText = "online".equals(invitation.getInterviewMethod()) ? "线上" : "线下";
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("您好,您申请的【").append(jobTitle).append("】岗位收到了面试邀约。");
|
||||
content.append("面试时间:").append(invitation.getInterviewTime() != null ? invitation.getInterviewTime() : "待定").append(",");
|
||||
content.append("面试方式:").append(methodText);
|
||||
if ("online".equals(invitation.getInterviewMethod())) {
|
||||
content.append(",腾讯会议链接:").append(invitation.getMeetingLink() != null ? invitation.getMeetingLink() : "");
|
||||
content.append(",会议密码:").append(invitation.getMeetingPassword() != null ? invitation.getMeetingPassword() : "");
|
||||
} else {
|
||||
content.append(",面试地点:").append(invitation.getInterviewLocation() != null ? invitation.getInterviewLocation() : "");
|
||||
}
|
||||
if (invitation.getContactPhone() != null && !invitation.getContactPhone().isEmpty()) {
|
||||
content.append(",面试官联系方式:").append(invitation.getContactPhone());
|
||||
}
|
||||
if (invitation.getRemark() != null && !invitation.getRemark().isEmpty()) {
|
||||
content.append("。备注:").append(invitation.getRemark());
|
||||
}
|
||||
notice.setNoticeContent(content.toString());
|
||||
return notice;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.ruoyi.cms.mapper.InterviewInvitationMapper">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="InterviewInvitation" id="InterviewInvitationResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="jobId" column="job_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="applyId" column="apply_id"/>
|
||||
<result property="interviewTime" column="interview_time"/>
|
||||
<result property="interviewMethod" column="interview_method"/>
|
||||
<result property="meetingLink" column="meeting_link"/>
|
||||
<result property="meetingPassword" column="meeting_password"/>
|
||||
<result property="interviewLocation" column="interview_location"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectInterviewInvitationVo">
|
||||
select id, company_id, job_id, user_id, apply_id, interview_time,
|
||||
interview_method, meeting_link, meeting_password, interview_location,
|
||||
contact_phone, status, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
from interview_invitation
|
||||
</sql>
|
||||
|
||||
<select id="getInterviewInvitationList" resultMap="InterviewInvitationResult" parameterType="InterviewInvitation">
|
||||
<include refid="selectInterviewInvitationVo"/>
|
||||
<where> del_flag = '0'
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId}</if>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
||||
<if test="applyId != null and applyId != ''"> and apply_id = #{applyId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
35
sql/interview_invitation.sql
Normal file
35
sql/interview_invitation.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
-- 面试邀约表
|
||||
create table "interview_invitation"
|
||||
(
|
||||
"id" bigint not null,
|
||||
"company_id" bigint not null,
|
||||
"job_id" bigint not null,
|
||||
"user_id" bigint not null,
|
||||
"apply_id" bigint null,
|
||||
"interview_time" varchar(100) null,
|
||||
"interview_method" varchar(20) null,
|
||||
"meeting_link" varchar(500) null,
|
||||
"meeting_password" varchar(100) null,
|
||||
"interview_location" varchar(500) null,
|
||||
"contact_phone" varchar(50) null,
|
||||
"status" varchar(20) default 'pending' null,
|
||||
"del_flag" char(1) default '0' null,
|
||||
"create_by" varchar(64) default '' null,
|
||||
"create_time" timestamp(0) null,
|
||||
"update_by" varchar(64) default '' null,
|
||||
"update_time" timestamp(0) null,
|
||||
"remark" varchar(500) null
|
||||
);
|
||||
|
||||
comment on table "interview_invitation" is '面试邀约表';
|
||||
comment on column "interview_invitation"."id" is '主键id';
|
||||
comment on column "interview_invitation"."company_id" is '企业id';
|
||||
comment on column "interview_invitation"."job_id" is '岗位id';
|
||||
comment on column "interview_invitation"."user_id" is '用户id';
|
||||
comment on column "interview_invitation"."apply_id" is '申请id';
|
||||
comment on column "interview_invitation"."interview_time" is '面试时间';
|
||||
comment on column "interview_invitation"."interview_method" is '面试方式(online/offline)';
|
||||
comment on column "interview_invitation"."meeting_link" is '腾讯会议链接';
|
||||
comment on column "interview_invitation"."meeting_password" is '会议密码';
|
||||
comment on column "interview_invitation"."interview_location" is '面试地点';
|
||||
comment on column "interview_invitation"."status" is '状态(pending/accepted/rejected/completed)';
|
||||
Reference in New Issue
Block a user