Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
e2fd8b2e
Commit
e2fd8b2e
authored
May 15, 2020
by
xiaoguang.xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容错处理
parent
e1d988c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
NotifyWechatBindEventListener.java
.../quantgroup/xyqb/event/NotifyWechatBindEventListener.java
+10
-0
No files found.
src/main/java/cn/quantgroup/xyqb/event/NotifyWechatBindEventListener.java
View file @
e2fd8b2e
...
...
@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.entity.User;
import
cn.quantgroup.xyqb.model.webchat.WechatEventMsg
;
import
cn.quantgroup.xyqb.repository.IUserRepository
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.stereotype.Component
;
...
...
@@ -14,6 +15,7 @@ import java.util.Map;
/**
* 微信绑定关系变动。通知某系统
*/
@Slf4j
@Component
public
class
NotifyWechatBindEventListener
implements
ApplicationListener
<
WechatBindEvent
>
{
...
...
@@ -25,7 +27,15 @@ public class NotifyWechatBindEventListener implements ApplicationListener<Wechat
@Override
public
void
onApplicationEvent
(
WechatBindEvent
event
)
{
WechatEventMsg
wechatEventMsg
=
event
.
getWechatEventMsg
();
if
(
wechatEventMsg
.
getUserId
()
==
null
)
{
log
.
info
(
"微信绑定数据,没有用户 ID 信息,openId:{}"
,
wechatEventMsg
.
getOpenId
());
return
;
}
User
user
=
userRepository
.
findById
(
wechatEventMsg
.
getUserId
());
if
(
user
==
null
)
{
log
.
info
(
"微信绑定数据,没有用户信息,openId:{},userId:{}"
,
wechatEventMsg
.
getOpenId
(),
wechatEventMsg
.
getUserId
());
return
;
}
String
uuid
=
user
.
getUuid
();
Map
<
String
,
Object
>
msg
=
Maps
.
newHashMapWithExpectedSize
(
3
);
...
...
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