Commit 21050443 by 谢海旭

202601月中版本 招聘管理:处理接口调整、新增招聘需求接口调整、企微消息推送调整

1 parent 36ec8899
package cn.com.glsx.dj.staff.dto.recruitment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 招聘需求处理结果DTO
* 用于收集处理过程中的简历变更信息
*/
@Data
public class RecruitmentProcessResultDTO {
/**
* 是否有新增简历
*/
@ApiModelProperty(notes = "是否有新增简历")
private boolean hasNewResume = false;
/**
* 是否有简历处理(处理结果变更)
*/
@ApiModelProperty(notes = "是否有简历处理")
private boolean hasResumeProcess = false;
/**
* 是否有面试结果变更
*/
@ApiModelProperty(notes = "是否有面试结果变更")
private boolean hasInterviewResult = false;
}
package cn.com.glsx.dj.staff.remote; package cn.com.glsx.dj.staff.remote;
import cn.com.glsx.dj.staff.dto.recruitment.*; import cn.com.glsx.dj.staff.dto.recruitment.*;
import cn.com.glsx.dj.staff.enums.RecruitmentDemandStatusEnum;
import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandBusinessTypeEnum; import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandBusinessTypeEnum;
import cn.com.glsx.dj.staff.enums.recruitment.RecruitmentDemandLogOperationTypeEnum;
import cn.com.glsx.dj.staff.model.RecruitmentDemand;
import cn.com.glsx.dj.staff.model.RecruitmentResume; import cn.com.glsx.dj.staff.model.RecruitmentResume;
import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService; import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
...@@ -72,7 +75,24 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -72,7 +75,24 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
@Override @Override
public RpcResponse<String> recruitmentDemandStatusUpdate(RecruitmentDemandDTO dto) { public RpcResponse<String> recruitmentDemandStatusUpdate(RecruitmentDemandDTO dto) {
try{ try{
RecruitmentDemandDTO demand = recruitmentDemandService.getRecruitmentDemand(dto.getId());
Byte oldStatus = demand.getStatus();
recruitmentDemandService.recruitmentDemandStatusUpdate(dto); recruitmentDemandService.recruitmentDemandStatusUpdate(dto);
RecruitmentDemandDTO currentDemand = recruitmentDemandService.getRecruitmentDemand(dto.getId());
Byte currStatus = currentDemand.getStatus();
// 技术督导确认后推送企微消息给招聘负责人
if (currStatus.compareTo(RecruitmentDemandStatusEnum.RECRUITING.getValue()) == 0
&& Objects.equals(oldStatus, RecruitmentDemandStatusEnum.WAIT_SUPERVISOR_CONFIRM.getValue())) {
recruitmentDemandService.sendRecruitmentQWTextMessage(
currentDemand.getRecruiterPhone(),
"新增招聘需求提醒",
"您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。",
currentDemand.getId(),
currentDemand.getRecruiterName()
);
}
return RpcResponse.success("success"); return RpcResponse.success("success");
}catch(Exception e){ }catch(Exception e){
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
...@@ -83,24 +103,24 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -83,24 +103,24 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
@Override @Override
public RpcResponse<String> recruitmentDemandProcess(RecruitmentDemandDetailDTO dto) { public RpcResponse<String> recruitmentDemandProcess(RecruitmentDemandDetailDTO dto) {
try{ try{
boolean hasNewResume = false; RecruitmentProcessResultDTO processResult = new RecruitmentProcessResultDTO();
List<RecruitmentResume> resumesAll = dto.getResumes(); recruitmentDemandService.recruitmentDemandProcess(dto, processResult);
Integer id = dto.getId();
if (CollectionUtils.isEmpty(resumesAll)) {
log.info("招聘需求id{} 无简历", id);
resumesAll = new ArrayList<>();
}
List<RecruitmentResume> resumesNew = resumesAll.stream().filter(resume -> Objects.isNull(resume.getId())).collect(Collectors.toList()); if (processResult.isHasResumeProcess() || processResult.isHasInterviewResult()) {
if (CollectionUtils.isNotEmpty(resumesNew)) { // 推送企微消息给招聘负责人
hasNewResume = true; Integer id = dto.getId();
log.info("招聘需求id{} 有新增简历", id); RecruitmentDemand currentDemand = recruitmentDemandService.getRecruitmentDemand(id);
} else { recruitmentDemandService.sendRecruitmentQWTextMessage(
log.info("招聘需求id{} 无新增简历", id); currentDemand.getRecruiterPhone(),
"招聘需求进度提醒",
"您的招聘需求的简历状态更新,请及时前往saas+增值业务运营平台查看处理。",
currentDemand.getId(),
currentDemand.getRecruiterName()
);
} }
recruitmentDemandService.recruitmentDemandProcess(dto); // TODO 推送多人
if (hasNewResume) { if (processResult.isHasNewResume()) {
recruitmentDemandService.newResumeQWMessage(dto); recruitmentDemandService.newResumeQWMessage(dto);
} }
return RpcResponse.success("success"); return RpcResponse.success("success");
......
...@@ -532,14 +532,15 @@ public class RecruitmentDemandService { ...@@ -532,14 +532,15 @@ public class RecruitmentDemandService {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "招聘需求不存在"); throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "招聘需求不存在");
} }
Byte currentStatus = currentDemand.getStatus(); RecruitmentDemandDTO updateDTO = new RecruitmentDemandDTO();
boolean isSupervisorConfirm = false; updateDTO.setId(dto.getId());
// 判断操作类型 // 判断操作类型
Byte currentStatus = currentDemand.getStatus();
if (status.compareTo(RecruitmentDemandStatusEnum.RECRUITING.getValue()) == 0) { if (status.compareTo(RecruitmentDemandStatusEnum.RECRUITING.getValue()) == 0) {
updateDTO.setStartTime(new Date());
if (Objects.equals(currentStatus, RecruitmentDemandStatusEnum.WAIT_SUPERVISOR_CONFIRM.getValue())) { if (Objects.equals(currentStatus, RecruitmentDemandStatusEnum.WAIT_SUPERVISOR_CONFIRM.getValue())) {
operationType = RecruitmentDemandLogOperationTypeEnum.SUPERVISOR_CONFIRM.getValue(); operationType = RecruitmentDemandLogOperationTypeEnum.SUPERVISOR_CONFIRM.getValue();
isSupervisorConfirm = true;
} else { } else {
operationType = RecruitmentDemandLogOperationTypeEnum.CONFIRM.getValue(); operationType = RecruitmentDemandLogOperationTypeEnum.CONFIRM.getValue();
} }
...@@ -552,8 +553,6 @@ public class RecruitmentDemandService { ...@@ -552,8 +553,6 @@ public class RecruitmentDemandService {
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "状态值非法"); throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "状态值非法");
} }
RecruitmentDemandDTO updateDTO = new RecruitmentDemandDTO();
updateDTO.setId(dto.getId());
updateDTO.setStatus(status); updateDTO.setStatus(status);
updateDTO.setRecallReason(dto.getRecallReason()); updateDTO.setRecallReason(dto.getRecallReason());
updateDTO.setUpdatedBy(dto.getUpdatedBy()); updateDTO.setUpdatedBy(dto.getUpdatedBy());
...@@ -568,27 +567,17 @@ public class RecruitmentDemandService { ...@@ -568,27 +567,17 @@ public class RecruitmentDemandService {
opLog.setUpdatedBy(dto.getUpdatedBy()); opLog.setUpdatedBy(dto.getUpdatedBy());
opLog.setUpdatedDate(new Date()); opLog.setUpdatedDate(new Date());
logMapper.insertSelective(opLog); logMapper.insertSelective(opLog);
// 督导确认后推送企微消息给招聘负责人(仅针对需要技术督导的业务类型)
if (isSupervisorConfirm && RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisor(currentDemand.getBusinessType())) {
sendRecruitmentQWTextMessage(
currentDemand.getRecruiterPhone(),
"新增招聘需求提醒",
"您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。",
currentDemand.getId(),
currentDemand.getRecruiterName()
);
}
} }
/** /**
* 处理招聘需求 * 处理招聘需求
* *
* @param dto * @param dto
* @param processResult 处理结果收集器,用于收集处理过程中的简历变更信息
*/ */
@GlsxDistributeLockable(name="'RecruitmentDemandService_recruitmentDemandProcess_' + #dto.id", timeoutException=RpcServiceException.class) @GlsxDistributeLockable(name="'RecruitmentDemandService_recruitmentDemandProcess_' + #dto.id", timeoutException=RpcServiceException.class)
@Transactional @Transactional
public void recruitmentDemandProcess(RecruitmentDemandDetailDTO dto) { public void recruitmentDemandProcess(RecruitmentDemandDetailDTO dto, RecruitmentProcessResultDTO processResult) {
List<RecruitmentResume> resumesAll = dto.getResumes(); List<RecruitmentResume> resumesAll = dto.getResumes();
List<RecruitmentOnboardingPlan> plansAll = dto.getOnboardingPlans(); List<RecruitmentOnboardingPlan> plansAll = dto.getOnboardingPlans();
List<RecruitmentTrialOnboarding> trialsAll = dto.getTrialOnboardings(); List<RecruitmentTrialOnboarding> trialsAll = dto.getTrialOnboardings();
...@@ -599,7 +588,7 @@ public class RecruitmentDemandService { ...@@ -599,7 +588,7 @@ public class RecruitmentDemandService {
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "简历数量限定100以内、入职数量限定30以内、试岗人数限定30以内"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "简历数量限定100以内、入职数量限定30以内、试岗人数限定30以内");
} }
recruitmentResumeService.processResumes(dto); recruitmentResumeService.processResumes(dto, processResult);
recruitmentOnboardingPlanService.processPlans(dto); recruitmentOnboardingPlanService.processPlans(dto);
recruitmentTrialOnboardingService.processTrials(dto); recruitmentTrialOnboardingService.processTrials(dto);
...@@ -667,6 +656,7 @@ public class RecruitmentDemandService { ...@@ -667,6 +656,7 @@ public class RecruitmentDemandService {
/** /**
* 新增简历推送企微应用消息 * 新增简历推送企微应用消息
* 嘀加智慧云-嘀加企微管家
* *
* @param dto * @param dto
*/ */
......
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.staff.service.recruitment; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.staff.service.recruitment;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDetailDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentDemandDetailDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentProcessResultDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentResumeDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentResumeDTO;
import cn.com.glsx.dj.staff.enums.*; import cn.com.glsx.dj.staff.enums.*;
import cn.com.glsx.dj.staff.mapper.RecruitmentResumeMapper; import cn.com.glsx.dj.staff.mapper.RecruitmentResumeMapper;
...@@ -150,9 +151,10 @@ public class RecruitmentResumeService { ...@@ -150,9 +151,10 @@ public class RecruitmentResumeService {
* 处理简历List * 处理简历List
* *
* @param dto * @param dto
* @param processResult 处理结果收集器,用于收集处理过程中的简历变更信息
*/ */
@Transactional @Transactional
public void processResumes(RecruitmentDemandDetailDTO dto) { public void processResumes(RecruitmentDemandDetailDTO dto, RecruitmentProcessResultDTO processResult) {
Integer demandId = dto.getId(); Integer demandId = dto.getId();
List<RecruitmentResume> resumesAll = dto.getResumes(); List<RecruitmentResume> resumesAll = dto.getResumes();
if (CollectionUtils.isEmpty(resumesAll)) { if (CollectionUtils.isEmpty(resumesAll)) {
...@@ -185,6 +187,9 @@ public class RecruitmentResumeService { ...@@ -185,6 +187,9 @@ public class RecruitmentResumeService {
recruitmentResumeMapper.updateByExampleSelective(resumeToDelete, resumeExampleToDel); recruitmentResumeMapper.updateByExampleSelective(resumeToDelete, resumeExampleToDel);
if (CollectionUtils.isNotEmpty(resumesAdd)) { if (CollectionUtils.isNotEmpty(resumesAdd)) {
// 收集:有新增简历,新增简历只算新增事件
processResult.setHasNewResume(true);
for (RecruitmentResume resume : resumesAdd) { for (RecruitmentResume resume : resumesAdd) {
if (Objects.nonNull(resume.getProcessResult())) { if (Objects.nonNull(resume.getProcessResult())) {
resume.setProcessorName(dto.getUpdatedBy()); resume.setProcessorName(dto.getUpdatedBy());
...@@ -238,6 +243,9 @@ public class RecruitmentResumeService { ...@@ -238,6 +243,9 @@ public class RecruitmentResumeService {
if (Objects.nonNull(oldProcessResult)) { if (Objects.nonNull(oldProcessResult)) {
Byte interviewResult = resume.getInterviewResult(); Byte interviewResult = resume.getInterviewResult();
if (Objects.nonNull(interviewResult)) { if (Objects.nonNull(interviewResult)) {
// 收集:有面试结果
processResult.setHasInterviewResult(true);
oldResume.setInterviewResult(interviewResult); oldResume.setInterviewResult(interviewResult);
oldResume.setInterviewTime(resume.getInterviewTime()); oldResume.setInterviewTime(resume.getInterviewTime());
oldResume.setInterviewExplanation(resume.getInterviewExplanation()); oldResume.setInterviewExplanation(resume.getInterviewExplanation());
...@@ -264,6 +272,9 @@ public class RecruitmentResumeService { ...@@ -264,6 +272,9 @@ public class RecruitmentResumeService {
oldResume.setDescription(resume.getDescription()); oldResume.setDescription(resume.getDescription());
if (Objects.nonNull(resume.getProcessResult())) { if (Objects.nonNull(resume.getProcessResult())) {
// 收集:有简历处理
processResult.setHasResumeProcess(true);
oldResume.setProcessResult(resume.getProcessResult()); oldResume.setProcessResult(resume.getProcessResult());
oldResume.setExpectedInterviewTime(resume.getExpectedInterviewTime()); oldResume.setExpectedInterviewTime(resume.getExpectedInterviewTime());
oldResume.setDescription(resume.getDescription()); oldResume.setDescription(resume.getDescription());
...@@ -272,6 +283,9 @@ public class RecruitmentResumeService { ...@@ -272,6 +283,9 @@ public class RecruitmentResumeService {
} }
if (Objects.nonNull(resume.getInterviewResult())) { if (Objects.nonNull(resume.getInterviewResult())) {
// 收集:有面试结果
processResult.setHasInterviewResult(true);
oldResume.setInterviewResult(resume.getInterviewResult()); oldResume.setInterviewResult(resume.getInterviewResult());
oldResume.setInterviewTime(resume.getInterviewTime()); oldResume.setInterviewTime(resume.getInterviewTime());
oldResume.setInterviewExplanation(resume.getInterviewExplanation()); oldResume.setInterviewExplanation(resume.getInterviewExplanation());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!