Commit b795a618 authored by 李健华's avatar 李健华

Merge branch 'hotfix/wechat-mq-close-20221010' into 'master'

去掉微信变更绑定发送mq-20221010-大数据消费者取消

See merge request !97
parents cae57604 be1103b2
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment