Commit 6edd42e5 by 黄炜

feat(recruitment): 新增试岗审批状态校验

1 parent 76f7d936
...@@ -6,7 +6,6 @@ import com.dangdang.ddframe.job.api.simple.SimpleJob; ...@@ -6,7 +6,6 @@ import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf; import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -16,7 +15,7 @@ import org.springframework.stereotype.Service; ...@@ -16,7 +15,7 @@ import org.springframework.stereotype.Service;
**/ **/
@Service @Service
@Slf4j @Slf4j
@ElasticJobConf(name = "RecruitmentTrialOnboardingApprovalRemindJob", cron = "0 */2 * * * ?", description = "试岗催审任务-每30分钟扫描,未审批超2小时则每2小时催一次") @ElasticJobConf(name = "RecruitmentTrialOnboardingApprovalRemindJob", cron = "0 */30 * * * ?", description = "试岗催审任务-每30分钟扫描,未审批超2小时则每2小时催一次")
@RequiredArgsConstructor @RequiredArgsConstructor
public class RecruitmentTrialOnboardingApprovalRemindJob implements SimpleJob { public class RecruitmentTrialOnboardingApprovalRemindJob implements SimpleJob {
......
...@@ -2052,6 +2052,11 @@ public class RecruitmentDemandService { ...@@ -2052,6 +2052,11 @@ public class RecruitmentDemandService {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "仅支持对个人新增的试岗人员进行编辑"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "仅支持对个人新增的试岗人员进行编辑");
} }
// 审批中(approval_result为空)不允许编辑
if (Objects.isNull(existing.getApprovalResult())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "审批中不允许处理");
}
if (Objects.nonNull(existing.getProcessResult())) { if (Objects.nonNull(existing.getProcessResult())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "仅支持对待处理的试岗人员进行编辑"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "仅支持对待处理的试岗人员进行编辑");
} }
...@@ -2162,6 +2167,10 @@ public class RecruitmentDemandService { ...@@ -2162,6 +2167,10 @@ public class RecruitmentDemandService {
if (existing == null || BaseModel.DeletedFlagEnum.D.name().equals(existing.getDeletedFlag())) { if (existing == null || BaseModel.DeletedFlagEnum.D.name().equals(existing.getDeletedFlag())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录不存在"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录不存在");
} }
// 审批中(approval_result为空)不允许处理
if (Objects.isNull(existing.getApprovalResult())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "审批中不允许处理");
}
if (Objects.nonNull(existing.getProcessResult())) { if (Objects.nonNull(existing.getProcessResult())) {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录已处理,不可重复处理"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "试岗记录已处理,不可重复处理");
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!