Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ddd3f49f
authored
Jan 08, 2026
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
202601月中版本 招聘管理:推送区域运营消息逻辑调整
1 parent
40fc9ddf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
138 deletions
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/RecruitmentResume24HoursUnprocessedReminderJob.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/RecruitmentResume48HoursUnprocessedReminderJob.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/recruitment/RecruitmentDemandService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/RecruitmentResume24HoursUnprocessedReminderJob.java
View file @
ddd3f49
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
**/
**/
@Service
@Service
@Slf4j
@Slf4j
@ElasticJobConf
(
name
=
"RecruitmentResume24HoursUnprocessedReminderJob"
,
cron
=
"32 * * * * ?"
,
description
=
"招聘需求24小时未处理简历提醒 任务"
,
overwrite
=
false
)
@ElasticJobConf
(
name
=
"RecruitmentResume24HoursUnprocessedReminderJob"
,
cron
=
"32 * * * * ?"
,
description
=
"
面向区域运营-
招聘需求24小时未处理简历提醒 任务"
,
overwrite
=
false
)
public
class
RecruitmentResume24HoursUnprocessedReminderJob
implements
SimpleJob
{
public
class
RecruitmentResume24HoursUnprocessedReminderJob
implements
SimpleJob
{
@Autowired
@Autowired
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/RecruitmentResume48HoursUnprocessedReminderJob.java
View file @
ddd3f49
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
...
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
**/
**/
@Service
@Service
@Slf4j
@Slf4j
@ElasticJobConf
(
name
=
"RecruitmentResume48HoursUnprocessedReminderJob"
,
cron
=
"32 * * * * ?"
,
description
=
"招聘需求48小时未处理简历提醒 任务"
,
overwrite
=
false
)
@ElasticJobConf
(
name
=
"RecruitmentResume48HoursUnprocessedReminderJob"
,
cron
=
"32 * * * * ?"
,
description
=
"
面向区域运营-
招聘需求48小时未处理简历提醒 任务"
,
overwrite
=
false
)
public
class
RecruitmentResume48HoursUnprocessedReminderJob
implements
SimpleJob
{
public
class
RecruitmentResume48HoursUnprocessedReminderJob
implements
SimpleJob
{
@Autowired
@Autowired
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/recruitment/RecruitmentDemandService.java
View file @
ddd3f49
...
@@ -839,89 +839,45 @@ public class RecruitmentDemandService {
...
@@ -839,89 +839,45 @@ public class RecruitmentDemandService {
@Async
@Async
public
void
sendRegionOperationQWMessage
(
Integer
demandId
,
String
title
,
String
description
,
String
logDesc
)
{
public
void
sendRegionOperationQWMessage
(
Integer
demandId
,
String
title
,
String
description
,
String
logDesc
)
{
try
{
try
{
// 1. 查询招聘需求信息
RecruitmentDemand
demand
=
recruitmentDemandMapper
.
selectByPrimaryKey
(
demandId
);
RecruitmentDemand
demand
=
recruitmentDemandMapper
.
selectByPrimaryKey
(
demandId
);
if
(
demand
==
null
)
{
String
staffUUID
=
demand
.
getRegionOperationId
();
log
.
error
(
"{} - 招聘需求不存在,demandId:{}"
,
logDesc
,
demandId
);
return
;
log
.
info
(
"门店区域运营经理:{} 手机号查询参数:{}"
,
demand
.
getRegionOperationName
(),
staffUUID
);
}
RpcResponse
<
StaffInfoDTO
>
staffInfoRes
=
staffInfoRemote
.
getByStaffUuid
(
staffUUID
);
log
.
info
(
"门店区域运营经理手机号查询结果:{}"
,
JSON
.
toJSONString
(
staffInfoRes
));
// 2. 判断业务类型是否需要推送(延保、权益、轻改、权益+延保)
if
(!
RecruitmentDemandBusinessTypeEnum
.
needsRegionOperationMessage
(
demand
.
getBusinessType
()))
{
log
.
info
(
"{} - 业务类型不在推送范围内,demandId:{}, businessType:{}"
,
logDesc
,
demandId
,
demand
.
getBusinessType
());
return
;
}
// 3. 获取区域运营信息
String
regionOperationId
=
demand
.
getRegionOperationId
();
if
(
StringUtils
.
isBlank
(
regionOperationId
))
{
log
.
error
(
"{} - 招聘需求没有区域运营信息,demandId:{}"
,
logDesc
,
demandId
);
return
;
}
log
.
info
(
"{} - 区域运营:{} 手机号查询参数:{}"
,
logDesc
,
demand
.
getRegionOperationName
(),
regionOperationId
);
RpcResponse
<
StaffInfoDTO
>
staffInfoRes
=
staffInfoRemote
.
getByStaffUuid
(
regionOperationId
);
log
.
info
(
"{} - 区域运营手机号查询结果:{}"
,
logDesc
,
JSON
.
toJSONString
(
staffInfoRes
));
if
(!
staffInfoRes
.
hasResult
())
{
log
.
error
(
"{} - 查询区域运营信息失败,demandId:{}"
,
logDesc
,
demandId
);
return
;
}
StaffInfoDTO
staffInfo
=
staffInfoRes
.
getResult
();
StaffInfoDTO
staffInfo
=
staffInfoRes
.
getResult
();
String
phoneNumber
=
staffInfo
.
getPhoneNumber
();
if
(
StringUtils
.
isBlank
(
phoneNumber
))
{
log
.
error
(
"{} - 区域运营手机号为空,demandId:{}"
,
logDesc
,
demandId
);
return
;
}
// 4. 查询企微用户ID
Map
<
String
,
String
>
sendUserIds
=
getSendUserIds
();
Map
<
String
,
String
>
sendUserIds
=
getSendUserIds
();
if
(
sendUserIds
==
null
||
sendUserIds
.
isEmpty
())
{
String
qwUserId
=
sendUserIds
.
get
(
staffInfo
.
getPhoneNumber
());
log
.
error
(
"{} - 获取企微用户列表失败,demandId:{}"
,
logDesc
,
demandId
);
return
;
}
String
qwUserId
=
sendUserIds
.
get
(
phoneNumber
);
if
(
StringUtils
.
isBlank
(
qwUserId
))
{
if
(
StringUtils
.
isBlank
(
qwUserId
))
{
log
.
error
(
"
{} - 查询区域运营企微标识为空,demandId:{}, phone:{}"
,
logDesc
,
demandId
,
phoneNumber
);
log
.
error
(
"
查询门店区域运营经理企微标识为空"
);
return
;
return
;
}
}
// 5. 获取小程序路径参数
Integer
sendWorkWechatMerchantId
=
env
.
getProperty
(
"dj.send.work.wechat.merchant.id"
,
Integer
.
class
,
44211227
);
String
appId
=
env
.
getProperty
(
"dj.region.operation.miniprogram.appid"
);
String
url
=
env
.
getProperty
(
"recruitment.new.resume.qw.message.url"
,
String
.
class
);
String
pagePath
=
env
.
getProperty
(
"dj.region.operation.miniprogram.recruitment.detail.path"
);
if
(
StringUtils
.
isNotEmpty
(
url
))
{
url
=
url
.
replace
(
"{ID}"
,
demand
.
getId
().
toString
());
if
(
StringUtils
.
isBlank
(
appId
)
||
StringUtils
.
isBlank
(
pagePath
))
{
log
.
error
(
"{} - 小程序配置参数缺失,appId:{}, pagePath:{}"
,
logDesc
,
appId
,
pagePath
);
return
;
}
// 拼接小程序路径,包含招聘需求ID参数
String
fullPagePath
=
pagePath
;
if
(
pagePath
.
contains
(
"?"
))
{
fullPagePath
=
pagePath
+
"&id="
+
demandId
;
}
else
{
fullPagePath
=
pagePath
+
"?id="
+
demandId
;
}
}
// 6. 发送小程序通知消息
SendWorkWechatMessageRequestDTO
sendWorkWechatMessageRequestDTO
=
new
SendWorkWechatMessageRequestDTO
();
boolean
success
=
sendDJCloudWechatMiniprogramMessage
(
sendWorkWechatMessageRequestDTO
.
setToUser
(
qwUserId
);
qwUserId
,
sendWorkWechatMessageRequestDTO
.
setMerchantId
(
sendWorkWechatMerchantId
);
title
,
sendWorkWechatMessageRequestDTO
.
setMsgType
(
WorkWechatAppMessageTypeEnum
.
TEXTCARD
.
getValue
());
description
,
appId
,
WorkWechatTextCardMessageDTO
textCard
=
new
WorkWechatTextCardMessageDTO
();
fullPagePath
,
textCard
.
setTitle
(
title
);
logDesc
+
"-demandId:"
+
demandId
textCard
.
setDescription
(
description
);
);
textCard
.
setUrl
(
url
);
sendWorkWechatMessageRequestDTO
.
setTextCard
(
textCard
);
boolean
success
=
sendDJCloudWechatMessage
(
sendWorkWechatMessageRequestDTO
,
logDesc
);
if
(
success
)
{
if
(
success
)
{
log
.
info
(
"{} - 推送成功,demandId:{}, 区域运营:{}, qwUserId:{}"
,
log
.
info
(
"{} - 推送成功,demandId:{}, 区域运营:{}, qwUserId:{}"
,
logDesc
,
demandId
,
demand
.
getRegionOperationName
(),
qwUserId
);
logDesc
,
demandId
,
demand
.
getRegionOperationName
(),
qwUserId
);
}
else
{
}
else
{
log
.
error
(
"{} - 推送失败,demandId:{}, 区域运营:{}"
,
log
.
error
(
"{} - 推送失败,demandId:{}, 区域运营:{}"
,
logDesc
,
demandId
,
demand
.
getRegionOperationName
());
logDesc
,
demandId
,
demand
.
getRegionOperationName
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"{} - 推送异常,demandId:{}"
,
logDesc
,
demandId
,
e
);
log
.
error
(
"{} - 推送异常,demandId:{}"
,
logDesc
,
demandId
,
e
);
...
@@ -1050,68 +1006,6 @@ public class RecruitmentDemandService {
...
@@ -1050,68 +1006,6 @@ public class RecruitmentDemandService {
}
}
/**
/**
* 发送小程序通知类型企微应用消息(小程序跳转)
* 嘀加智慧云-嘀加企微管家
*
* 注意:小程序通知消息需要使用特定的消息类型,请根据实际的DTO类进行调整
* 如果SendWorkWechatMessageRequestDTO支持小程序消息,可以设置相应的字段
*
* @param qwUserId 企微用户ID
* @param title 消息标题
* @param description 消息描述
* @param appId 小程序AppId
* @param pagePath 小程序页面路径(如:pages/index/index?id=123)
* @param logDesc 日志描述
* @return 是否发送成功
*/
public
boolean
sendDJCloudWechatMiniprogramMessage
(
String
qwUserId
,
String
title
,
String
description
,
String
appId
,
String
pagePath
,
String
logDesc
)
{
Integer
merchantId
=
env
.
getProperty
(
"dj.send.work.wechat.merchant.id"
,
Integer
.
class
,
44211227
);
String
agentId
=
env
.
getProperty
(
"dj.send.work.wechat.agentId"
);
SendWorkWechatMessageRequestDTO
request
=
new
SendWorkWechatMessageRequestDTO
();
request
.
setToUser
(
qwUserId
);
request
.
setMerchantId
(
merchantId
);
// 使用小程序通知消息类型,需要根据实际DTO支持情况调整
// 企业微信小程序通知消息类型为: miniprogram_notice
request
.
setMsgType
(
"miniprogram_notice"
);
if
(
StringUtils
.
isNotBlank
(
agentId
))
{
request
.
setAgentId
(
agentId
);
}
// 构造小程序消息体,格式参考企业微信API文档
// 由于没有找到具体的小程序消息DTO类,这里使用Map来构造
Map
<
String
,
Object
>
miniprogramNotice
=
new
HashMap
<>();
miniprogramNotice
.
put
(
"appid"
,
appId
);
miniprogramNotice
.
put
(
"page"
,
pagePath
);
miniprogramNotice
.
put
(
"title"
,
title
);
miniprogramNotice
.
put
(
"description"
,
description
);
// 设置是否放大第一个content_item
miniprogramNotice
.
put
(
"emphasis_first_item"
,
true
);
// 将小程序消息体设置到请求中(需要根据实际DTO字段调整)
// 如果SendWorkWechatMessageRequestDTO有setMiniprogramNotice方法,使用它
// 否则可能需要通过其他方式设置,如使用extraData字段
try
{
// 尝试使用反射或直接设置(根据实际DTO结构)
// 这里假设有一个通用的额外数据字段
java
.
lang
.
reflect
.
Field
extraField
=
request
.
getClass
().
getDeclaredField
(
"extraData"
);
extraField
.
setAccessible
(
true
);
Map
<
String
,
Object
>
extraData
=
new
HashMap
<>();
extraData
.
put
(
"miniprogram_notice"
,
miniprogramNotice
);
extraField
.
set
(
request
,
extraData
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"设置小程序消息体失败,尝试使用JSON方式"
,
e
);
// 如果反射失败,记录警告并返回false
// 实际使用时需要根据具体的DTO类来正确设置
log
.
error
(
"当前SendWorkWechatMessageRequestDTO不支持小程序消息,请扩展DTO或使用其他方式"
);
return
false
;
}
return
sendDJCloudWechatMessage
(
request
,
logDesc
);
}
/**
* web端招聘需求统计
* web端招聘需求统计
*
*
* @param dto
* @param dto
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment