Commit f2ff7728 authored by hezhen's avatar hezhen

123

parent d1f09748
...@@ -293,8 +293,8 @@ public class AppPermissionService { ...@@ -293,8 +293,8 @@ public class AppPermissionService {
}*/ }*/
//临时会员绑定 //临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username); insertUserMemberByUserIdAndPhone(userid, username);
//参加新人活动 /*//参加新人活动
jionActivity(userid); jionActivity(userid);*/
//创建钱包 //创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId()); walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理 // 登录结果要做做统一处理
...@@ -892,8 +892,8 @@ public class AppPermissionService { ...@@ -892,8 +892,8 @@ public class AppPermissionService {
relationBiz.bindByUserId(userid, small_id); relationBiz.bindByUserId(userid, small_id);
//发送短信通知用户 //发送短信通知用户
thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE); thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE);
//参加新人活动 /* //参加新人活动
jionActivity(userid); jionActivity(userid);*/
// 登录结果要做做统一处理 // 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,null); JSONObject data = autoLogin(userid, username, headimgurl, nickname,null);
// 到im注册,获取返回结果 // 到im注册,获取返回结果
......
...@@ -19,12 +19,16 @@ public class RabbitActivityConfig extends RabbitCommonConfig { ...@@ -19,12 +19,16 @@ public class RabbitActivityConfig extends RabbitCommonConfig {
public static final String INTEGRAL_QUEUE = "integral_queue"; public static final String INTEGRAL_QUEUE = "integral_queue";
public static final String POPULARZIE_0101_QUEUE = "popularzie.0101.queue"; public static final String POPULARZIE_0101_QUEUE = "popularzie.0101.queue";
//新人注册有礼
public static final String ACTIVITY_NEW_QUEUE = "activity.new.queue";
public static final String INTEGRAL_HANDLE_QUEUE = "integral_handle_queue"; public static final String INTEGRAL_HANDLE_QUEUE = "integral_handle_queue";
static { static {
myQueue = new ArrayList<BindDTO>(){{ myQueue = new ArrayList<BindDTO>(){{
add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#")); add(new BindDTO(INTEGRAL_QUEUE, RabbitConstant.ORDER_TOPIC, "order.#"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register")); add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth")); add(new BindDTO(POPULARZIE_0101_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
add(new BindDTO(ACTIVITY_NEW_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.register"));
add(new BindDTO(ACTIVITY_NEW_QUEUE, RabbitConstant.ADMIN_TOPIC, "appUser.auth"));
add(new BindDTO(INTEGRAL_HANDLE_QUEUE, MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY)); add(new BindDTO(INTEGRAL_HANDLE_QUEUE, MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY));
}}; }};
} }
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO; import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.xxfc.platform.activity.biz.ActivityPopularizeBiz; import com.xxfc.platform.activity.biz.ActivityPopularizeBiz;
import com.xxfc.platform.activity.biz.ActivityUserJoinBiz;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz; import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import com.xxfc.platform.activity.config.RabbitActivityConfig; import com.xxfc.platform.activity.config.RabbitActivityConfig;
import com.xxfc.platform.activity.entity.ActivityPopularize; import com.xxfc.platform.activity.entity.ActivityPopularize;
...@@ -30,6 +31,9 @@ public class PopularizeMQHandler { ...@@ -30,6 +31,9 @@ public class PopularizeMQHandler {
@Autowired @Autowired
ActivityPopularizeBiz activityPopularizeBiz; ActivityPopularizeBiz activityPopularizeBiz;
@Autowired
ActivityUserJoinBiz activityUserJoinBiz;
//@RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_REGISTER_QUEUE,RabbitActivityConfig.POPULARZIE_AUTH_QUEUE}) //@RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_REGISTER_QUEUE,RabbitActivityConfig.POPULARZIE_AUTH_QUEUE})
@RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_0101_QUEUE}) @RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_0101_QUEUE})
public void popularizeHandler(Message message, @Headers Map<String, Object> headers, Channel channel) { public void popularizeHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
...@@ -63,6 +67,41 @@ public class PopularizeMQHandler { ...@@ -63,6 +67,41 @@ public class PopularizeMQHandler {
} }
}); });
} }
//新人注册有礼
@RabbitListener(queues = {RabbitActivityConfig.ACTIVITY_NEW_QUEUE})
public void activityNewHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new Runnable() {
@Override
public void run() {
try {
String messageId = message.getMessageProperties().getMessageId();
String msg = new String(message.getBody(), "UTF-8");
log.info("接收到的消息:msg = {}, 消息ID是:messageId = {} ", msg, messageId);
if (StringUtils.isNotBlank(msg)) {
RegisterQueueDTO registerQueueDTO = JSONObject.parseObject(msg, RegisterQueueDTO.class);
if(registerQueueDTO!=null&&(registerQueueDTO.getSign()==RegisterQueueDTO.SIGN_NEW||registerQueueDTO.getSign()==RegisterQueueDTO.SIGN_ACTIVATE)){
activityUserJoinBiz.joinActivity(registerQueueDTO.getAppUserId());
}
}
executorService.shutdown();
Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
// 手动签收
channel.basicAck(deliveryTag, false);
} catch (Exception e) {
log.info("接收到的消息失败");
try {
channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, false);
} catch (IOException i) {
i.printStackTrace();
}
e.printStackTrace();
}
}
});
}
} }
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
and u.is_use=0 and u.expire_time &lt;#{time} and u.is_use=0 and u.expire_time &lt;#{time}
</if> </if>
<if test="channel!=null and channel!=''"> <if test="channel!=null and channel!=''">
and (c.channel=#{channel} or c.channel=1 ) and (c.channel=#{channel} or c.channel=0 )
</if> </if>
<choose> <choose>
<when test="type==1"> <when test="type==1">
......
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