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