添加面试邀约接口
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cms.domain.InterviewInvite;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 面试邀约Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface InterviewInviteService extends IService<InterviewInvite>
|
||||
{
|
||||
/**
|
||||
* 查询面试邀约
|
||||
* @param id 主键
|
||||
* @return 实体
|
||||
*/
|
||||
InterviewInvite selectInterviewInviteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询面试邀约列表
|
||||
* @param interviewInvite 条件
|
||||
* @return 集合
|
||||
*/
|
||||
List<InterviewInvite> selectInterviewInviteList(InterviewInvite interviewInvite);
|
||||
|
||||
/**
|
||||
* 新增面试邀约
|
||||
* @param interviewInvite 实体
|
||||
* @return 行数
|
||||
*/
|
||||
int insertInterviewInvite(InterviewInvite interviewInvite);
|
||||
|
||||
/**
|
||||
* 修改面试邀约
|
||||
* @param interviewInvite 实体
|
||||
* @return 行数
|
||||
*/
|
||||
int updateInterviewInvite(InterviewInvite interviewInvite);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除面试邀约
|
||||
* @param ids 主键数组
|
||||
* @return 行数
|
||||
*/
|
||||
int deleteInterviewInviteByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.InterviewInvite;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.JobApply;
|
||||
import com.ruoyi.cms.domain.Notice;
|
||||
import com.ruoyi.cms.mapper.InterviewInviteMapper;
|
||||
import com.ruoyi.cms.mapper.JobApplyMapper;
|
||||
import com.ruoyi.cms.mapper.JobMapper;
|
||||
import com.ruoyi.cms.mapper.NoticeMapper;
|
||||
import com.ruoyi.cms.service.InterviewInviteService;
|
||||
import com.ruoyi.cms.util.notice.NoticeUtils;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 面试邀约业务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class InterviewInviteServiceImpl extends ServiceImpl<InterviewInviteMapper, InterviewInvite>
|
||||
implements InterviewInviteService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private InterviewInviteMapper interviewInviteMapper;
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
@Autowired
|
||||
private JobApplyMapper jobApplyMapper;
|
||||
@Autowired
|
||||
private JobMapper jobMapper;
|
||||
|
||||
@Override
|
||||
public InterviewInvite selectInterviewInviteById(Long id)
|
||||
{
|
||||
return interviewInviteMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InterviewInvite> selectInterviewInviteList(InterviewInvite interviewInvite)
|
||||
{
|
||||
return interviewInviteMapper.selectInterviewInviteList(interviewInvite);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertInterviewInvite(InterviewInvite interviewInvite)
|
||||
{
|
||||
int i=interviewInviteMapper.insert(interviewInvite);
|
||||
createNotice(interviewInvite);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateInterviewInvite(InterviewInvite interviewInvite)
|
||||
{
|
||||
createNotice(interviewInvite);
|
||||
return interviewInviteMapper.updateById(interviewInvite);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteInterviewInviteByIds(Long[] ids)
|
||||
{
|
||||
List<Long> upIds=Arrays.asList(ids);
|
||||
int i=interviewInviteMapper.deleteBatchIds(upIds);
|
||||
//删除通知
|
||||
noticeMapper.update(null, Wrappers.<Notice>lambdaUpdate()
|
||||
.in(Notice::getBussinessId, upIds)
|
||||
.set(Notice::getDelFlag, Constants.Del_FLAG_DELETE));
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存通知信息
|
||||
* @param interviewInvite
|
||||
*/
|
||||
public void createNotice(InterviewInvite interviewInvite){
|
||||
JobApply jobApply=jobApplyMapper.selectById(interviewInvite.getJobApplyId());
|
||||
Job job=jobMapper.selectById(jobApply.getJobId());
|
||||
Notice notice = new Notice();
|
||||
notice.setUserId(jobApply.getUserId());
|
||||
notice.setBussinessId(interviewInvite.getId());
|
||||
notice.setIsRead(NoticeUtils.NOTICE_WD);
|
||||
notice.setTitle(NoticeUtils.NOTICE_TYPE_MS);
|
||||
notice.setSubTitle(NoticeUtils.NOTICE_TYPE_MS);
|
||||
notice.setNoticeType(NoticeUtils.NOTICE_TYPE_XTLX);
|
||||
notice.setRemark(NoticeUtils.NOTICE_REMARK);
|
||||
String content = NoticeUtils.mstzMsg(job.getCompanyName(), job.getJobTitle(),interviewInvite.getInterviewType(),interviewInvite.getContactInfo());
|
||||
notice.setNoticeContent(content);
|
||||
noticeMapper.insert(notice);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user