Commit ef300ae4 by 谢海旭

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

1 parent d6065c45
...@@ -90,4 +90,19 @@ public enum RecruitmentDemandBusinessTypeEnum { ...@@ -90,4 +90,19 @@ public enum RecruitmentDemandBusinessTypeEnum {
|| CAR_WRAP_TECHNICIAN.getValue().equals(businessType) || CAR_WRAP_TECHNICIAN.getValue().equals(businessType)
|| ACCESSORIES_TECHNICIAN.getValue().equals(businessType); || ACCESSORIES_TECHNICIAN.getValue().equals(businessType);
} }
/**
* 判断是否需要推送新增招聘需求消息
* 延保、权益、轻改、权益+延保、二手车验车专员需要推送消息
*/
public static boolean needsNewDemandMessage(String businessType) {
if (businessType == null) {
return false;
}
return EXTENDED_WARRANTY.getValue().equals(businessType)
|| RIGHTS.getValue().equals(businessType)
|| LIGHT_MODIFICATION.getValue().equals(businessType)
|| RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType)
|| USED_CAR_INSPECTOR.getValue().equals(businessType);
}
} }
...@@ -2,7 +2,7 @@ package cn.com.glsx.dj.staff.enums.recruitment; ...@@ -2,7 +2,7 @@ package cn.com.glsx.dj.staff.enums.recruitment;
/** /**
* 招聘需求 操作记录-操作类型 枚举 * 招聘需求 操作记录-操作类型 枚举
* 操作类型,1-创建 2-人事确认 3-驳回 4-新增简历 5-编辑简历 6-新增入职 7-完成 * 操作类型,1-创建 2-人事确认 3-驳回 4-新增简历 5-编辑简历 6-新增入职 7-完成 8-处理 9-督导确认
*/ */
public enum RecruitmentDemandLogOperationTypeEnum { public enum RecruitmentDemandLogOperationTypeEnum {
/** /**
...@@ -37,6 +37,10 @@ public enum RecruitmentDemandLogOperationTypeEnum { ...@@ -37,6 +37,10 @@ public enum RecruitmentDemandLogOperationTypeEnum {
* 8-处理 * 8-处理
*/ */
PROCESS((byte)8,"处理"), PROCESS((byte)8,"处理"),
/**
* 9-督导确认
*/
SUPERVISOR_CONFIRM((byte)9,"督导确认"),
; ;
private byte value; private byte value;
......
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.recruitment.RecruitmentDemandBusinessTypeEnum;
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;
...@@ -159,8 +160,15 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -159,8 +160,15 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
public RpcResponse<RecruitmentDemandDTO> recruitmentDemandAdd(RecruitmentDemandDTO dto) { public RpcResponse<RecruitmentDemandDTO> recruitmentDemandAdd(RecruitmentDemandDTO dto) {
try{ try{
RecruitmentDemandDTO result = recruitmentDemandService.recruitmentDemandAdd(dto); RecruitmentDemandDTO result = recruitmentDemandService.recruitmentDemandAdd(dto);
// 异步推送企微消息 if (RecruitmentDemandBusinessTypeEnum.needsNewDemandMessage(result.getBusinessType())) {
recruitmentDemandService.newDemandQWMessage(result); recruitmentDemandService.sendRecruitmentQWTextMessage(
result.getRecruiterPhone(),
"新增招聘需求提醒",
"您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。",
result.getId(),
result.getRecruiterName()
);
}
return RpcResponse.success(result); return RpcResponse.success(result);
}catch(Exception e){ }catch(Exception e){
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
......
...@@ -509,7 +509,7 @@ public class RecruitmentDemandService { ...@@ -509,7 +509,7 @@ public class RecruitmentDemandService {
} }
/** /**
* 更新招聘需求状态(操作:确认、驳回、完成) * 更新招聘需求状态(操作:确认、驳回、完成、督导确认)
* *
* @param dto * @param dto
*/ */
...@@ -518,19 +518,33 @@ public class RecruitmentDemandService { ...@@ -518,19 +518,33 @@ public class RecruitmentDemandService {
public void recruitmentDemandStatusUpdate(RecruitmentDemandDTO dto) { public void recruitmentDemandStatusUpdate(RecruitmentDemandDTO dto) {
Byte status = dto.getStatus(); Byte status = dto.getStatus();
byte operationType; byte operationType;
RecruitmentDemand currentDemand = recruitmentDemandMapper.selectByPrimaryKey(dto.getId());
if (currentDemand == null) {
log.error("招聘需求不存在,id:{}", dto.getId());
throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "招聘需求不存在");
}
Byte currentStatus = currentDemand.getStatus();
boolean isSupervisorConfirm = false;
// 判断操作类型
if (status.compareTo(RecruitmentDemandStatusEnum.RECRUITING.getValue()) == 0) { if (status.compareTo(RecruitmentDemandStatusEnum.RECRUITING.getValue()) == 0) {
operationType = RecruitmentDemandLogOperationTypeEnum.CONFIRM.getValue(); if (Objects.equals(currentStatus, RecruitmentDemandStatusEnum.WAIT_SUPERVISOR_CONFIRM.getValue())) {
operationType = RecruitmentDemandLogOperationTypeEnum.SUPERVISOR_CONFIRM.getValue();
isSupervisorConfirm = true;
} else {
operationType = RecruitmentDemandLogOperationTypeEnum.CONFIRM.getValue();
}
} else if (status.compareTo(RecruitmentDemandStatusEnum.COMPLETED.getValue()) == 0) { } else if (status.compareTo(RecruitmentDemandStatusEnum.COMPLETED.getValue()) == 0) {
operationType = RecruitmentDemandLogOperationTypeEnum.FINISH.getValue(); operationType = RecruitmentDemandLogOperationTypeEnum.FINISH.getValue();
} else if (status.compareTo(RecruitmentDemandStatusEnum.REJECTED.getValue()) == 0) { } else if (status.compareTo(RecruitmentDemandStatusEnum.REJECTED.getValue()) == 0) {
operationType = RecruitmentDemandLogOperationTypeEnum.REJECT.getValue(); operationType = RecruitmentDemandLogOperationTypeEnum.REJECT.getValue();
} else { } else {
log.error("状态值非法 status:{}", status); log.error("状态值非法 status:{}", status);
throw new RpcServiceException("状态值非法"); throw new RpcServiceException(DefaultErrorEnum.SERVICE_ERROR, "状态值非法");
} }
// TODO 添加状态顺序校验
RecruitmentDemandDTO updateDTO = new RecruitmentDemandDTO(); RecruitmentDemandDTO updateDTO = new RecruitmentDemandDTO();
updateDTO.setId(dto.getId()); updateDTO.setId(dto.getId());
updateDTO.setStatus(status); updateDTO.setStatus(status);
...@@ -539,14 +553,25 @@ public class RecruitmentDemandService { ...@@ -539,14 +553,25 @@ public class RecruitmentDemandService {
updateDTO.setUpdatedDate(new Date()); updateDTO.setUpdatedDate(new Date());
recruitmentDemandMapper.updateByPrimaryKeySelective(updateDTO); recruitmentDemandMapper.updateByPrimaryKeySelective(updateDTO);
RecruitmentDemandOperationLog log = new RecruitmentDemandOperationLog(); RecruitmentDemandOperationLog opLog = new RecruitmentDemandOperationLog();
log.setDemandId(dto.getId()); opLog.setDemandId(dto.getId());
log.setOperationType(operationType); opLog.setOperationType(operationType);
log.setCreatedBy(dto.getUpdatedBy()); opLog.setCreatedBy(dto.getUpdatedBy());
log.setCreatedDate(new Date()); opLog.setCreatedDate(new Date());
log.setUpdatedBy(dto.getUpdatedBy()); opLog.setUpdatedBy(dto.getUpdatedBy());
log.setUpdatedDate(new Date()); opLog.setUpdatedDate(new Date());
logMapper.insertSelective(log); logMapper.insertSelective(opLog);
// 督导确认后推送企微消息给招聘负责人(仅针对需要技术督导的业务类型)
if (isSupervisorConfirm && RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisor(currentDemand.getBusinessType())) {
sendRecruitmentQWTextMessage(
currentDemand.getRecruiterPhone(),
"新增招聘需求提醒",
"您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。",
currentDemand.getId(),
currentDemand.getRecruiterName()
);
}
} }
/** /**
...@@ -582,16 +607,19 @@ public class RecruitmentDemandService { ...@@ -582,16 +607,19 @@ public class RecruitmentDemandService {
} }
/** /**
* 新增招聘需求推送企微应用消息 * 通用推送企微文本消息方法
* 广联赛讯-嘀加企微管家 * 广联赛讯-嘀加企微管家
* *
* @param dto * @param recruiterPhone 招聘负责人手机号
* @param title 推送标题
* @param content 推送内容
* @param demandId 招聘需求ID(用于日志记录)
* @param recruiterName 招聘负责人姓名(用于日志记录)
*/ */
@Async @Async
public void newDemandQWMessage(RecruitmentDemandDTO dto) { public void sendRecruitmentQWTextMessage(String recruiterPhone, String title, String content, Integer demandId, String recruiterName) {
try { try {
String phone = dto.getRecruiterPhone(); if (StringUtils.isBlank(recruiterPhone)) {
if (StringUtils.isBlank(phone)) {
log.warn("招聘负责人手机号为空,无法推送企微消息"); log.warn("招聘负责人手机号为空,无法推送企微消息");
return; return;
} }
...@@ -599,13 +627,13 @@ public class RecruitmentDemandService { ...@@ -599,13 +627,13 @@ public class RecruitmentDemandService {
Integer merchantId = env.getProperty("new.demand.qw.message.merchant.id", Integer.class, 44211276); Integer merchantId = env.getProperty("new.demand.qw.message.merchant.id", Integer.class, 44211276);
String agentId = env.getProperty("new.demand.qw.message.agentId"); String agentId = env.getProperty("new.demand.qw.message.agentId");
if (StringUtils.isBlank(agentId)) { if (StringUtils.isBlank(agentId)) {
log.error("新增招聘需求推送企微消息参数缺失"); log.error("推送企微消息参数缺失");
return; return;
} }
String qwUserId = qwManager.getUserId(merchantId, phone); String qwUserId = qwManager.getUserId(merchantId, recruiterPhone);
if (StringUtils.isBlank(qwUserId)) { if (StringUtils.isBlank(qwUserId)) {
log.error("查询招聘负责人企微标识为空,手机号:{}", phone); log.error("查询招聘负责人企微标识为空,手机号:{}", recruiterPhone);
return; return;
} }
...@@ -616,17 +644,17 @@ public class RecruitmentDemandService { ...@@ -616,17 +644,17 @@ public class RecruitmentDemandService {
sendWorkWechatMessageRequestDTO.setAgentId(StringUtils.isBlank(agentId)? "1000136": agentId); sendWorkWechatMessageRequestDTO.setAgentId(StringUtils.isBlank(agentId)? "1000136": agentId);
WorkWechatTextMessageDTO text = new WorkWechatTextMessageDTO(); WorkWechatTextMessageDTO text = new WorkWechatTextMessageDTO();
text.setContent("新增招聘需求提醒\n您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。"); text.setContent(title + "\n" + content);
sendWorkWechatMessageRequestDTO.setText(text); sendWorkWechatMessageRequestDTO.setText(text);
SendWorkWechatMessageResponseDTO response = qwManager.sendMessage(sendWorkWechatMessageRequestDTO); SendWorkWechatMessageResponseDTO response = qwManager.sendMessage(sendWorkWechatMessageRequestDTO);
if (response != null && response.isSuccess()) { if (response != null && response.isSuccess()) {
log.info("新增招聘需求推送企微消息成功,招聘需求ID:{}, 招聘负责人:{}", dto.getId(), dto.getRecruiterName()); log.info("推送企微消息成功,招聘需求ID:{}, 招聘负责人:{}, 标题:{}", demandId, recruiterName, title);
} else { } else {
log.error("新增招聘需求推送企微消息失败,招聘需求ID:{}, response:{}", dto.getId(), JSON.toJSONString(response)); log.error("推送企微消息失败,招聘需求ID:{}, response:{}", demandId, JSON.toJSONString(response));
} }
} catch (Exception e) { } catch (Exception e) {
log.error("发送新增招聘需求企微应用消息异常", e); log.error("发送招聘企微应用消息异常,招聘需求ID:{}", demandId, e);
} }
} }
......
...@@ -222,52 +222,76 @@ public class RecruitmentResumeService { ...@@ -222,52 +222,76 @@ public class RecruitmentResumeService {
log.error("更新简历信息时“更新时间”字段必传,简历ID: {}", resume.getId()); log.error("更新简历信息时“更新时间”字段必传,简历ID: {}", resume.getId());
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "更新简历信息时“更新时间”字段必传"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "更新简历信息时“更新时间”字段必传");
} }
RecruitmentResume oldResume = oldResumeMap.get(resume.getId()); RecruitmentResume oldResume = oldResumeMap.get(resume.getId());
Byte oldProcessResult = oldResume.getProcessResult(); Byte oldInterviewResult = oldResume.getInterviewResult();
if (Objects.nonNull(oldProcessResult)) { if (Objects.nonNull(oldInterviewResult)) {
continue;
} else {
if (hasUpdate(resume, oldResume)) { if (hasUpdate(resume, oldResume)) {
log.info("简历状态已过期"); log.info("简历状态已过期");
throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "简历状态已过期,请确认后重新操作。"); throw new RpcServiceException(RpcErrorEnum.BUSINESS_ERROR, "简历状态已过期,请确认后重新操作。");
}
}
Byte oldProcessResult = oldResume.getProcessResult();
if (Objects.nonNull(oldProcessResult)) {
Byte interviewResult = resume.getInterviewResult();
if (Objects.nonNull(interviewResult)) {
oldResume.setInterviewResult(interviewResult);
oldResume.setInterviewTime(resume.getInterviewTime());
oldResume.setInterviewExplanation(resume.getInterviewExplanation());
oldResume.setInterviewProcessorName(dto.getUpdatedBy());
oldResume.setInterviewProcessTime(new Date());
Byte mixResult = getMixResult(resume);
if (Objects.nonNull(mixResult)) {
oldResume.setMixResult(mixResult);
}
oldResume.setUpdatedBy(dto.getUpdatedBy());
oldResume.setUpdatedDate(new Date());
recruitmentResumeMapper.updateByPrimaryKey(oldResume);
} else { } else {
continue; continue;
} }
} else { } else {
if (!hasUpdate(resume, oldResume)) { oldResume.setPersonName(resume.getPersonName());
log.info("简历无更新"); oldResume.setPhoneNumber(resume.getPhoneNumber());
continue; oldResume.setChannelType(resume.getChannelType());
oldResume.setChannelName(resume.getChannelName());
oldResume.setResumeUrl(resume.getResumeUrl());
oldResume.setResumeFileName(resume.getResumeFileName());
oldResume.setDescription(resume.getDescription());
if (Objects.nonNull(resume.getProcessResult())) {
oldResume.setProcessResult(resume.getProcessResult());
oldResume.setExpectedInterviewTime(resume.getExpectedInterviewTime());
oldResume.setDescription(resume.getDescription());
oldResume.setProcessorName(dto.getUpdatedBy());
oldResume.setProcessTime(new Date());
} }
}
Byte status = getStatus(resume); if (Objects.nonNull(resume.getInterviewResult())) {
resume.setStatus(status); oldResume.setInterviewResult(resume.getInterviewResult());
if (Objects.isNull(status)) { oldResume.setInterviewTime(resume.getInterviewTime());
resume.setStatus(oldResume.getStatus()); oldResume.setInterviewExplanation(resume.getInterviewExplanation());
} oldResume.setInterviewProcessorName(dto.getUpdatedBy());
oldResume.setInterviewProcessTime(new Date());
}
Byte mixResult = getMixResult(resume); Byte status = getStatus(resume);
resume.setMixResult(mixResult); if (Objects.nonNull(status)) {
if (Objects.isNull(mixResult)) { oldResume.setStatus(status);
resume.setMixResult(oldResume.getMixResult()); }
}
Byte mixResult = getMixResult(resume);
if (Objects.nonNull(resume.getProcessResult()) && Objects.isNull(oldResume.getProcessResult())) { if (Objects.nonNull(mixResult)) {
resume.setProcessorName(dto.getUpdatedBy()); oldResume.setMixResult(mixResult);
resume.setProcessTime(new Date()); }
} oldResume.setUpdatedBy(dto.getUpdatedBy());
oldResume.setUpdatedDate(new Date());
if (Objects.nonNull(resume.getInterviewResult()) && Objects.isNull(oldResume.getInterviewResult())) { recruitmentResumeMapper.updateByPrimaryKey(oldResume);
resume.setInterviewProcessorName(dto.getUpdatedBy());
resume.setInterviewProcessTime(new Date());
} }
resume.setUpdatedBy(dto.getUpdatedBy());
resume.setUpdatedDate(new Date());
resume.setDemandId(oldResume.getDemandId());
resume.setCreatedBy(oldResume.getCreatedBy());
resume.setCreatedDate(oldResume.getCreatedDate());
resume.setDeletedFlag(oldResume.getDeletedFlag());
recruitmentResumeMapper.updateByPrimaryKey(resume);
} }
} }
} }
......
...@@ -101,8 +101,15 @@ public class RecruitmentDemandServiceTest extends BaseServiceTest { ...@@ -101,8 +101,15 @@ public class RecruitmentDemandServiceTest extends BaseServiceTest {
@Test @Test
public void testNewDemandQWMessage() { public void testNewDemandQWMessage() {
RecruitmentDemandDTO dto = new RecruitmentDemandDTO(); RecruitmentDemandDTO dto = new RecruitmentDemandDTO();
dto.setId(1);
dto.setRecruiterPhone("13603070903"); dto.setRecruiterPhone("13603070903");
dto.setRecruiterName("xiehx"); dto.setRecruiterName("xiehx");
recruitmentDemandService.newDemandQWMessage(dto); recruitmentDemandService.sendRecruitmentQWTextMessage(
dto.getRecruiterPhone(),
"新增招聘需求提醒",
"您有新的招聘需求待跟进,请及时前往saas+增值业务运营平台查看处理。",
dto.getId(),
dto.getRecruiterName()
);
} }
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!