admin
2020-05-12 2ec42a5aacea35d2918f0e17f07685cf5b4d25c8
fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java
@@ -12,12 +12,13 @@
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.ThreeSaleDetail;
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.UserLevelEnum;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
import com.yeshi.fanli.exception.user.TeamDailyRecordException;
import com.yeshi.fanli.service.inter.user.invite.TeamDailyRecordService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
import com.yeshi.fanli.util.TimeUtil;
@@ -69,7 +70,7 @@
    * int 返回类型
    * @throws
    */
   private void syncVIPData(Date minTime, Date maxTime) {
   public void syncVIPData(Date minTime, Date maxTime) {
      List<UserVIPPreInfo> totalList = new ArrayList<>();
@@ -78,7 +79,7 @@
      int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
      for (int i = 0; i < page; i++) {
         List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.highVIP.getLevel(), minTime,
               maxTime, page, pageSize);
               maxTime, i + 1, pageSize);
         if (list != null)
            totalList.addAll(list);
      }
@@ -87,7 +88,7 @@
      page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
      for (int i = 0; i < page; i++) {
         List<UserVIPPreInfo> list = userVIPPreInfoService.listByProcess(UserLevelEnum.superVIP.getLevel(), minTime,
               maxTime, page, pageSize);
               maxTime, i + 1, pageSize);
         if (list != null)
            totalList.addAll(list);
      }
@@ -98,7 +99,7 @@
         String day = TimeUtil.getGernalTime(vipPre.getCreateTime().getTime(), "yyyy-MM-dd");
         List<ThreeSaleDetail> list = threeSaleDetailService.listByWorkerUid(vipPre.getUid());
         for (ThreeSaleDetail ts : list) {
            String key = ts.getBossUid() + "#" + vipPre.getProcess() + "#" + day + "#";
            String key = ts.getBossUid() + "#" + day + "#" + vipPre.getProcess() + "#";
            if (ts.getLevel() == 1) {
               key += "1";
            } else if (ts.getLevel() == 2) {
@@ -147,8 +148,12 @@
            tempKey = uid + "#" + day + "#" + UserLevelEnum.superVIP.getLevel() + "#" + level;
            record.setBeyondSuperVIP(map.get(tempKey));
         }
         // TODO 保存
         // teamDailyRecordService.
         // 保存
         try {
            teamDailyRecordService.save(record);
         } catch (TeamDailyRecordException e) {
            e.printStackTrace();
         }
      }
@@ -163,13 +168,13 @@
    * void 返回类型
    * @throws
    */
   private void syncData(Date minTime, Date maxTime) {
   public void syncInviteData(Date minTime, Date maxTime) {
      List<ThreeSale> totalList = new ArrayList<>();
      long count = threeSaleSerivce.countAll(minTime, maxTime);
      int pageSize = 1000;
      int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
      for (int i = 0; i < page; i++) {
         List<ThreeSale> list = threeSaleSerivce.listAll(minTime, maxTime, page, pageSize);
         List<ThreeSale> list = threeSaleSerivce.listAll(minTime, maxTime, i + 1, pageSize);
         if (list != null)
            totalList.addAll(list);
      }
@@ -213,8 +218,12 @@
         } else {
            record.setBeyondDaRen(map.get(key));
         }
         // TODO 保存
         // teamDailyRecordService.
         // 保存
         try {
            teamDailyRecordService.save(record);
         } catch (TeamDailyRecordException e) {
            e.printStackTrace();
         }
      }