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
b795a618
Commit
b795a618
authored
Oct 10, 2022
by
李健华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/wechat-mq-close-20221010' into 'master'
去掉微信变更绑定发送mq-20221010-大数据消费者取消 See merge request
!97
parents
cae57604
be1103b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
NotifyWechatBindEventListener.java
.../quantgroup/xyqb/event/NotifyWechatBindEventListener.java
+4
-4
WechatServiceImpl.java
...uantgroup/xyqb/service/wechat/impl/WechatServiceImpl.java
+9
-13
No files found.
src/main/java/cn/quantgroup/xyqb/event/NotifyWechatBindEventListener.java
View file @
b795a618
...
...
@@ -4,18 +4,18 @@ 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
java.util.Map
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.rabbit.core.RabbitTemplate
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Map
;
/**
* 微信绑定关系变动。通知某系统
*/
@Slf4j
@Component
//
@Component
public
class
NotifyWechatBindEventListener
implements
ApplicationListener
<
WechatBindEvent
>
{
@Resource
...
...
src/main/java/cn/quantgroup/xyqb/service/wechat/impl/WechatServiceImpl.java
View file @
b795a618
...
...
@@ -2,7 +2,6 @@ package cn.quantgroup.xyqb.service.wechat.impl;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.WechatUserInfo
;
import
cn.quantgroup.xyqb.event.WechatBindEvent
;
import
cn.quantgroup.xyqb.exception.WechatRelateUserException
;
import
cn.quantgroup.xyqb.model.webchat.AccessTokenResponse
;
import
cn.quantgroup.xyqb.model.webchat.WechatEventMsg
;
...
...
@@ -12,22 +11,22 @@ import cn.quantgroup.xyqb.service.wechat.IWechatService;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.concurrent.TimeUnit
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.concurrent.TimeUnit
;
/**
* Created by Miraculous on 2017/1/19.
*/
...
...
@@ -49,9 +48,6 @@ public class WechatServiceImpl implements IWechatService {
@Qualifier
(
"stringRedisTemplate"
)
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Resource
private
ApplicationEventPublisher
applicationEventPublisher
;
@PostConstruct
private
void
init
()
{
accessTokenUrl
=
String
.
format
(
"https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&grant_type=authorization_code&code="
,
appId
,
secret
)
+
"%s"
;
...
...
@@ -154,7 +150,7 @@ public class WechatServiceImpl implements IWechatService {
.
userId
(
wechatUserInfo
.
getUserId
())
.
openId
(
wechatUserInfo
.
getOpenId
())
.
build
();
applicationEventPublisher
.
publishEvent
(
new
WechatBindEvent
(
this
,
wechatEventMsg
));
//
applicationEventPublisher.publishEvent(new WechatBindEvent(this, wechatEventMsg));
return
wechatUserInfo
;
}
...
...
@@ -186,7 +182,7 @@ public class WechatServiceImpl implements IWechatService {
.
userId
(
userId
)
.
openId
(
openId
)
.
build
();
applicationEventPublisher
.
publishEvent
(
new
WechatBindEvent
(
this
,
wechatEventMsg
));
//
applicationEventPublisher.publishEvent(new WechatBindEvent(this, wechatEventMsg));
// Todo : 如果当前openId已关联其他用户,则解绑成功后要注销其登录session -- 考虑后暂时不执行,影响太大
log
.
info
(
"微信关联成功:[service]:userId:{},phoneNo:{},openId:{},dissociate:{},relate:{},Old-WechatUserInfo:{}"
,
userId
,
phoneNo
,
openId
,
dissociate
,
relate
,
wechatUserInfo
);
return
relate
;
...
...
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