新增面试邀约功能

This commit is contained in:
francis-fh
2026-06-24 09:31:29 +08:00
parent 7d5ad10883
commit a3cd9b0277
8 changed files with 461 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}