添加面试邀约接口
This commit is contained in:
@@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.cms.controller.cms;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.InterviewInvite;
|
||||||
|
import com.ruoyi.cms.service.InterviewInviteService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面试邀约Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/interviewInvite")
|
||||||
|
@Api(tags = "后台:面试邀约")
|
||||||
|
public class InterviewInviteController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private InterviewInviteService interviewInviteService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询面试邀约列表(分页)
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询面试邀约列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('cms:interviewInvite:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(InterviewInvite interviewInvite)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<InterviewInvite> list = interviewInviteService.selectInterviewInviteList(interviewInvite);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取面试邀约详情
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取面试邀约详情")
|
||||||
|
@PreAuthorize("@ss.hasPermi('cms:interviewInvite:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(interviewInviteService.selectInterviewInviteById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增面试邀约(弹窗保存接口)
|
||||||
|
*/
|
||||||
|
@ApiOperation("新增面试邀约")
|
||||||
|
@PreAuthorize("@ss.hasPermi('cms:interviewInvite:add')")
|
||||||
|
@Log(title = "面试邀约", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody InterviewInvite interviewInvite)
|
||||||
|
{
|
||||||
|
return toAjax(interviewInviteService.insertInterviewInvite(interviewInvite));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改面试邀约
|
||||||
|
*/
|
||||||
|
@ApiOperation("修改面试邀约")
|
||||||
|
@PreAuthorize("@ss.hasPermi('cms:interviewInvite:edit')")
|
||||||
|
@Log(title = "面试邀约", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody InterviewInvite interviewInvite)
|
||||||
|
{
|
||||||
|
return toAjax(interviewInviteService.updateInterviewInvite(interviewInvite));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除面试邀约(逻辑删除)
|
||||||
|
*/
|
||||||
|
@ApiOperation("面试邀约删除")
|
||||||
|
@PreAuthorize("@ss.hasPermi('cms:interviewInvite:remove')")
|
||||||
|
@Log(title = "面试邀约", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(interviewInviteService.deleteInterviewInviteByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.cms.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("面试邀约")
|
||||||
|
@TableName(value = "interview_invite")
|
||||||
|
public class InterviewInvite extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键ID bigint自增 */
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 岗位申请ID 关联job_apply */
|
||||||
|
@Excel(name = "投递记录ID")
|
||||||
|
private Long jobApplyId;
|
||||||
|
|
||||||
|
/** 面试时间 */
|
||||||
|
@Excel(name = "面试时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date interviewTime;
|
||||||
|
|
||||||
|
/** 面试方式 1线上 2线下 */
|
||||||
|
@Excel(name = "面试方式", readConverterExp = "1=线上,2=线下")
|
||||||
|
private Integer interviewType;
|
||||||
|
|
||||||
|
/** 会议链接/线下手机号 */
|
||||||
|
@Excel(name = "联系方式/会议链接")
|
||||||
|
private String contactInfo;
|
||||||
|
|
||||||
|
/** 邀约状态:1待发送 2已发送 3候选人确认 4候选人拒绝 5面试完成 */
|
||||||
|
@Excel(name = "邀约状态", readConverterExp = "1=待发送,2=已发送,3=候选人确认,4=候选人拒绝,5=面试完成")
|
||||||
|
private Integer inviteStatus;
|
||||||
|
|
||||||
|
/** 面试轮次 1一面 2二面 3复试 */
|
||||||
|
@Excel(name = "面试轮次")
|
||||||
|
private Integer interviewRound;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.cms.domain.InterviewInvite;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面试邀约Mapper
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public interface InterviewInviteMapper extends BaseMapper<InterviewInvite>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询面试邀约列表
|
||||||
|
* @param interviewInvite 查询条件
|
||||||
|
* @return 集合
|
||||||
|
*/
|
||||||
|
List<InterviewInvite> selectInterviewInviteList(@Param("entity") InterviewInvite interviewInvite);
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.entity.AppUser;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class NoticeUtils {
|
public class NoticeUtils {
|
||||||
/**
|
/**
|
||||||
@@ -34,6 +35,17 @@ public class NoticeUtils {
|
|||||||
|
|
||||||
public static final String NOTICE_TYPE_SXLX="2";
|
public static final String NOTICE_TYPE_SXLX="2";
|
||||||
|
|
||||||
|
/*************面试start*************/
|
||||||
|
public static final String NOTICE_TYPE_MS="面试通知";
|
||||||
|
|
||||||
|
public static final String NOTICE_COMENT_MS="诚挚邀请您参加【";
|
||||||
|
|
||||||
|
public static final String INTERVIEW_NOTICE_TPL = "%s%s%s";
|
||||||
|
|
||||||
|
public static final Integer INTERVIEW_TYPE_ONLINE = 1;//线上
|
||||||
|
|
||||||
|
/*************面试end*************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼装岗位
|
* 拼装岗位
|
||||||
*/
|
*/
|
||||||
@@ -102,4 +114,23 @@ public class NoticeUtils {
|
|||||||
});
|
});
|
||||||
return add;
|
return add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面试通知
|
||||||
|
* @param companyName
|
||||||
|
* @param jobName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String mstzMsg(String companyName,String jobName,Integer lx,String message){
|
||||||
|
String compName = Optional.ofNullable(companyName).orElse("");
|
||||||
|
String jbName = Optional.ofNullable(jobName).orElse("");
|
||||||
|
String msgExtra = Optional.ofNullable(message).orElse("");
|
||||||
|
String typeText = INTERVIEW_TYPE_ONLINE.equals(lx) ? "线上面试" : "线下面试";
|
||||||
|
|
||||||
|
return String.format(INTERVIEW_NOTICE_TPL,
|
||||||
|
compName+",",
|
||||||
|
NoticeUtils.NOTICE_COMENT_MS,
|
||||||
|
jbName +NoticeUtils.NOTICE_COMENT_FF + typeText +","+ msgExtra
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?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.InterviewInviteMapper">
|
||||||
|
|
||||||
|
<resultMap type="interviewInvite" id="interviewInviteResult">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="job_apply_id" property="jobApplyId"/>
|
||||||
|
<result column="interview_time" property="interviewTime"/>
|
||||||
|
<result column="interview_type" property="interviewType"/>
|
||||||
|
<result column="contact_info" property="contactInfo"/>
|
||||||
|
<result column="invite_status" property="inviteStatus"/>
|
||||||
|
<result column="interview_round" property="interviewRound"/>
|
||||||
|
<result column="del_flag" property="delFlag"/>
|
||||||
|
<result column="create_by" property="createBy"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="update_by" property="updateBy"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="remark" property="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectInterviewInviteVo">
|
||||||
|
select id, job_apply_id, interview_time, interview_type, contact_info,
|
||||||
|
invite_status, interview_round, del_flag, create_by, create_time,
|
||||||
|
update_by, update_time, remark
|
||||||
|
from interview_invite
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectInterviewInviteList" resultMap="interviewInviteResult">
|
||||||
|
<include refid="selectInterviewInviteVo"/>
|
||||||
|
where del_flag = '0'
|
||||||
|
<if test="entity.jobApplyId != null">
|
||||||
|
and job_apply_id = #{entity.jobApplyId}
|
||||||
|
</if>
|
||||||
|
<if test="entity.interviewType != null">
|
||||||
|
and interview_type = #{entity.interviewType}
|
||||||
|
</if>
|
||||||
|
<if test="entity.inviteStatus != null">
|
||||||
|
and invite_status = #{entity.inviteStatus}
|
||||||
|
</if>
|
||||||
|
<if test="entity.interviewRound != null">
|
||||||
|
and interview_round = #{entity.interviewRound}
|
||||||
|
</if>
|
||||||
|
<if test="entity.contactInfo != null and entity.contactInfo != ''">
|
||||||
|
and contact_info like '%' || #{entity.contactInfo} || '%'
|
||||||
|
</if>
|
||||||
|
order by interview_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user