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
58a9325d
Commit
58a9325d
authored
Apr 18, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
招聘管理-发送面试通知
parent
8de82096
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
226 additions
and
19 deletions
+226
-19
src/main/java/cn/timer/api/bean/wechat/MessageTemplate.java
+31
-0
src/main/java/cn/timer/api/config/enuminterface/JxglEnumInterface.java
+19
-0
src/main/java/cn/timer/api/controller/verify/VerifyController.java
+0
-1
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
+1
-1
src/main/java/cn/timer/api/controller/zpgl/ZpglWxgzptController.java
+2
-6
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
+20
-0
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptService.java
+12
-11
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptServiceImpl.java
+99
-0
src/main/java/cn/timer/api/dto/template/InterviewNotice.java
+42
-0
No files found.
src/main/java/cn/timer/api/bean/wechat/MessageTemplate.java
0 → 100644
View file @
58a9325d
package
cn
.
timer
.
api
.
bean
.
wechat
;
/**
* 8小时企业管理
* 公众号模板消息
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-04-18 15:14:40
*/
public
class
MessageTemplate
{
/**
* 通知面试官
* 面试安排提醒
* {{first.DATA}}
* 面试职位:{{keyword1.DATA}}
* 面试时间:{{keyword2.DATA}}
* {{remark.DATA}}
*/
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWER
=
"Uz6mVUYk9Tu7EO2V1pqiQ3x4EudDJTYWdaFtdf64h3M"
;
/**
* 通知面试者
* 面试提醒
* {{first.DATA}}
* 面试时间:{{keyword1.DATA}}
* 面试地点:{{keyword2.DATA}}
* {{remark.DATA}}
*/
public
static
final
String
TEMPLATE_ID_TO_INTERVIEWEE
=
"J5PkcWwJsti8ax0BBI9uhquPvV6NaqKrbHubavSvof0"
;
}
src/main/java/cn/timer/api/config/enuminterface/JxglEnumInterface.java
View file @
58a9325d
...
...
@@ -345,5 +345,24 @@ public interface JxglEnumInterface {
}
}
/**
* 招聘管理-面试流程:通知方式 1:全部 2:短信 3:邮件 4.微信公众号
*/
@Getter
enum
NoticeWay
implements
JxglEnumInterface
{
ALL
(
1
,
"全部"
),
SHORT_MESSAGE
(
2
,
"短信"
),
EMAIL
(
3
,
"邮件"
),
WECHAT_PUBLIC
(
4
,
"微信公众号"
);
private
Integer
type
;
private
String
name
;
NoticeWay
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
}
}
src/main/java/cn/timer/api/controller/verify/VerifyController.java
View file @
58a9325d
package
cn
.
timer
.
api
.
controller
.
verify
;
import
cn.timer.api.utils.wxgzh.SignUtil
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
src/main/java/cn/timer/api/controller/zpgl/ZpglController.java
View file @
58a9325d
...
...
@@ -514,7 +514,7 @@ public class ZpglController {
ZpglDtk
zpglDtk
=
ZpglDtk
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZpglDtk
>().
lambda
().
eq
(
ZpglDtk:
:
getZpglRcxxId
,
zpglRcxxId
));
// offer
ZpglRcxxOffer
zpglRcxxOffer
=
ZpglRcxxOffer
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZpglRcxxOffer
>().
lambda
().
eq
(
ZpglRcxxOffer:
:
getZpglRcxxId
,
zpglRcxxId
).
eq
(
ZpglRcxxOffer:
:
getDeleteFlag
,
0
));
ZpglRcxxOffer
zpglRcxxOffer
=
ZpglRcxxOffer
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZpglRcxxOffer
>().
lambda
().
eq
(
ZpglRcxxOffer:
:
getZpglRcxxId
,
zpglRcxxId
).
eq
(
ZpglRcxxOffer:
:
getDeleteFlag
,
0
)
.
orderByDesc
(
ZpglRcxxOffer:
:
getCreateTime
)
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>(
7
);
map
.
put
(
"zpglRcxx"
,
zpglRcxx
);
...
...
src/main/java/cn/timer/api/controller/zpgl/ZpglWxgzptController.java
View file @
58a9325d
...
...
@@ -6,9 +6,8 @@ import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zpgl.ZpglRcxx
;
import
cn.timer.api.bean.zpgl.ZpglWxgzptEmpRcxx
;
import
cn.timer.api.controller.zpgl.sevice.ZpglWxgzptService
;
import
cn.timer.api.controller.zpgl.sevice.ZpglWxgzptService
Impl
;
import
cn.timer.api.dto.template.TemplateData
;
import
cn.timer.api.dto.template.TemplateMessage
;
import
cn.timer.api.dto.wxgzh.LoginDto
;
import
cn.timer.api.dto.wxgzh.MessageQueueDto
;
import
cn.timer.api.utils.Result
;
...
...
@@ -19,7 +18,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -31,9 +29,7 @@ import org.springframework.web.servlet.ModelAndView;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpSession
;
import
javax.transaction.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -58,7 +54,7 @@ public class ZpglWxgzptController {
public
static
final
String
OAUTH_GET_ACCESS_TOKEN_URL
=
"https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"
;
@Resource
private
ZpglWxgzptService
zpglWxgzptService
;
private
ZpglWxgzptService
Impl
zpglWxgzptService
;
@Resource
private
RedisUtil
redisUtil
;
...
...
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglServiceImpl.java
View file @
58a9325d
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.controller.zpgl.sevice;
import
cn.timer.api.bean.clazz.SysRegion
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.wechat.MessageTemplate
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.zpgl.*
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
...
...
@@ -11,6 +12,7 @@ import cn.timer.api.controller.kqgl.ClockInTool;
import
cn.timer.api.dto.baidu.*
;
import
cn.timer.api.bean.clazz.NationClass
;
import
cn.timer.api.dto.email.SendMessageDto
;
import
cn.timer.api.dto.template.InterviewNotice
;
import
cn.timer.api.dto.zpgl.ImportCandidateDto
;
import
cn.timer.api.dto.zpgl.ZpglRcxxDto
;
import
cn.timer.api.utils.Result
;
...
...
@@ -30,6 +32,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.transaction.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -57,6 +60,9 @@ public class ZpglServiceImpl implements ZpglService {
@Autowired
private
ZpglMslcLogService
zpglMslcLogService
;
@Autowired
private
ZpglWxgzptServiceImpl
zpglWxgzptService
;
@Override
public
boolean
updateZpglRcxx
(
UserBean
userBean
,
ZpglRcxxDto
zpglRcxxDto
)
{
...
...
@@ -204,6 +210,20 @@ public class ZpglServiceImpl implements ZpglService {
zpglMslcLog
.
setDetail
(
detail
);
count
=
zpglRcxx
.
updateById
();
zpglMslcLogService
.
addZpglMslcLog
(
zpglMslcLog
);
// 发送面试通知
if
(
count
&&
JxglEnumInterface
.
ResumeStatus
.
INTERVIEW
.
equals
(
zpglRcxxDto
.
getStatus
())
&&
JxglEnumInterface
.
NoticeWay
.
WECHAT_PUBLIC
.
equals
(
zpglRcxxDto
.
getNoticeWay
())){
InterviewNotice
interviewNotice
=
new
InterviewNotice
();
interviewNotice
.
setName
(
zpglRcxxEntity
.
getName
());
interviewNotice
.
setInterviewTime
(
zpglRcxxDto
.
getInterviewTime
());
// 通知面试官
interviewNotice
.
setMobile
(
""
);
interviewNotice
.
setTemplateId
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWER
);
zpglWxgzptService
.
addInterviewMessageQueue
(
interviewNotice
);
// 通知面试者
interviewNotice
.
setMobile
(
zpglRcxxEntity
.
getMobile
());
interviewNotice
.
setTemplateId
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWEE
);
zpglWxgzptService
.
addInterviewMessageQueue
(
interviewNotice
);
}
return
count
;
}
...
...
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptService.java
View file @
58a9325d
package
cn
.
timer
.
api
.
controller
.
zpgl
.
sevice
;
import
cn.hutool.http.HttpUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
cn.timer.api.dto.template.InterviewNotice
;
import
java.util.Map
;
...
...
@@ -10,18 +9,20 @@ import java.util.Map;
* @author longys
* @date 2022/3/25 18:08
*/
@Service
public
class
ZpglWxgzptService
{
@Value
(
"${youling.serverUrl}"
)
private
String
serverUrl
;
public
interface
ZpglWxgzptService
{
/**
* 添加消息队列
* @param map
* @return
*/
public
String
addMessageQueue
(
Map
<
String
,
Object
>
map
){
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
}
String
addMessageQueue
(
Map
<
String
,
Object
>
map
);
/**
* 安排面试 通知面试官、面试者
* 添加消息队列
* @param interviewNotice
* @return
*/
String
addInterviewMessageQueue
(
InterviewNotice
interviewNotice
);
}
src/main/java/cn/timer/api/controller/zpgl/sevice/ZpglWxgzptServiceImpl.java
0 → 100644
View file @
58a9325d
package
cn
.
timer
.
api
.
controller
.
zpgl
.
sevice
;
import
cn.hutool.http.HttpUtil
;
import
cn.timer.api.bean.wechat.MessageTemplate
;
import
cn.timer.api.dto.template.InterviewNotice
;
import
cn.timer.api.dto.template.TemplateData
;
import
cn.timer.api.dto.wxgzh.MessageQueueDto
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.transaction.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author longys
* @date 2022/3/25 18:08
*/
@Slf4j
@Service
@Transactional
(
rollbackOn
=
Exception
.
class
)
public
class
ZpglWxgzptServiceImpl
implements
ZpglWxgzptService
{
@Value
(
"${youling.serverUrl}"
)
private
String
serverUrl
;
/**
* 添加消息队列
*
* @param map
* @return
*/
public
String
addMessageQueue
(
Map
<
String
,
Object
>
map
)
{
return
HttpUtil
.
post
(
serverUrl
+
"/wxgzh/addMessageQueue"
,
map
);
}
/**
* 添加消息队列
*
* @param interviewNotice
* @return
*/
public
String
addInterviewMessageQueue
(
InterviewNotice
interviewNotice
)
{
//消息队列对象
MessageQueueDto
mqd
=
new
MessageQueueDto
();
BeanUtils
.
copyProperties
(
interviewNotice
,
mqd
);
/** 模板消息内容 start */
List
<
TemplateData
>
templateData
=
new
ArrayList
<>();
if
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWER
.
equals
(
interviewNotice
.
getTemplateId
()))
{
TemplateData
key1
=
new
TemplateData
(
"first"
,
"您好,"
+
interviewNotice
.
getZpglZwxxName
()
+
interviewNotice
.
getName
()
+
"已安排由您面试"
,
"#000000"
);
templateData
.
add
(
key1
);
}
else
if
(
MessageTemplate
.
TEMPLATE_ID_TO_INTERVIEWEE
.
equals
(
interviewNotice
.
getTemplateId
()))
{
TemplateData
key1
=
new
TemplateData
(
"first"
,
"候选人"
+
interviewNotice
.
getName
()
+
"你好!你所投递的"
+
interviewNotice
.
getZpglZwxxName
()
+
"为你安排了面试"
,
"#000000"
);
templateData
.
add
(
key1
);
}
// 面试职位
TemplateData
key2
=
new
TemplateData
(
"keyword1"
,
interviewNotice
.
getZpglZwxxName
(),
"#000000"
);
templateData
.
add
(
key2
);
// 面试时间
TemplateData
key3
=
new
TemplateData
(
"keyword2"
,
interviewNotice
.
getInterviewTime
(),
"#000000"
);
templateData
.
add
(
key3
);
// 备注
TemplateData
key4
=
new
TemplateData
(
"remark"
,
interviewNotice
.
getRemark
(),
"#000000"
);
templateData
.
add
(
key4
);
//数据处理成固定好的json格式
String
content
=
mqd
.
getContentJson
(
templateData
);
mqd
.
setContent
(
content
);
/** 模板消息内容 end */
/**
* //消息内容模板消息 json格式 普通消息字符串类型
* //手机号
* mqd.setMobile("18212310017");
* //类型(1 短信,2 邮件,3 微信模板消息)
* mqd.setType(2);
* //公众号类型 1:8小时企业管理 2:优领人才网
* mqd.setWxgzhType(1);
* //1 即时发送,2 定时发送
* mqd.setTiming(1);
* //模板id
* mqd.setTemplateId(interviewNotice.getTemplateId());
* //网页地址
* mqd.setUrl(null);
* //小程序页面地址
* mqd.setWxxcxPageId(null);
*/
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
0 → 100644
View file @
58a9325d
package
cn
.
timer
.
api
.
dto
.
template
;
import
cn.timer.api.dto.wxgzh.MessageQueueDto
;
import
cn.timer.api.utils.DateFormatUtils
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022/4/18
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
InterviewNotice
extends
MessageQueueDto
{
/**
* 面试者名字
*/
private
String
name
;
/**
* 职位名称
*/
private
String
zpglZwxxName
;
/**
* 面试时间
*/
private
String
interviewTime
;
/**
* 备注
*/
private
String
remark
;
public
void
setInterviewTime
(
Date
interviewTime
){
this
.
interviewTime
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
interviewTime
);
}
}
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