yujian
2020-05-14 ac18247de1bf14b44fd438b35d783c1a313f5286
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -32,7 +32,7 @@
import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
import com.yeshi.fanli.entity.bus.user.invite.TeamDailyRecord;
import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
import com.yeshi.fanli.entity.bus.user.vip.TearcherInfo;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
@@ -477,7 +477,7 @@
         object.put("level", level.name());
         object.put("validFans", validFans);
         if (wxtip && type == 1 && threeSale.getState() != null && threeSale.getState()) {
         if (wxtip) {
            // 一级队员 查询昵称备注
            String memoName = null;
            ThreeSaleExtraInfo threeSaleExtraInfo = threeSale.getThreeSaleExtraInfo();
@@ -488,7 +488,7 @@
            }
            object.put("memoName", memoName);
            if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
            if (type == 1 && !VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
               // 添加微信信息
               if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
                  object.put("weiXin", userInfoExtra.getWeiXin());
@@ -904,7 +904,8 @@
      if (focus.getStateValid() != null || focus.getTaobaoBind() != null || focus.getWeixinBind() != null
            || focus.getMinFansNum() != null || focus.getMinFansNum() != null
            || focus.getMinActiveTime() != null || focus.getMaxActiveTime() != null
            || focus.getMinIncome() != null  || focus.getMaxIncome() != null || !StringUtil.isNullOrEmpty(focus.getKey()))
            || focus.getMinIncome() != null  || focus.getMaxIncome() != null
            || !StringUtil.isNullOrEmpty(focus.getKey()) || !StringUtil.isNullOrEmpty(focus.getLevel()))
          return true;
   
      return false;
@@ -995,28 +996,72 @@
            highVIP.put("total", statistic.getHighFirstCount() + statistic.getHighSecondCount());
            superVIP.put("total", statistic.getSuperFirstCount() + statistic.getSuperSecondCount());
         }
         // 统计达人
         long darenToday = threeSaleSerivce.countFirstTeamByDate(uid, 1)   + threeSaleSerivce.countSecondTeamByDate(uid, 1);
         long darenMonth = threeSaleSerivce.countFirstTeamByDate(uid, 2)   + threeSaleSerivce.countSecondTeamByDate(uid, 2);
         int darenToday = 0;
         int highVIPToday = 0;
         int superVIPToday = 0;
         String createId = teamDailyRecordService.createId(uid, new Date());
         TeamDailyRecord record = teamDailyRecordService.getById(createId);
         if (record != null) {
            if (record.getFirstDaRen() != null)
               darenToday += record.getFirstDaRen();
            if (record.getSecondDaRen() != null)
               darenToday += record.getSecondDaRen();
            if (record.getFirstHighVIP() != null)
               highVIPToday += record.getFirstHighVIP();
            if (record.getSecondHighVIP() != null)
               highVIPToday += record.getSecondHighVIP();
            if (record.getFirstSuperVIP() != null)
               superVIPToday += record.getFirstSuperVIP();
            if (record.getSecondSuperVIP() != null)
               superVIPToday += record.getSecondSuperVIP();
         }
         // 获取当月第一天和最后一天
         Calendar cale = Calendar.getInstance();
           SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
           String firstday, lastday;
           // 获取前月的第一天
           cale = Calendar.getInstance();
           cale.add(Calendar.MONTH, 0);
           cale.set(Calendar.DAY_OF_MONTH, 1);
           firstday = format.format(cale.getTime());
           // 获取前月的最后一天
           cale = Calendar.getInstance();
           cale.add(Calendar.MONTH, 1);
           cale.set(Calendar.DAY_OF_MONTH, 0);
           lastday = format.format(cale.getTime());
           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);
         if (listMonth != null && listMonth.size() > 0) {
            TeamDailyRecord teamRecord = listMonth.get(0);
            if (teamRecord.getFirstDaRen() != null)
               darenMonth += teamRecord.getFirstDaRen();
            if (teamRecord.getSecondDaRen() != null)
               darenMonth += teamRecord.getSecondDaRen();
            if (teamRecord.getFirstHighVIP() != null)
               highVIPMonth += teamRecord.getFirstHighVIP();
            if (teamRecord.getSecondHighVIP() != null)
               highVIPMonth += teamRecord.getSecondHighVIP();
            if (teamRecord.getFirstSuperVIP() != null)
               superVIPMonth += teamRecord.getFirstSuperVIP();
            if (teamRecord.getSecondSuperVIP() != null)
               superVIPMonth += teamRecord.getSecondSuperVIP();
         }
         // 达人
         daren.put("today", darenToday);
         daren.put("month", darenMonth);
         SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
         String today = sd.format(new Date());
         // 当月1号
         Calendar calendar1 = Calendar.getInstance();
         calendar1.set(Calendar.DAY_OF_MONTH, 1);
         Date minTime = sd.parse(sd.format(calendar1.getTime()));
         int highVIPToday = 0;
         int highVIPMonth = 0;
          // TODO 统计高级会员数量
         // 高级会会员
         highVIP.put("today", highVIPToday);
         highVIP.put("month", highVIPMonth);
         int superVIPToday = 0;
         int superVIPMonth = 0;
          // 统计超级会员数量
         superVIP.put("today", superVIPToday);
         superVIP.put("month", superVIPMonth);
@@ -1182,7 +1227,7 @@
      int type = 1;
      ThreeSale threeSale = threeSaleSerivce.getByWorkerId(workerId);
      if (threeSale == null) {
      if (threeSale != null && threeSale.getBoss().getId() != uid) {
         type = 2;
      }
@@ -1203,6 +1248,7 @@
         threeSaleExtraInfoSerivce.insertSelective(saleExtraInfo);
      }
      // 更新粉丝记录信息
      teamFansInfoService.updateTags(workerId, type, tags);
      out.print(JsonUtil.loadTrueResult("保存成功"));
   }
@@ -1234,7 +1280,7 @@
         TeamDailyRecord monthRecord = new TeamDailyRecord(0,0,0);
         TeamDailyRecord totalityRecord = new TeamDailyRecord(0,0,0);
         
         List<TeamDailyRecord> list = teamDailyRecordService.getbyUid(uid);
         List<TeamDailyRecord> list = teamDailyRecordService.getByUid(uid);
         if (list != null && list.size() > 0) {
            for (TeamDailyRecord record: list) {
               Date statisticDay = record.getCountDay();