yujian
2019-12-25 a3ead770c30b310b9b1b7e3786d5d847da540e55
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -631,7 +631,9 @@
            welfareCenterNews = userInfoExtra.getCouponNews();
         }
         if (userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
         if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
            invitCode = userInfoExtra.getInviteCodeVip();
         } else {
            invitCode = userInfoExtra.getInviteCode();
         }
      }
@@ -2125,6 +2127,7 @@
         }
         data.put("moduleState", mySettings);
         int tailor = 0;
         int welfareCenterNews = 0;
         String invitCode = null;
         UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
@@ -2132,11 +2135,15 @@
            if (userInfoExtra.getCouponNews() != null) {
               welfareCenterNews = userInfoExtra.getCouponNews();
            }
            if (userInfoExtra.getInviteCode() != null && userInfoExtra.getInviteCode().trim().length() > 0) {
            // vip邀请码优先
            if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
               tailor = 1;
               invitCode = userInfoExtra.getInviteCodeVip();
            } else if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
               tailor = 2;
               invitCode = userInfoExtra.getInviteCode();
            }
            if (userInfoExtra.getUserRank() != null) {
               String picture = userInfoExtra.getUserRank().getPicture();
               String icon = userInfoExtra.getUserRank().getIcon();
@@ -2155,6 +2162,8 @@
               if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
                  userInfo.setWeiXin(userInfoExtra.getWeiXin());
            }
            data.put("erCode", userInfoExtra.getErCode());
         }
         // 1.6.5 之后返回 微信号提示
         if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
@@ -2188,6 +2197,28 @@
            data.put("redPackLock", verifyForbid);
         }
         if  (!StringUtil.isNullOrEmpty(invitCode)) {
            // 2.0.6 返回邀请人
            if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
               String bossName = "";
               ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
               if (threeSale != null && threeSale.getBoss() != null) {
                  bossName = threeSale.getBoss().getNickName();
               }
               data.put("bossName", bossName);
               if(tailor == 2) {
                  long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
                  if (firstTeam >= 2) {
                     data.put("tailor", true);
                  }
               } else {
                  data.put("tailor", false);
               }
            }
         }
         out.print(JsonUtil.loadTrueResult(data));
         final UserInfo uuser = userInfo;
@@ -2300,7 +2331,7 @@
    */
   @RequestMapping(value = "saveInfo")
   public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid,
         String inviteCode, PrintWriter out) {
         String inviteCode, MultipartFile qrCodeFile, PrintWriter out) {
      try {
         if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
@@ -2375,6 +2406,14 @@
               return;
            }
         }
         // 二维码
         if (qrCodeFile != null) {
            userInfoExtraService.uploadERCode(qrCodeFile, uid);
         }
         out.print(JsonUtil.loadTrueResult("保存成功"));
      } catch (UserInfoException e) {
         out.print(JsonUtil.loadFalseResult(e.getMsg()));