yujian
2020-06-09 554de444b87aab5f93cb1593a8095612cf9479a7
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -1040,7 +1040,6 @@
         int darenMonth = 0;
         int highVIPMonth = 0;
         int superVIPMonth = 0;
         Date date = new Date();
         Date minTime = TimeUtil.parseYYYYMMDD(firstday);
         Date maxTime = TimeUtil.parseYYYYMMDD_HHMMSS(lastday + " 23:59:59");
         List<TeamDailyRecord> listMonth = teamDailyRecordService.sumGroupByYearMonth(uid, minTime, maxTime);
@@ -1202,14 +1201,24 @@
      if (directNum > 0) {
         indirectNum = threeSaleSerivce.countSecondTeam(workerId);
      }
      data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
      // 订单统计
      long countTB = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_TAOBAO, 60);
      long countJD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_JD, 60);
      long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_PDD, 60);
      data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
      data.put("orderInfo", "淘宝 (" + countTB + "笔)\n" + "京东 (" + countJD + "笔)\n" + "拼多多 (" + countPDD + "笔)");
      StringBuilder builder = new StringBuilder();
      builder.append("淘宝 (" + countTB + "笔)");
      builder.append("\n京东 (" + countJD + "笔)");
      builder.append("\n拼多多 (" + countPDD + "笔)");
      if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
         long countVip = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_VIP, 60);
         long countSL = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_SUNING, 60);
         builder.append("\n唯品会 (" + countVip + "笔)");
         builder.append("\n苏宁 (" + countSL + "笔)");
      }
      data.put("orderInfo", builder.toString());
      out.print(JsonUtil.loadTrueResult(data));
   }
@@ -1299,7 +1308,14 @@
      if (activeTime == null) {
         activeTime = new Date(user.getCreatetime());
      }
      String inviteCode = "";
      if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
         inviteCode = userInfoExtra.getInviteCode();
      if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip()))
         inviteCode = userInfoExtra.getInviteCodeVip();
      data.put("inviteCode", inviteCode);
      data.put("weixin", StringUtil.isNullOrEmpty(weixin) ? "" : weixin);
      data.put("loginTime", TimeUtil.formatDate(activeTime));
@@ -1311,27 +1327,16 @@
         data.put("taobao", false);
      }
      UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(fansId);
      if (userVIPPreInfo != null) {
         String levelName = null;
         Integer process = userVIPPreInfo.getProcess();
         if (process == UserVIPPreInfo.PROCESS_2) {
            levelName = "高级会员";
         } else if (process == UserVIPPreInfo.PROCESS_3) {
            levelName = "超级会员";
         } else if (process == UserVIPPreInfo.PROCESS_4) {
            levelName = "资深导师";
         }
         Integer sourceType = userVIPPreInfo.getSourceType();
         if (sourceType != null && levelName != null) {
            if (sourceType == UserVIPPreInfo.SOURCE_TYPE_ORDER) {
               data.put("level", levelName += "(自购分享型)");
            } else if (sourceType == UserVIPPreInfo.SOURCE_TYPE_TEAM) {
               data.put("level", levelName += "(邀请团队型)");
            }
         }
      // 当前等级
      UserLevelEnum level = null;
      UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(fansId);
      if (vipLevel != null && vipLevel.getLevel() != null) {
         level = UserLevelUtil.getByLevel(vipLevel.getLevel());
      }
      if (level == null) {
         level = UserLevelEnum.daRen;
      }
      data.put("level", UserLevelUtil.getShowLevel(level));
      // 粉丝统计
      long indirectNum = 0;
@@ -1339,14 +1344,24 @@
      if (directNum > 0) {
         indirectNum = threeSaleSerivce.countSecondTeam(fansId);
      }
      data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
      // 订单统计
      long countTB = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_TAOBAO, 60);
      long countJD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_JD, 60);
      long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_PDD, 60);
      data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
      data.put("orderInfo", "淘宝 (" + countTB + "笔)\n" + "京东 (" + countJD + "笔)\n" + "拼多多 (" + countPDD + "笔)");
      StringBuilder builder = new StringBuilder();
      builder.append("淘宝 (" + countTB + "笔)");
      builder.append("\n京东 (" + countJD + "笔)");
      builder.append("\n拼多多 (" + countPDD + "笔)");
      if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
         long countVip = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_VIP, 60);
         long countSL = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_SUNING, 60);
         builder.append("\n唯品会 (" + countVip + "笔)");
         builder.append("\n苏宁 (" + countSL + "笔)");
      }
      data.put("orderInfo", builder.toString());
      JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
   }