admin
2020-05-12 1faf3ab0ba6c17eee48e68e8d0077ea61f45d75d
fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/user/UserVIPMessageListener.java
@@ -50,6 +50,7 @@
   @Resource
   private UserActiveLogService userActiveLogService;
   @Override
   public Action consume(Message message, ConsumeContext context) {
@@ -69,6 +70,12 @@
         if (tag.equalsIgnoreCase(UserTopicTagEnum.userLevelChanged.name())) {// 用户等级发生变化
            UserLevelChangedMQMsg msg = new Gson().fromJson(new String(message.getBody()),
                  UserLevelChangedMQMsg.class);
            for (Long fuid : Constant.NO_UPGRADE_UIDS) {// 禁止不能升级的用户升级
               if (msg.getUid().longValue() == fuid)
                  return Action.CommitMessage;
            }
            // 更新上2级的邀请统计
            teamUserLevelStatisticService.updateUserLevel(msg.getUid());
            UserInfo boss = threeSaleSerivce.getBoss(msg.getUid());
@@ -78,11 +85,13 @@
               if (boss != null) {
                  teamUserLevelStatisticService.initData(boss.getId());
               }
            }
            return Action.CommitMessage;
         } else if (tag.equalsIgnoreCase(UserTopicTagEnum.threeSaleSeparate.name())) {// 邀请关系脱离
            ThreeSaleSeparateMQMsg msg = new Gson().fromJson(new String(message.getBody()),
                  ThreeSaleSeparateMQMsg.class);
            // 更新上两级邀请统计
            teamUserLevelStatisticService.initData(msg.getBossUid());
            UserInfo boss = threeSaleSerivce.getBoss(msg.getBossUid());
@@ -98,6 +107,10 @@
            OrderMoneyRecievedMQMsg dto = new Gson().fromJson(new String(message.getBody()),
                  OrderMoneyRecievedMQMsg.class);
            if (dto != null) {
               for (Long fuid : Constant.NO_UPGRADE_UIDS) {// 禁止不能升级的用户升级
                  if (dto.getUid().longValue() == fuid)
                     return Action.CommitMessage;
               }
               // 判断版本
               UserActiveLog log = userActiveLogService.getUserLatestActiveInfo(dto.getUid());
@@ -117,6 +130,11 @@
         } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderConfirm.name())) {
            OrderConfirmMQMsg dto = new Gson().fromJson(new String(message.getBody()), OrderConfirmMQMsg.class);
            if (dto != null) {
               for (Long fuid : Constant.NO_UPGRADE_UIDS) {// 禁止不能升级的用户升级
                  if (dto.getSourceUid().longValue() == fuid)
                     return Action.CommitMessage;
               }
               // 会员等级升级-粉丝数量验证
               userVIPPreInfoService.upgradeVipByTeamNum(dto.getSourceUid());
               userInviteValidNumService.addValidTeamNum(dto.getSourceUid(), dto.getSettleMent(),