| | |
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-RedPackMessageListener",message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | LogHelper.mqInfo("consumer-RedPackMessageListener", message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | if (tag == null)
|
| | |
| | | if (baseBody.isTest() != Constant.IS_TEST)
|
| | | return Action.ReconsumeLater;
|
| | |
|
| | | |
| | | if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderFanLiActual.name())) {// 返利到账
|
| | | OrderMoneyRecievedMQMsg orderMoneyRecievedMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | |
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderStatistic.name())) {// 订单统计
|
| | | OrderMQMsg orderMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | OrderMQMsg.class);
|
| | | OrderMQMsg orderMQMsg = new Gson().fromJson(new String(message.getBody()), OrderMQMsg.class);
|
| | | if (orderMQMsg.isValid()) {
|
| | | try {// 邀请奖励
|
| | | redPackWinInviteService.inviteSucceedReward(orderMQMsg.getUid());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | } else if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | boolean inviteSucceedReward = false;
|
| | | Long uid = null;
|
| | |
| | | IntegralTaskMQMsg.class);
|
| | | inviteSucceedReward = true;
|
| | | uid = integralTaskMQMsg.getUid();
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.redPackGift.name())) {// 红包赠送
|
| | | // TODO 红包赠送到期未领取
|
| | | }
|
| | | |
| | | if (inviteSucceedReward ) {
|
| | |
|
| | | if (inviteSucceedReward) {
|
| | | try {// 邀请奖励
|
| | | redPackWinInviteService.inviteSucceedReward(uid);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|