Commit 31a2f033 by 谢海旭

202601月中版本 招聘管理:给区域运营推送消息

1 parent d059e398
......@@ -105,4 +105,18 @@ public enum RecruitmentDemandBusinessTypeEnum {
|| RIGHTS_EXTENDED_WARRANTY.getValue().equals(businessType)
|| USED_CAR_INSPECTOR.getValue().equals(businessType);
}
/**
* 判断是否需要推送给区域运营的消息
* 延保、权益、轻改、权益+延保业务类型需要推送给区域运营
*/
public static boolean needsRegionOperationMessage(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);
}
}
......@@ -11,8 +11,8 @@ import org.springframework.stereotype.Service;
/**
* @Title: RecruitmentDemandNoResumeReminderJob
* @Description: 招聘需求72小时未投递简历提醒 任务
* @Author system
* @Date 2025/01/01
* @Author xiehx
* @Date 2025/01/06
**/
@Service
@Slf4j
......
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: RecruitmentResume24HoursUnprocessedReminderJob
* @Description: 招聘需求24小时未处理简历提醒 任务
* @Author xiehx
* @Date 2025/01/06
**/
@Service
@Slf4j
@ElasticJobConf(name = "RecruitmentResume24HoursUnprocessedReminderJob", cron = "32 * * * * ?", description = "招聘需求24小时未处理简历提醒 任务", overwrite = false)
public class RecruitmentResume24HoursUnprocessedReminderJob implements SimpleJob {
@Autowired
private RecruitmentDemandService recruitmentDemandService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("招聘需求24小时未处理简历提醒任务开始");
try {
recruitmentDemandService.checkAndRemindUnprocessedResumeIn24Hours();
} 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: RecruitmentResume48HoursUnprocessedReminderJob
* @Description: 招聘需求48小时未处理简历提醒 任务
* @Author xiehx
* @Date 2025/01/06
**/
@Service
@Slf4j
@ElasticJobConf(name = "RecruitmentResume48HoursUnprocessedReminderJob", cron = "32 * * * * ?", description = "招聘需求48小时未处理简历提醒 任务", overwrite = false)
public class RecruitmentResume48HoursUnprocessedReminderJob implements SimpleJob {
@Autowired
private RecruitmentDemandService recruitmentDemandService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("招聘需求48小时未处理简历提醒任务开始");
try {
recruitmentDemandService.checkAndRemindUnprocessedResumeIn48Hours();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
log.info("招聘需求48小时未处理简历提醒任务结束");
}
}
......@@ -21,4 +21,16 @@ public interface RecruitmentDemandMapper extends OreMapper<RecruitmentDemand> {
* @return 招聘需求列表
*/
List<RecruitmentDemand> find72HoursNoResumeDemands();
/**
* 查询24小时未处理简历的招聘需求
* @return 招聘需求列表
*/
List<RecruitmentDemand> find24HoursUnprocessedResumeDemands();
/**
* 查询48小时未处理简历的招聘需求
* @return 招聘需求列表
*/
List<RecruitmentDemand> find48HoursUnprocessedResumeDemands();
}
\ No newline at end of file
......@@ -121,7 +121,13 @@ public class RecruitmentDemandRemoteImpl implements RecruitmentDemandRemote{
// TODO 推送多人
if (processResult.isHasNewResume()) {
recruitmentDemandService.newResumeQWMessage(dto);
// 推送区域运营
recruitmentDemandService.sendRegionOperationQWMessage(
dto.getId(),
"招聘进度提醒",
"您的招聘需求有新的简历投递,请点击查看处理。",
"新增简历推送"
);
}
return RpcResponse.success("success");
}catch(RpcServiceException e){
......
......@@ -17,6 +17,12 @@ public class QWManager {
@Autowired
private Environment environment;
/**
* 通过http请求发送企微应用消息
*
* @param sendWorkWechatMessageRequestDTO
* @return
*/
public SendWorkWechatMessageResponseDTO sendMessage(
SendWorkWechatMessageRequestDTO sendWorkWechatMessageRequestDTO) {
log.info("发送企微应用消息:{}", JSON.toJSONString(sendWorkWechatMessageRequestDTO));
......
......@@ -163,7 +163,7 @@
WHERE d.status = 1
AND d.deleted_flag = 'N'
AND d.start_time IS NOT NULL
AND TIMESTAMPDIFF(HOUR, d.start_time, NOW()) = 72
AND TIMESTAMPDIFF(MINUTE, d.start_time, NOW()) = 4320
AND NOT EXISTS (
SELECT 1
FROM dj_car_life_recruitment_resume r
......@@ -172,4 +172,50 @@
)
ORDER BY d.id DESC
</select>
<select id="find24HoursUnprocessedResumeDemands" 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 ('1', '2', '3', '5')
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="find48HoursUnprocessedResumeDemands" 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 ('1', '2', '3', '5')
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>
\ No newline at end of file
......@@ -73,15 +73,12 @@ public class RecruitmentDemandServiceTest extends BaseServiceTest {
@Test
public void testNewResumeQWMessage() {
RecruitmentDemandDetailDTO dto = new RecruitmentDemandDetailDTO();
dto.setId(84);
ArrayList<RecruitmentResume> resumes = Lists.newArrayList();
RecruitmentResume e = new RecruitmentResume();
e.setProcessorName("test");
resumes.add(e);
dto.setResumes(resumes);
recruitmentDemandService.newResumeQWMessage(dto);
recruitmentDemandService.sendRegionOperationQWMessage(
84,
"招聘进度提醒",
"您的招聘需求有新的简历投递,请点击查看处理。",
"场景1-新增简历推送"
);
}
@Test
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!