Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
4e38c012
Commit
4e38c012
authored
Apr 25, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信公众号消息模板添加
parent
eab32fc0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
40 deletions
+77
-40
src/main/java/cn/timer/api/bean/wechat/MessageTemplate.java
+7
-5
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
+13
-7
src/main/java/cn/timer/api/controller/zpgl/ZpglH5Controller.java
+1
-1
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
+1
-1
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptServiceImpl.java
+37
-23
src/main/java/cn/timer/api/dto/template/InterviewNotice.java
+14
-0
src/main/java/cn/timer/api/utils/ZpglMessageTemplate.java
+4
-3
No files found.
src/main/java/cn/timer/api/bean/wechat/MessageTemplate.java
View file @
4e38c012
...
@@ -12,6 +12,7 @@ public class MessageTemplate {
...
@@ -12,6 +12,7 @@ public class MessageTemplate {
/**
/**
* 通知面试官
* 通知面试官
* 通知面试者
* 面试安排提醒
* 面试安排提醒
* {{first.DATA}}
* {{first.DATA}}
* 面试职位:{{keyword1.DATA}}
* 面试职位:{{keyword1.DATA}}
...
@@ -20,12 +21,13 @@ public class MessageTemplate {
...
@@ -20,12 +21,13 @@ public class MessageTemplate {
*/
*/
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWER
=
"Uz6mVUYk9Tu7EO2V1pqiQ3x4EudDJTYWdaFtdf64h3M"
;
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWER
=
"Uz6mVUYk9Tu7EO2V1pqiQ3x4EudDJTYWdaFtdf64h3M"
;
/**
/**
* 通知面试者
* 应聘通知
* 面试提醒
* {{first.DATA}}
* {{first.DATA}}
* 面试时间:{{keyword1.DATA}}
* 应聘职位:{{keyword1.DATA}}
* 面试地点:{{keyword2.DATA}}
* 通知内容:{{keyword2.DATA}}
* 通知人:{{keyword3.DATA}}
* 通知时间:{{keyword4.DATA}}
* {{remark.DATA}}
* {{remark.DATA}}
*/
*/
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWE
E
=
"J5PkcWwJsti8ax0BBI9uhquPvV6NaqKrbHubavSvof0
"
;
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWE
=
"YChIP5ho7sT_dL5GMykjR4LCuR5aJ8E0tf73i4p_vvk
"
;
}
}
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
View file @
4e38c012
...
@@ -467,8 +467,8 @@ public class ZpglController {
...
@@ -467,8 +467,8 @@ public class ZpglController {
return
ResultUtil
.
error
(
"导入简历失败,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式~"
);
return
ResultUtil
.
error
(
"导入简历失败,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式~"
);
}
}
importCandidateDto
.
setSuffix
(
suffix
);
importCandidateDto
.
setSuffix
(
suffix
);
//
return zpglService.addResumeImportCandidate(userBean, file, importCandidateDto);
return
zpglService
.
addResumeImportCandidate
(
userBean
,
file
,
importCandidateDto
);
return
zpglService
.
addCandidateByResumeSDK
(
userBean
,
file
,
importCandidateDto
);
//
return zpglService.addCandidateByResumeSDK(userBean, file, importCandidateDto);
}
catch
(
CustomException
e
)
{
}
catch
(
CustomException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
e
;
throw
e
;
...
@@ -595,6 +595,10 @@ public class ZpglController {
...
@@ -595,6 +595,10 @@ public class ZpglController {
return
ResultUtil
.
error
(
"操作失败~"
);
return
ResultUtil
.
error
(
"操作失败~"
);
}
}
InterviewNotice
interviewNotice
=
new
InterviewNotice
();
InterviewNotice
interviewNotice
=
new
InterviewNotice
();
ZpglZwxx
zpglZwxx
=
ZpglZwxx
.
builder
().
id
(
zpglRcxx
.
getZpglZwxxId
()).
build
().
selectById
();
if
(!
StringUtils
.
isEmpty
(
zpglZwxx
))
{
interviewNotice
.
setZpglZwxxName
(
zpglZwxx
.
getName
());
}
interviewNotice
.
setName
(
zpglRcxx
.
getName
());
interviewNotice
.
setName
(
zpglRcxx
.
getName
());
interviewNotice
.
setEmail
(
zpglRcxx
.
getMail
());
interviewNotice
.
setEmail
(
zpglRcxx
.
getMail
());
//公众号类型 1:8小时企业管理 2:优领人才网
//公众号类型 1:8小时企业管理 2:优领人才网
...
@@ -606,16 +610,18 @@ public class ZpglController {
...
@@ -606,16 +610,18 @@ public class ZpglController {
// 通知面试者
// 通知面试者
interviewNotice
.
setZpglRcxxId
(
zpglRcxx
.
getId
());
interviewNotice
.
setZpglRcxxId
(
zpglRcxx
.
getId
());
interviewNotice
.
setMobile
(
zpglRcxx
.
getMobile
());
interviewNotice
.
setMobile
(
zpglRcxx
.
getMobile
());
interviewNotice
.
setRemark
(
"点击填写"
);
interviewNotice
.
setNoticeName
(
userBean
.
getQyzxEmpLogin
().
getUsername
());
interviewNotice
.
setRemark
(
"请点击详情填写"
);
interviewNotice
.
setTemplateId
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWE
);
// 发送应聘登记表消息
// 发送应聘登记表消息
if
(
APPLY_STATUS
==
status
.
intValue
())
{
if
(
APPLY_STATUS
==
status
.
intValue
())
{
interviewNotice
.
setTemplateId
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWER
);
interviewNotice
.
setContentNotice
(
ZpglMessageTemplate
.
TO_APPLY
);
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
THANKS
,
new
String
[]{
zpglRcxx
.
getName
(),
interviewNotice
.
getZpglZwxxName
()}));
interviewNotice
.
setUrl
(
h5Url
+
"?mobile="
+
zpglRcxx
.
getMobile
()
+
"&orgId="
+
userBean
.
getOrgCode
()
+
"#/basicInfo"
);
interviewNotice
.
setUrl
(
h5Url
+
"?mobile="
+
zpglRcxx
.
getMobile
()
+
"&orgId="
+
userBean
.
getOrgCode
()
+
"#/basicInfo"
);
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
TO_APPLY
,
new
String
[]{
zpglRcxx
.
getName
()}));
// 发送FPA测评消息
// 发送FPA测评消息
}
else
{
}
else
{
interviewNotice
.
set
TemplateId
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWER
);
interviewNotice
.
set
ContentNotice
(
ZpglMessageTemplate
.
TO_CEPIN
);
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
T
O_CEPIN
,
new
String
[]{
zpglRcxx
.
get
Name
()}));
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
T
HANKS
,
new
String
[]{
zpglRcxx
.
getName
(),
interviewNotice
.
getZpglZwxx
Name
()}));
interviewNotice
.
setUrl
(
h5Url
+
"/?zpglRcxxId="
+
zpglRcxx
.
getId
()
+
"#/cpxt"
);
interviewNotice
.
setUrl
(
h5Url
+
"/?zpglRcxxId="
+
zpglRcxx
.
getId
()
+
"#/cpxt"
);
}
}
log
.
info
(
"TO_INTERVIEWEE sendApplyOrCePin MessageQueue info:{}"
,
zpglWxgzptService
.
sendApplyOrCePin
(
interviewNotice
));
log
.
info
(
"TO_INTERVIEWEE sendApplyOrCePin MessageQueue info:{}"
,
zpglWxgzptService
.
sendApplyOrCePin
(
interviewNotice
));
...
...
src/main/java/cn/timer/api/controller/zpgl/ZpglH5Controller.java
View file @
4e38c012
...
@@ -52,7 +52,7 @@ public class ZpglH5Controller {
...
@@ -52,7 +52,7 @@ public class ZpglH5Controller {
if
(!
StringUtils
.
isEmpty
(
zpglRcxx
.
getWorkBeginYear
())){
if
(!
StringUtils
.
isEmpty
(
zpglRcxx
.
getWorkBeginYear
())){
zpglRcxx
.
setWorkyears
(
DateFormatUtils
.
yearCompare
(
zpglRcxx
.
getWorkBeginYear
(),
new
Date
()));
zpglRcxx
.
setWorkyears
(
DateFormatUtils
.
yearCompare
(
zpglRcxx
.
getWorkBeginYear
(),
new
Date
()));
}
}
if
(
!
StringUtils
.
isEmpty
(
zpglRcxx
.
getId
())
&&
zpglRcxx
.
getId
()
>
0
){
if
(
StringUtils
.
isEmpty
(
zpglRcxx
.
getId
())
){
// 新增人才信息 初始化流程记录
// 新增人才信息 初始化流程记录
ZpglMslcLog
zpglMslcLog
=
new
ZpglMslcLog
();
ZpglMslcLog
zpglMslcLog
=
new
ZpglMslcLog
();
zpglMslcLog
.
setZpglRcxxId
(
zpglRcxx
.
getId
());
zpglMslcLog
.
setZpglRcxxId
(
zpglRcxx
.
getId
());
...
...
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
View file @
4e38c012
...
@@ -247,7 +247,7 @@ public class ZpglServiceImpl implements ZpglService {
...
@@ -247,7 +247,7 @@ public class ZpglServiceImpl implements ZpglService {
// 通知面试者
// 通知面试者
interviewNotice
.
setZpglRcxxId
(
zpglRcxxEntity
.
getId
());
interviewNotice
.
setZpglRcxxId
(
zpglRcxxEntity
.
getId
());
interviewNotice
.
setMobile
(
zpglRcxxEntity
.
getMobile
());
interviewNotice
.
setMobile
(
zpglRcxxEntity
.
getMobile
());
interviewNotice
.
setRemark
(
"如有疑问,请联系 HR"
);
interviewNotice
.
setRemark
(
"
请您提前做好准备,妥善安排接面试的时间~
如有疑问,请联系 HR"
);
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
TO_INTERVIEWEE
,
new
String
[]{
interviewNotice
.
getName
(),
interviewNotice
.
getZpglZwxxName
()}));
interviewNotice
.
setContentStr
(
ZpglMessageTemplate
.
print
(
ZpglMessageTemplate
.
TO_INTERVIEWEE
,
new
String
[]{
interviewNotice
.
getName
(),
interviewNotice
.
getZpglZwxxName
()}));
log
.
info
(
"TO_INTERVIEWEE addInterviewMessageQueue info:{}"
,
zpglWxgzptService
.
addInterviewMessageQueue
(
interviewNotice
));
log
.
info
(
"TO_INTERVIEWEE addInterviewMessageQueue info:{}"
,
zpglWxgzptService
.
addInterviewMessageQueue
(
interviewNotice
));
}
}
...
...
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptServiceImpl.java
View file @
4e38c012
...
@@ -28,35 +28,13 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
...
@@ -28,35 +28,13 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
@Value
(
"${youling.serverUrl}"
)
@Value
(
"${youling.serverUrl}"
)
private
String
serverUrl
;
private
String
serverUrl
;
/**
* 添加消息队列
*
* @param map
* @return
*/
@Override
@Override
public
String
addMessageQueue
(
Map
<
String
,
Object
>
map
)
{
public
String
addMessageQueue
(
Map
<
String
,
Object
>
map
)
{
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
}
}
/**
* 添加消息队列
*
* @param interviewNotice
* @return
*/
@Override
@Override
public
String
addInterviewMessageQueue
(
InterviewNotice
interviewNotice
)
{
public
String
addInterviewMessageQueue
(
InterviewNotice
interviewNotice
)
{
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
this
.
copyMessageQueueToMap
(
interviewNotice
));
}
@Override
public
String
sendApplyOrCePin
(
InterviewNotice
interviewNotice
)
{
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
this
.
copyMessageQueueToMap
(
interviewNotice
));
}
private
Map
copyMessageQueueToMap
(
InterviewNotice
interviewNotice
){
//消息队列对象
//消息队列对象
MessageQueueDto
mqd
=
new
MessageQueueDto
();
MessageQueueDto
mqd
=
new
MessageQueueDto
();
BeanUtils
.
copyProperties
(
interviewNotice
,
mqd
);
BeanUtils
.
copyProperties
(
interviewNotice
,
mqd
);
...
@@ -82,6 +60,42 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
...
@@ -82,6 +60,42 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
/** 模板消息内容 end */
/** 模板消息内容 end */
Map
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
mqd
),
Map
.
class
);
Map
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
mqd
),
Map
.
class
);
return
map
;
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
}
@Override
public
String
sendApplyOrCePin
(
InterviewNotice
interviewNotice
)
{
//消息队列对象
MessageQueueDto
mqd
=
new
MessageQueueDto
();
BeanUtils
.
copyProperties
(
interviewNotice
,
mqd
);
/** 模板消息内容 start */
List
<
TemplateData
>
templateData
=
new
ArrayList
<>();
// 内容
TemplateData
key
=
new
TemplateData
(
"first"
,
interviewNotice
.
getContentStr
(),
"#000000"
);
templateData
.
add
(
key
);
// 应聘职位
TemplateData
key1
=
new
TemplateData
(
"keyword1"
,
interviewNotice
.
getZpglZwxxName
(),
"#000000"
);
templateData
.
add
(
key1
);
// 通知内容
TemplateData
key2
=
new
TemplateData
(
"keyword2"
,
interviewNotice
.
getContentNotice
(),
"#000000"
);
templateData
.
add
(
key2
);
// 通知人
TemplateData
key3
=
new
TemplateData
(
"keyword3"
,
interviewNotice
.
getNoticeName
(),
"#000000"
);
templateData
.
add
(
key3
);
// 通知时间
TemplateData
key4
=
new
TemplateData
(
"keyword4"
,
interviewNotice
.
getNowTime
(),
"#000000"
);
templateData
.
add
(
key4
);
// 备注
TemplateData
remark
=
new
TemplateData
(
"remark"
,
interviewNotice
.
getRemark
(),
"#000000"
);
templateData
.
add
(
remark
);
//数据处理成固定好的json格式
String
content
=
mqd
.
getContentJson
(
templateData
);
mqd
.
setContent
(
content
);
/** 模板消息内容 end */
Map
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
mqd
),
Map
.
class
);
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
}
}
}
}
src/main/java/cn/timer/api/dto/template/InterviewNotice.java
View file @
4e38c012
...
@@ -18,6 +18,11 @@ import java.util.Date;
...
@@ -18,6 +18,11 @@ import java.util.Date;
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
public
class
InterviewNotice
extends
MessageQueueDto
{
public
class
InterviewNotice
extends
MessageQueueDto
{
/**
* 通知人,操作者
*/
private
String
NoticeName
;
/**
/**
* 面试者名字
* 面试者名字
*/
*/
...
@@ -39,6 +44,15 @@ public class InterviewNotice extends MessageQueueDto {
...
@@ -39,6 +44,15 @@ public class InterviewNotice extends MessageQueueDto {
*/
*/
private
String
contentStr
;
private
String
contentStr
;
/**
* 通知内容
*/
private
String
contentNotice
;
/**
* 当前时间
*/
private
String
nowTime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
());
public
void
setInterviewTime
(
Date
interviewTime
){
public
void
setInterviewTime
(
Date
interviewTime
){
this
.
interviewTime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
interviewTime
);
this
.
interviewTime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
interviewTime
);
}
}
...
...
src/main/java/cn/timer/api/utils/ZpglMessageTemplate.java
View file @
4e38c012
...
@@ -24,9 +24,10 @@ public class ZpglMessageTemplate {
...
@@ -24,9 +24,10 @@ public class ZpglMessageTemplate {
public
static
final
String
SYS_ADD
=
"系统添加了候选人"
;
public
static
final
String
SYS_ADD
=
"系统添加了候选人"
;
public
static
final
String
TO_INTERVIEWER
=
"您好,{0}{1}已安排由您面试"
;
public
static
final
String
TO_INTERVIEWER
=
"您好,{0}{1}已安排由您面试"
;
public
static
final
String
TO_INTERVIEWEE
=
"候选人{0}你好!你所投递的 {1} 职位为你安排了面试"
;
public
static
final
String
TO_INTERVIEWEE
=
"候选人{0}您好!您所投递的 {1} 职位为您安排了面试"
;
public
static
final
String
TO_APPLY
=
"候选人{0}您好!请您认真填写应聘登记表"
;
public
static
final
String
TO_APPLY
=
"请您认真填写应聘登记表"
;
public
static
final
String
TO_CEPIN
=
"候选人{0}您好!请您认真填写FPA测评试卷"
;
public
static
final
String
TO_CEPIN
=
"请您认真填写FPA测评试卷"
;
public
static
final
String
THANKS
=
"候选人{0}您好!感谢您应聘{1}职位!"
;
public
static
final
String
OFFER_TEMPLATE
=
"<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\"><body><div><p style=\" line-height: 1.5;\">尊敬的<span>{0}</span></p>"
+
public
static
final
String
OFFER_TEMPLATE
=
"<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\"><body><div><p style=\" line-height: 1.5;\">尊敬的<span>{0}</span></p>"
+
"<p style=\" line-height: 1.5;\"><br></p>"
+
"<p style=\" line-height: 1.5;\"><br></p>"
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment