Commit c5e1870f authored by jiaorz's avatar jiaorz

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents 10ea4240 9ca2791e
......@@ -293,8 +293,8 @@ public class AppPermissionService {
}*/
//临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username);
//参加新人活动
jionActivity(userid);
/*//参加新人活动
jionActivity(userid);*/
//创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理
......@@ -892,8 +892,8 @@ public class AppPermissionService {
relationBiz.bindByUserId(userid, small_id);
//发送短信通知用户
thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE);
//参加新人活动
jionActivity(userid);
/* //参加新人活动
jionActivity(userid);*/
// 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,null);
// 到im注册,获取返回结果
......
......@@ -19,12 +19,16 @@ public class RabbitActivityConfig extends RabbitCommonConfig {
public static final String INTEGRAL_QUEUE = "integral_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";
static {
myQueue = new ArrayList<BindDTO>(){{
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.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));
}};
}
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO;
import com.rabbitmq.client.Channel;
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.config.RabbitActivityConfig;
import com.xxfc.platform.activity.entity.ActivityPopularize;
......@@ -30,6 +31,9 @@ public class PopularizeMQHandler {
@Autowired
ActivityPopularizeBiz activityPopularizeBiz;
@Autowired
ActivityUserJoinBiz activityUserJoinBiz;
//@RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_REGISTER_QUEUE,RabbitActivityConfig.POPULARZIE_AUTH_QUEUE})
@RabbitListener(queues = {RabbitActivityConfig.POPULARZIE_0101_QUEUE})
public void popularizeHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
......@@ -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 @@
and u.is_use=0 and u.expire_time &lt;#{time}
</if>
<if test="channel!=null and channel!=''">
and (c.channel=#{channel} or c.channel=1 )
and (c.channel=#{channel} or c.channel=0 )
</if>
<choose>
<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