修改bug:已经申请过的岗位,还可以继续申请,需要业务判断

This commit is contained in:
2026-01-31 01:05:14 +08:00
parent 816c6c44bf
commit b5f1009d9b
7 changed files with 51 additions and 2 deletions

View File

@@ -63,3 +63,6 @@ HotakeRolesInfoServiceImpl10001 = The job information is abnormal. Please try ag
# manager.页面,字段 = User Manager
VerificationEmailTiTle = Your verification code
VerificationEmailContent = Your verification code is: {0}, valid for {1} minutes.
HotakeRolesApplyInfoServiceImpl10001 = You have already applied for this position

View File

@@ -62,3 +62,4 @@ HotakeRolesInfoServiceImpl10001 = 岗位信息异常,请稍后再试
VerificationEmailTiTle = 你的验证码
VerificationEmailContent = 你的验证码是: {0},有效期为 {1} 分钟。
HotakeRolesApplyInfoServiceImpl10001 = 您已申请该职位

View File

@@ -48,4 +48,7 @@ public class HotakeRolesInfoDto extends HotakeRolesInfo {
@ApiModelProperty("招聘人详细信息")
private SysUser recruiterUser;
@ApiModelProperty("当前用户是否已申请该岗位")
private Boolean hasApplied;
}

View File

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

View File

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

View File

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

View File

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