修改bug:已经申请过的岗位,还可以继续申请,需要业务判断
This commit is contained in:
@@ -48,4 +48,7 @@ public class HotakeRolesInfoDto extends HotakeRolesInfo {
|
||||
@ApiModelProperty("招聘人详细信息")
|
||||
private SysUser recruiterUser;
|
||||
|
||||
@ApiModelProperty("当前用户是否已申请该岗位")
|
||||
private Boolean hasApplied;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.vetti.hotake.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeRolesApplyInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 候选人岗位申请信息Mapper接口
|
||||
@@ -82,4 +83,13 @@ public interface HotakeRolesApplyInfoMapper
|
||||
*/
|
||||
public int batchInsertHotakeRolesApplyInfo(List<HotakeRolesApplyInfo> hotakeRolesApplyInfoList);
|
||||
|
||||
/**
|
||||
* 根据候选人ID和岗位ID查询申请信息
|
||||
*
|
||||
* @param candidateId 候选人ID
|
||||
* @param roleId 岗位ID
|
||||
* @return 候选人岗位申请信息
|
||||
*/
|
||||
public HotakeRolesApplyInfo selectByCandidateIdAndRoleId(@Param("candidateId") Long candidateId, @Param("roleId") Long roleId);
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.enums.StageEnum;
|
||||
import com.vetti.common.exception.ServiceException;
|
||||
import com.vetti.common.utils.MessageUtils;
|
||||
import com.vetti.common.utils.SecurityUtils;
|
||||
import com.vetti.hotake.domain.*;
|
||||
import com.vetti.hotake.domain.dto.HotakeAiCvScoringRankingDto;
|
||||
@@ -172,7 +173,17 @@ public class HotakeRolesApplyInfoServiceImpl extends BaseServiceImpl implements
|
||||
public HotakeRolesApplyInfo insertHotakeRolesApplyInfo(HotakeRolesApplyInfo hotakeRolesApplyInfo)
|
||||
{
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeRolesApplyInfo);
|
||||
hotakeRolesApplyInfo.setCandidateId(SecurityUtils.getUserId());
|
||||
Long candidateId = SecurityUtils.getUserId();
|
||||
hotakeRolesApplyInfo.setCandidateId(candidateId);
|
||||
|
||||
// 校验候选人和岗位的唯一性
|
||||
if (hotakeRolesApplyInfo.getRoleId() != null) {
|
||||
HotakeRolesApplyInfo existInfo = hotakeRolesApplyInfoMapper.selectByCandidateIdAndRoleId(candidateId, hotakeRolesApplyInfo.getRoleId());
|
||||
if (existInfo != null) {
|
||||
throw new ServiceException(MessageUtils.messageCustomize("HotakeRolesApplyInfoServiceImpl10001"));
|
||||
}
|
||||
}
|
||||
|
||||
String fileSuffix = FileUtil.getSuffix(hotakeRolesApplyInfo.getCvFile());
|
||||
if (StrUtil.isNotEmpty(fileSuffix)) {
|
||||
fileSuffix = fileSuffix.toLowerCase();
|
||||
@@ -193,7 +204,17 @@ public class HotakeRolesApplyInfoServiceImpl extends BaseServiceImpl implements
|
||||
public HotakeRolesApplyInfo updateHotakeRolesApplyInfo(HotakeRolesApplyInfo hotakeRolesApplyInfo)
|
||||
{
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeRolesApplyInfo);
|
||||
hotakeRolesApplyInfo.setCandidateId(SecurityUtils.getUserId());
|
||||
Long candidateId = SecurityUtils.getUserId();
|
||||
hotakeRolesApplyInfo.setCandidateId(candidateId);
|
||||
|
||||
// 校验候选人和岗位的唯一性(排除自身)
|
||||
if (hotakeRolesApplyInfo.getRoleId() != null && hotakeRolesApplyInfo.getId() != null) {
|
||||
HotakeRolesApplyInfo existInfo = hotakeRolesApplyInfoMapper.selectByCandidateIdAndRoleId(candidateId, hotakeRolesApplyInfo.getRoleId());
|
||||
if (existInfo != null && !existInfo.getId().equals(hotakeRolesApplyInfo.getId())) {
|
||||
throw new ServiceException(MessageUtils.messageCustomize("HotakeRolesApplyInfoServiceImpl10001"));
|
||||
}
|
||||
}
|
||||
|
||||
String fileSuffix = FileUtil.getSuffix(hotakeRolesApplyInfo.getCvFile());
|
||||
if (StrUtil.isNotEmpty(fileSuffix)) {
|
||||
fileSuffix = fileSuffix.toLowerCase();
|
||||
|
||||
@@ -134,6 +134,11 @@ public class HotakeRolesInfoServiceImpl extends BaseServiceImpl implements IHota
|
||||
|
||||
SysUser user = sysUserMapper.selectUserById(hotakeRolesInfo.getRecruiterId());
|
||||
dto.setRecruiterUser(user);
|
||||
|
||||
// 判断当前用户是否已申请该岗位
|
||||
Long currentUserId = SecurityUtils.getUserId();
|
||||
HotakeRolesApplyInfo existApply = hotakeRolesApplyInfoMapper.selectByCandidateIdAndRoleId(currentUserId, id);
|
||||
dto.setHasApplied(existApply != null);
|
||||
}
|
||||
|
||||
return dto;
|
||||
|
||||
@@ -305,4 +305,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
( #{item.id}, #{item.candidateId},#{item.recruiterId}, #{item.roleId}, #{item.fullName}, #{item.email}, #{item.phoneNumber}, #{item.cvFile}, #{item.coverLetter}, #{item.candidateStatus}, #{item.stage}, #{item.lastContact}, #{item.cvTemplateJson}, #{item.cvScore}, #{item.cvMd5}, #{item.experience}, #{item.aiMatchScore}, #{item.aiMatchScorePercentage}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectByCandidateIdAndRoleId" resultMap="HotakeRolesApplyInfoResult">
|
||||
<include refid="selectHotakeRolesApplyInfoVo"/>
|
||||
where candidate_id = #{candidateId} and role_id = #{roleId}
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user