From aa774af6df16ef11e1e34ac5aeed9aae0cb3e8e2 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 09 四月 2020 16:25:03 +0800
Subject: [PATCH] 团队分红完善

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/TeamUserLevelStatisticServiceImpl.java |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/TeamUserLevelStatisticServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/TeamUserLevelStatisticServiceImpl.java
index a071386..62a721d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/TeamUserLevelStatisticServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/TeamUserLevelStatisticServiceImpl.java
@@ -40,6 +40,7 @@
 		int normalFirstCount = 0;
 		int highFirstCount = 0;
 		int superFirstCount = 0;
+		int tearcherFirstCount = 0;
 		for (ThreeSale ts : list) {
 			UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorker().getId());
 			if (level == UserLevelEnum.normalVIP) {
@@ -48,12 +49,15 @@
 				highFirstCount++;
 			} else if (level == UserLevelEnum.superVIP) {
 				superFirstCount++;
+			} else if (level == UserLevelEnum.tearcher) {
+				tearcherFirstCount++;
 			}
 		}
 
 		int normalSecondCount = 0;
 		int highSecondCount = 0;
 		int superSecondCount = 0;
+		int tearcherSecondCount = 0;
 
 		long secondCount = threeSaleSerivce.countSecondTeam(uid, state);
 		int pageSize = 1000;
@@ -69,6 +73,8 @@
 						highSecondCount++;
 					} else if (level == UserLevelEnum.superVIP) {
 						superSecondCount++;
+					} else if (level == UserLevelEnum.tearcher) {
+						tearcherSecondCount++;
 					}
 				}
 		}
@@ -81,6 +87,8 @@
 		statistic.setHighSecondCount(highSecondCount);
 		statistic.setSuperFirstCount(superFirstCount);
 		statistic.setSuperSecondCount(superSecondCount);
+		statistic.setTearcherFirstCount(tearcherFirstCount);
+		statistic.setTearcherSecondCount(tearcherSecondCount);
 		statistic.setId(uid);
 		statistic.setLevel(level);
 		add(statistic);
@@ -90,7 +98,7 @@
 	public void add(TeamUserLevelStatistic statistic) {
 		TeamUserLevelStatistic old = selectByUid(statistic.getId());
 		if (old == null) {
-			if(statistic.getCreateTime()==null)
+			if (statistic.getCreateTime() == null)
 				statistic.setCreateTime(new Date());
 			teamUserLevelStatisticMapper.insertSelective(statistic);
 		} else {
@@ -99,4 +107,14 @@
 		}
 	}
 
+	@Override
+	public void updateUserLevel(Long uid) {
+		UserLevelEnum level = userLevelManager.getUserLevel(uid);
+		TeamUserLevelStatistic statistic = new TeamUserLevelStatistic();
+		statistic.setId(uid);
+		statistic.setLevel(level);
+		statistic.setUpdateTime(new Date());
+		teamUserLevelStatisticMapper.updateByPrimaryKeySelective(statistic);
+	}
+
 }

--
Gitblit v1.8.0