From 28cf328a098334b51a3e9d2d56f983fb8c862211 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 23 五月 2020 09:54:38 +0800 Subject: [PATCH] 足迹、收藏订单兼容新需求 --- fanli/src/main/java/com/yeshi/fanli/service/manger/user/UserTeamStatisticManager.java | 66 ++++++++++++--------------------- 1 files changed, 24 insertions(+), 42 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..023a68a 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 @@ -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; @@ -41,23 +42,6 @@ @Resource private ThreeSaleSerivce threeSaleSerivce; - /** - * 鐢ㄦ埛绛夌骇鍗囩骇 - * @Title: userUpgraded - * @Description: - * @param uid - * @param level - * @param date - * void 杩斿洖绫诲瀷 - * @throws - */ - public void userUpgraded(Long uid, UserLevelEnum level, Date date) { - - // 鏇存柊涓�绾�,浜岀骇,浜岀骇澶栧搷搴旂殑绛夌骇鎻愬崌 - - // 缁熻 - - } /** * 鍚屾浼氬憳淇℃伅锛堜竴绾�/浜岀骇/浜岀骇澶栵級 @@ -69,7 +53,7 @@ * int 杩斿洖绫诲瀷 * @throws */ - private void syncVIPData(Date minTime, Date maxTime) { + public void syncVIPData(Date minTime, Date maxTime) { List<UserVIPPreInfo> totalList = new ArrayList<>(); @@ -78,7 +62,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 +71,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 +82,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 +131,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 +151,13 @@ * void 杩斿洖绫诲瀷 * @throws */ - private void syncData(Date minTime, Date maxTime) { + public void syncInviteAndTotalData(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); } @@ -208,28 +196,22 @@ record.setCountDay(new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"))); if (level == 1) { record.setFirstDaRen(map.get(key)); + record.setFirstNum(map.get(key)); } else if (level == 2) { record.setSecondDaRen(map.get(key)); + record.setSecondNum(map.get(key)); } else { record.setBeyondDaRen(map.get(key)); + record.setBeyondNum(map.get(key)); } - // TODO 淇濆瓨 - // teamDailyRecordService. + // 淇濆瓨 + try { + teamDailyRecordService.save(record); + } catch (TeamDailyRecordException e) { + e.printStackTrace(); + } } - - } - - /** - * 閭�璇锋垚鍔� - * @Title: inviteSuccess - * @Description: - * @param uid 琚個璇蜂汉鐢ㄦ埛ID - * @param date - * void 杩斿洖绫诲瀷 - * @throws - */ - public void inviteSuccess(Long uid, Date date) { } -- Gitblit v1.8.0