From 9dfa6e9e3289b577cbdb6905ef336188c3ca576a Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 12 五月 2020 20:05:53 +0800 Subject: [PATCH] 团队每天的等级统计 --- fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java b/fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java index 63fc89c..b27d8e3 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java @@ -15,9 +15,10 @@ import com.yeshi.fanli.entity.bus.user.vip.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(); + } } -- Gitblit v1.8.0