admin
2020-01-07 6fdcc0c26dd33e87a024a69ed635d9aedb59cad6
fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -117,6 +117,11 @@
   public TokenRecord getNearByTypeAndIdentify(String type, String identify) {
      return tokenRecordMapper.getNearByTypeAndIdentify(type, identify);
   }
   @Override
   public TokenRecord getByTypeAndIdentify(String type, String identify) {
      return tokenRecordMapper.getByTypeAndIdentify(type, identify);
   }
   @Override
   public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
@@ -173,7 +178,7 @@
            state = true;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
               tips.add("确认领取后,你将成为赠送人的一级队员;");
               tips.add("确认领取后,你将成为赠送人的直接粉丝;");
               tips.add("获赠的免单券,需要激活后才能使用,详情参见免单券激活规则;");
               tips.add("成功领取后,请到“我的-福利中心”查看。");
            } else {
@@ -209,7 +214,7 @@
            state = true;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
               tips.add("确认领取后,你将成为赠送人的一级队员;");
               tips.add("确认领取后,你将成为赠送人的直接粉丝;");
               tips.add("板栗快省奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
               tips.add("成功领取后,请到“我的-福利中心”中查看。");
            } else {
@@ -220,7 +225,7 @@
            throw new TokenRecordException(1, "口令已失效");
         }
      } else if (tokenType == TokenTypeEnum.redPack) {
         if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
         if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            throw new TokenRecordException(1, "请升级到最新版");
         
         
@@ -244,7 +249,7 @@
            state = true;
            UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
            if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
               tips.add("确认领取后,你将成为赠送人的一级队员;");
               tips.add("确认领取后,你将成为赠送人的直接粉丝;");
               tips.add("红包可提现,可购买折扣商品;");
               tips.add("成功领取后,请到“我的-红包”中查看。");
            } else {
@@ -394,7 +399,7 @@
               boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
               String beiZhu = "无";
               if (addTeam)
                  beiZhu = "领取人已经成为你的一级队员";
                  beiZhu = "领取人已经成为你的直接粉丝";
               String userName = "无";
               UserInfo user = userInfoService.selectByPKey(uid);
@@ -488,7 +493,7 @@
               boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
               String beiZhu = "无";
               if (addTeam)
                  beiZhu = "领取人已经成为你的一级队员";
                  beiZhu = "领取人已经成为你的直接粉丝";
               String userName = "无";
               UserInfo user = userInfoService.selectByPKey(uid);
@@ -510,7 +515,7 @@
            }
         });
      } else if (tokenType == TokenTypeEnum.redPack) {
         if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
         if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
            throw new TokenRecordException(1, "请升级到最新版");
         
         try {
@@ -527,8 +532,8 @@
                  String beiZhu = "无";
                  String giveBeiZhu = "无";
                  if (addTeam) {
                     beiZhu = "你已成为赠送人的一级队员";
                     giveBeiZhu = "领取人已成为你的一级队员";
                     beiZhu = "你已成为赠送人的直接粉丝";
                     giveBeiZhu = "领取人已成为你的直接粉丝";
                     // 激活邀请信息
                     addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
                  }
@@ -602,10 +607,18 @@
      try {
         UserInfo user = userInfoService.selectByPKey(giveUid);
         UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
         String inviteCode = null;
         if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
            inviteCode = userInfoExtra.getInviteCodeVip();
         } else {
            inviteCode = userInfoExtra.getInviteCode();
         }
         MsgInviteContentDTO msgInvite = new MsgInviteContentDTO();
         msgInvite.setTitle("邀请消息");
         msgInvite.setState("成功激活邀请");
         msgInvite.setCode("你的邀请码:" + userInfoExtra.getInviteCode());
         msgInvite.setCode("你的邀请码:" + inviteCode);
         msgInvite.setInviter("昵称:"+user.getNickName());
         msgInvite.setMode("成功领取邀请人的" + giftName);
         userInviteMsgNotificationService.receiveGift(uid, "邀请关系一旦确立无法更改 ", msgInvite);
@@ -626,10 +639,6 @@
         return;
      Date date = new Date();
      for (TokenRecord tokenRecord: list) {
         Integer state = tokenRecord.getState();
         if (state != null && state == 0)
            continue;
         tokenRecord.setState(1);
         tokenRecord.setUpdateTime(date);
         tokenRecordMapper.updateByPrimaryKeySelective(tokenRecord);