Commit 5ce36ed4 by 谢海旭

202601月中版本 招聘管理:给技术督导推送消息

1 parent 31a2f033
...@@ -119,4 +119,12 @@ public enum RecruitmentDemandBusinessTypeEnum { ...@@ -119,4 +119,12 @@ public enum RecruitmentDemandBusinessTypeEnum {
|| LIGHT_MODIFICATION.getValue().equals(businessType) || LIGHT_MODIFICATION.getValue().equals(businessType)
|| RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType); || RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType);
} }
/**
* 判断是否需要推送给技术督导的消息
* 窗膜技师、三膜技师、车衣技师、精品技师业务类型需要推送给技术督导
*/
public static boolean needsTechnicalSupervisorMessage(String businessType) {
return needsTechnicalSupervisor(businessType);
}
} }
package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Title: RecruitmentResume24HoursUnprocessedReminderForSupervisorJob
* @Description: 招聘需求24小时未处理简历提醒-技术督导 任务
* @Author xiehx
* @Date 2025/01/06
**/
@Service
@Slf4j
@ElasticJobConf(name = "RecruitmentResume24HoursUnprocessedReminderForSupervisorJob", cron = "32 * * * * ?", description = "招聘需求24小时未处理简历提醒-技术督导 任务", overwrite = false)
public class RecruitmentResume24HoursUnprocessedReminderForSupervisorJob implements SimpleJob {
@Autowired
private RecruitmentDemandService recruitmentDemandService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("招聘需求24小时未处理简历提醒-技术督导任务开始");
try {
recruitmentDemandService.checkAndRemindUnprocessedResumeIn24HoursForSupervisor();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("招聘需求24小时未处理简历提醒-技术督导任务结束");
}
}
package cn.com.glsx.dj.staff.job;
import cn.com.glsx.dj.staff.service.recruitment.RecruitmentDemandService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Title: RecruitmentResume48HoursUnprocessedReminderForSupervisorJob
* @Description: 招聘需求48小时未处理简历提醒-技术督导 任务
* @Author xiehx
* @Date 2025/01/06
**/
@Service
@Slf4j
@ElasticJobConf(name = "RecruitmentResume48HoursUnprocessedReminderForSupervisorJob", cron = "32 * * * * ?", description = "招聘需求48小时未处理简历提醒-技术督导 任务", overwrite = false)
public class RecruitmentResume48HoursUnprocessedReminderForSupervisorJob implements SimpleJob {
@Autowired
private RecruitmentDemandService recruitmentDemandService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("招聘需求48小时未处理简历提醒-技术督导任务开始");
try {
recruitmentDemandService.checkAndRemindUnprocessedResumeIn48HoursForSupervisor();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("招聘需求48小时未处理简历提醒-技术督导任务结束");
}
}
...@@ -33,4 +33,18 @@ public interface RecruitmentDemandMapper extends OreMapper<RecruitmentDemand> { ...@@ -33,4 +33,18 @@ public interface RecruitmentDemandMapper extends OreMapper<RecruitmentDemand> {
* @return 招聘需求列表 * @return 招聘需求列表
*/ */
List<RecruitmentDemand> find48HoursUnprocessedResumeDemands(); List<RecruitmentDemand> find48HoursUnprocessedResumeDemands();
/**
* 查询24小时未处理简历的招聘需求(技术督导)
* 业务类型=窗膜技师、4、三膜技师、6、车衣技师、7、精品技师、8
* @return 招聘需求列表
*/
List<RecruitmentDemand> find24HoursUnprocessedResumeDemandsForSupervisor();
/**
* 查询48小时未处理简历的招聘需求(技术督导)
* 业务类型=窗膜技师、4、三膜技师、6、车衣技师、7、精品技师、8
* @return 招聘需求列表
*/
List<RecruitmentDemand> find48HoursUnprocessedResumeDemandsForSupervisor();
} }
\ No newline at end of file \ No newline at end of file
...@@ -121,13 +121,26 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -121,13 +121,26 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
// TODO 推送多人 // TODO 推送多人
if (processResult.isHasNewResume()) { if (processResult.isHasNewResume()) {
// 推送区域运营 Integer id = dto.getId();
RecruitmentDemand currentDemand = recruitmentDemandService.getRecruitmentDemand(id);
// 推送区域运营(延保、权益、轻改、权益+延保)
recruitmentDemandService.sendRegionOperationQWMessage( recruitmentDemandService.sendRegionOperationQWMessage(
dto.getId(), dto.getId(),
"招聘进度提醒", "招聘进度提醒",
"您的招聘需求有新的简历投递,请点击查看处理。", "您的招聘需求有新的简历投递,请点击查看处理。",
"新增简历推送" "新增简历推送区域运营"
); );
// 推送技术督导(窗膜技师、三膜技师、车衣技师、精品技师)
if (RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisorMessage(currentDemand.getBusinessType())) {
recruitmentDemandService.sendTechnicalSupervisorQWMessage(
dto.getId(),
"招聘进度提醒",
"您的招聘需求有新的简历投递,请点击查看处理。",
"新增简历推送技术督导"
);
}
} }
return RpcResponse.success("success"); return RpcResponse.success("success");
}catch(RpcServiceException e){ }catch(RpcServiceException e){
...@@ -186,6 +199,8 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -186,6 +199,8 @@ 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())) { if (RecruitmentDemandBusinessTypeEnum.needsNewDemandMessage(result.getBusinessType())) {
recruitmentDemandService.sendRecruitmentQWTextMessage( recruitmentDemandService.sendRecruitmentQWTextMessage(
result.getRecruiterPhone(), result.getRecruiterPhone(),
...@@ -195,6 +210,17 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{ ...@@ -195,6 +210,17 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
result.getRecruiterName() result.getRecruiterName()
); );
} }
// 推送给技术督导(窗膜技师、三膜技师、车衣技师、精品技师)
if (RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisorMessage(result.getBusinessType())) {
recruitmentDemandService.sendTechnicalSupervisorQWMessage(
result.getId(),
"招聘进度提醒",
"您有新的招聘需求待跟进,请点击查看处理。",
"新增招聘需求推送技术督导"
);
}
return RpcResponse.success(result); return RpcResponse.success(result);
}catch(Exception e){ }catch(Exception e){
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
......
...@@ -655,6 +655,91 @@ public class RecruitmentDemandService { ...@@ -655,6 +655,91 @@ public class RecruitmentDemandService {
} }
/** /**
* 通用方法:给技术督导推送企微应用消息
* 嘀加智慧云-嘀加企微管家
*
* 场景:在后台新增招聘需求(业务类型=窗膜技师、三膜技师、车衣技师、精品技师)并成功保存后,
* 向招聘需求关联的技术督导推送消息提醒
*
* @param demandId 招聘需求ID
* @param title 消息标题
* @param description 消息描述
* @param logDesc 日志描述
*/
@Async
public void sendTechnicalSupervisorQWMessage(Integer demandId, String title, String description, String logDesc) {
try {
// 1. 查询招聘需求信息
RecruitmentDemand demand = recruitmentDemandMapper.selectByPrimaryKey(demandId);
if (demand == null) {
log.error("{} - 招聘需求不存在,demandId:{}", logDesc, demandId);
return;
}
// 2. 判断业务类型是否需要推送(窗膜技师、三膜技师、车衣技师、精品技师)
if (!RecruitmentDemandBusinessTypeEnum.needsTechnicalSupervisorMessage(demand.getBusinessType())) {
log.info("{} - 业务类型不在推送范围内,demandId:{}, businessType:{}",
logDesc, demandId, demand.getBusinessType());
return;
}
// 3. 获取技术督导信息
String technicalSupervisorPhone = demand.getTechnicalSupervisorPhone();
String technicalSupervisorName = demand.getTechnicalSupervisorName();
if (StringUtils.isBlank(technicalSupervisorPhone)) {
log.error("{} - 招聘需求没有技术督导信息,demandId:{}", logDesc, demandId);
return;
}
log.info("{} - 技术督导:{} 手机号:{}", logDesc, technicalSupervisorName, technicalSupervisorPhone);
// 4. 查询企微用户ID
Map<String, String> sendUserIds = getSendUserIds();
if (sendUserIds == null || sendUserIds.isEmpty()) {
log.error("{} - 获取企微用户列表失败,demandId:{}", logDesc, demandId);
return;
}
String qwUserId = sendUserIds.get(technicalSupervisorPhone);
if (StringUtils.isBlank(qwUserId)) {
log.error("{} - 查询技术督导企微标识为空,demandId:{}, phone:{}", logDesc, demandId, technicalSupervisorPhone);
return;
}
// 5. 获取H5页面URL
String h5BaseUrl = env.getProperty("dj.technical.supervisor.h5.base.url");
String h5RecruitmentListPath = env.getProperty("dj.technical.supervisor.h5.recruitment.list.path");
if (StringUtils.isBlank(h5BaseUrl) || StringUtils.isBlank(h5RecruitmentListPath)) {
log.error("{} - H5页面配置参数缺失,h5BaseUrl:{}, h5RecruitmentListPath:{}", logDesc, h5BaseUrl, h5RecruitmentListPath);
return;
}
// 拼接H5完整URL
String h5Url = h5BaseUrl + h5RecruitmentListPath;
// 6. 发送H5卡片通知消息
boolean success = sendDJCloudWechatTextCardMessage(
qwUserId,
title,
description,
h5Url,
logDesc + "-demandId:" + demandId
);
if (success) {
log.info("{} - 推送成功,demandId:{}, 技术督导:{}, qwUserId:{}",
logDesc, demandId, technicalSupervisorName, qwUserId);
} else {
log.error("{} - 推送失败,demandId:{}, 技术督导:{}",
logDesc, demandId, technicalSupervisorName);
}
} catch (Exception e) {
log.error("{} - 推送异常,demandId:{}", logDesc, demandId, e);
}
}
/**
* 通用方法:给区域运营推送企微应用消息 * 通用方法:给区域运营推送企微应用消息
* 嘀加智慧云-嘀加企微管家 * 嘀加智慧云-嘀加企微管家
* *
...@@ -944,16 +1029,6 @@ public class RecruitmentDemandService { ...@@ -944,16 +1029,6 @@ public class RecruitmentDemandService {
} }
/** /**
* 发送企微文本消息(已废弃,请使用sendDJCloudWechatMessage)
*
* @deprecated 请使用 {@link #sendDJCloudWechatMessage(SendWorkWechatMessageRequestDTO, String)}
*/
@Deprecated
public boolean sendSingleWechatMessage(SendWorkWechatMessageRequestDTO sendWorkWechatMessageRequestDTO) {
return sendDJCloudWechatMessage(sendWorkWechatMessageRequestDTO, "企微消息");
}
/**
* web端招聘需求统计 * web端招聘需求统计
* *
* @param dto * @param dto
...@@ -1104,8 +1179,6 @@ public class RecruitmentDemandService { ...@@ -1104,8 +1179,6 @@ public class RecruitmentDemandService {
/** /**
* 检查并提醒72小时未投递简历的招聘需求 * 检查并提醒72小时未投递简历的招聘需求
* 1、查询符合条件的招聘需求集合
* 2、遍历集合For里推送企微消息(面向招聘负责人-广联赛讯-嘀加企微管家)
*/ */
public void checkAndRemindNoResumeIn72Hours() { public void checkAndRemindNoResumeIn72Hours() {
try { try {
...@@ -1141,8 +1214,6 @@ public class RecruitmentDemandService { ...@@ -1141,8 +1214,6 @@ public class RecruitmentDemandService {
/** /**
* 检查并提醒24小时未处理简历的招聘需求 * 检查并提醒24小时未处理简历的招聘需求
* 1、查询符合条件的招聘需求集合(业务类型=延保、权益、轻改、权益+延保)
* 2、遍历集合For里推送企微消息(面向区域运营-嘀加智慧云-嘀加企微管家)
*/ */
public void checkAndRemindUnprocessedResumeIn24Hours() { public void checkAndRemindUnprocessedResumeIn24Hours() {
try { try {
...@@ -1178,8 +1249,6 @@ public class RecruitmentDemandService { ...@@ -1178,8 +1249,6 @@ public class RecruitmentDemandService {
/** /**
* 检查并提醒48小时未处理简历的招聘需求 * 检查并提醒48小时未处理简历的招聘需求
* 1、查询符合条件的招聘需求集合(业务类型=延保、权益、轻改、权益+延保)
* 2、遍历集合For里推送企微消息(面向区域运营-嘀加智慧云-嘀加企微管家)
*/ */
public void checkAndRemindUnprocessedResumeIn48Hours() { public void checkAndRemindUnprocessedResumeIn48Hours() {
try { try {
...@@ -1212,4 +1281,74 @@ public class RecruitmentDemandService { ...@@ -1212,4 +1281,74 @@ public class RecruitmentDemandService {
log.error("检查招聘需求48小时未处理简历异常", e); log.error("检查招聘需求48小时未处理简历异常", e);
} }
} }
/**
* 检查并提醒24小时未处理简历的招聘需求(技术督导)
*/
public void checkAndRemindUnprocessedResumeIn24HoursForSupervisor() {
try {
List<RecruitmentDemand> demands = recruitmentDemandMapper.find24HoursUnprocessedResumeDemandsForSupervisor();
if (CollectionUtils.isEmpty(demands)) {
log.info("没有找到符合条件的招聘需求(技术督导-24小时未处理简历)");
return;
}
log.info("开始处理技术督导24小时未处理简历提醒,共 {} 条招聘需求", demands.size());
int successCount = 0;
for (RecruitmentDemand demand : demands) {
try {
log.info("开始处理招聘需求ID:{},技术督导:{}", demand.getId(), demand.getTechnicalSupervisorName());
sendTechnicalSupervisorQWMessage(
demand.getId(),
"招聘进度提醒",
"您的招聘需求已超过24小时未完成简历处理,请点击查看处理。",
"24小时未处理提醒-技术督导"
);
successCount++;
} catch (Exception e) {
log.error("处理招聘需求ID:{} 推送技术督导24小时未处理消息异常", demand.getId(), e);
}
}
log.info("技术督导24小时未处理简历检查完成,共处理 {} 条招聘需求,成功推送 {} 条", demands.size(), successCount);
} catch (Exception e) {
log.error("检查技术督导招聘需求24小时未处理简历异常", e);
}
}
/**
* 检查并提醒48小时未处理简历的招聘需求(技术督导)
*/
public void checkAndRemindUnprocessedResumeIn48HoursForSupervisor() {
try {
List<RecruitmentDemand> demands = recruitmentDemandMapper.find48HoursUnprocessedResumeDemandsForSupervisor();
if (CollectionUtils.isEmpty(demands)) {
log.info("没有找到符合条件的招聘需求(技术督导-48小时未处理简历)");
return;
}
log.info("开始处理技术督导48小时未处理简历提醒,共 {} 条招聘需求", demands.size());
int successCount = 0;
for (RecruitmentDemand demand : demands) {
try {
log.info("开始处理招聘需求ID:{},技术督导:{}", demand.getId(), demand.getTechnicalSupervisorName());
sendTechnicalSupervisorQWMessage(
demand.getId(),
"招聘进度提醒",
"您的招聘需求已超过48小时未完成简历处理,请点击查看处理。",
"48小时未处理提醒-技术督导"
);
successCount++;
} catch (Exception e) {
log.error("处理招聘需求ID:{} 推送技术督导48小时未处理消息异常", demand.getId(), e);
}
}
log.info("技术督导48小时未处理简历检查完成,共处理 {} 条招聘需求,成功推送 {} 条", demands.size(), successCount);
} catch (Exception e) {
log.error("检查技术督导招聘需求48小时未处理简制历异常", e);
}
}
} }
...@@ -218,4 +218,50 @@ ...@@ -218,4 +218,50 @@
) )
ORDER BY d.id DESC ORDER BY d.id DESC
</select> </select>
<select id="find24HoursUnprocessedResumeDemandsForSupervisor" resultMap="BaseResultMap">
SELECT
d.id, d.merchant_name, d.merchant_id, d.region_operation_id, d.region_operation_name,
d.business_type, d.business_type_name, d.recruitment_quantity, d.recruitment_type,
d.recruitment_type_name, d.requirement_description, d.recruiter_name, d.recruiter_phone,
d.technical_supervisor_name, d.technical_supervisor_phone, d.recall_reason,
d.province_city, d.status, d.urgent, d.start_time, d.confirm_flag,
d.created_uuid, d.created_by, d.created_date, d.updated_by, d.updated_date, d.deleted_flag
FROM dj_car_life_recruitment_demand d
WHERE d.status = 1
AND d.deleted_flag = 'N'
AND d.business_type IN ('4', '6', '7', '8')
AND EXISTS (
SELECT 1
FROM dj_car_life_recruitment_resume r
WHERE r.demand_id = d.id
AND r.deleted_flag = 'N'
AND r.process_result IS NULL
AND TIMESTAMPDIFF(MINUTE, r.created_date, NOW()) = 1440
)
ORDER BY d.id DESC
</select>
<select id="find48HoursUnprocessedResumeDemandsForSupervisor" resultMap="BaseResultMap">
SELECT
d.id, d.merchant_name, d.merchant_id, d.region_operation_id, d.region_operation_name,
d.business_type, d.business_type_name, d.recruitment_quantity, d.recruitment_type,
d.recruitment_type_name, d.requirement_description, d.recruiter_name, d.recruiter_phone,
d.technical_supervisor_name, d.technical_supervisor_phone, d.recall_reason,
d.province_city, d.status, d.urgent, d.start_time, d.confirm_flag,
d.created_uuid, d.created_by, d.created_date, d.updated_by, d.updated_date, d.deleted_flag
FROM dj_car_life_recruitment_demand d
WHERE d.status = 1
AND d.deleted_flag = 'N'
AND d.business_type IN ('4', '6', '7', '8')
AND EXISTS (
SELECT 1
FROM dj_car_life_recruitment_resume r
WHERE r.demand_id = d.id
AND r.deleted_flag = 'N'
AND r.process_result IS NULL
AND TIMESTAMPDIFF(MINUTE, r.created_date, NOW()) = 2880
)
ORDER BY d.id DESC
</select>
</mapper> </mapper>
\ 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!