修改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

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