From ee1d39f11b9483b64a88029f1755a6e7166fea15 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期日, 26 四月 2020 16:49:21 +0800
Subject: [PATCH] 等级显示问题

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java |  182 ++++++--------------------------------------
 1 files changed, 27 insertions(+), 155 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
index 94b524a..119559b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleSerivceImpl.java
@@ -105,16 +105,6 @@
 			threeSale.setWorker(inviteeUser);
 			threeSaleMapper.insertSelective(threeSale);
 
-			List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), inviteeUser.getId());
-			if (listExpire != null && listExpire.size() > 0) {
-				// 鍒犻櫎澶辨晥
-				for (ThreeSale saleExpire : listExpire) {
-					msgInviteDetailService.deleteByThreeSale(saleExpire);
-				}
-				// 鍒犻櫎宸插け鏁堝叧绯�
-				threeSaleMapper.deleteExpireRecord(inviter.getId(), inviteeUser.getId());
-			}
-
 		} else {// 鏄凡缁忓瓨鍦ㄧ殑鐢ㄦ埛
 			if (worker.getId().longValue() == inviter.getId())
 				throw new ThreeSaleException(4, "涓嶈兘缁戝畾鑷繁");
@@ -144,20 +134,6 @@
 						threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
 						threeSale.setWorker(worker);
 						threeSaleMapper.insertSelective(threeSale);
-
-						// 鍒犻櫎宸插け鏁堝叧绯�
-						threeSaleMapper.deleteExpireRecord(inviter.getId(), worker.getId());
-
-						List<ThreeSale> listExpire = threeSaleMapper.getExpireRecord(inviter.getId(), worker.getId());
-						if (listExpire != null && listExpire.size() > 0) {
-							// 鍒犻櫎鍘嗗彶閫氱煡
-							for (ThreeSale saleExpire : listExpire) {
-								msgInviteDetailService.deleteByThreeSale(saleExpire);
-							}
-							// 鍒犻櫎宸插け鏁堝叧绯�
-							threeSaleMapper.deleteExpireRecord(inviter.getId(), worker.getId());
-						}
-
 					} else {
 						// 杩樺瓨鍦ㄦ湁鏁堢殑閭�璇凤紝鍒欎笉鍋氬鐞�
 					}
@@ -232,63 +208,27 @@
 		}
 	}
 
-	@Override
-	public long getFirstUsersCount(Long uid) {
-		return threeSaleMapper.countFirstTeam(uid, null);
-	}
-
-	@Override
-	public long getSecondUsersCount(Long uid) {
-		return threeSaleMapper.countSecondTeam(uid, null);
-	}
-
-	@Override
-	public List<ThreeSale> queryMyFirstTeamList(int start, int count, String key, Long bossId) {
-		return threeSaleMapper.queryMyFirstTeamList(start, count, key, bossId);
-	}
-
-	@Override
-	public long queryCountMyFirstTeamList(String key, Long bossId) {
-		return threeSaleMapper.queryCountMyFirstTeamList(key, bossId);
-	}
-
-	@Override
-	public List<ThreeSale> queryMySecondTeamList(int start, int count, String key, Long bossId) {
-		return threeSaleMapper.queryMySecondTeamList(start, count, key, bossId);
-	}
-
-	@Override
-	public long queryCountMySecondTeamList(String key, Long bossId) {
-		return threeSaleMapper.queryCountMySecondTeamList(key, bossId);
-	}
-
-	@Override
-	public int deleteByPrimaryKey(Long id) {
-		return threeSaleMapper.deleteByPrimaryKey(id);
-	}
-
-
 
 	@Override
 	public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
-			String endTime) {
-		return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime);
+			String endTime, Integer validState) {
+		return threeSaleMapper.listFirstTeamQuery(start, count, uid, state, startTime, endTime, validState);
 	}
 
 	@Override
-	public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime) {
-		return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime);
+	public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState) {
+		return threeSaleMapper.countFirstTeamQuery(uid, state, startTime, endTime, validState);
 	}
 
 	@Override
 	public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
-			String endTime) {
-		return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime);
+			String endTime, Integer validState) {
+		return threeSaleMapper.listSecondTeamQuery(start, count, uid, state, startTime, endTime, validState);
 	}
 
 	@Override
-	public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime) {
-		return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime);
+	public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime, Integer validState) {
+		return threeSaleMapper.countSecondTeamQuery(uid, state, startTime, endTime, validState);
 	}
 
 	@Override
@@ -299,16 +239,6 @@
 	@Override
 	public long countSuperiorQuery(Integer state, Long uid) {
 		return threeSaleMapper.countSuperiorQuery(state, uid);
-	}
-
-	@Override
-	public long countFirstTeam(Long uid, Integer state) {
-		return threeSaleMapper.countFirstTeam(uid, state);
-	}
-
-	@Override
-	public long countSecondTeam(Long uid, Integer state) {
-		return threeSaleMapper.countSecondTeam(uid, state);
 	}
 
 	@Override
@@ -327,27 +257,22 @@
 	}
 
 	@Override
-	public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state) {
-
-		List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid, state);
+	public JSONObject getMyFirstTeam(long start, int count, Long uid) {
+		List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid);
 		if (list == null) {
 			list = new ArrayList<ThreeSale>();
 		}
-
-		long countTotal = threeSaleMapper.countFirstTeam(uid, state);
-
+		long countTotal = threeSaleMapper.countFirstTeam(uid);
 		return organizeTeam(countTotal, list);
 	}
 
 	@Override
-	public JSONObject getMySecondTeam(long start, int count, Long uid, Integer state) {
-		List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid, state);
+	public JSONObject getMySecondTeam(long start, int count, Long uid) {
+		List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid);
 		if (list == null) {
 			list = new ArrayList<ThreeSale>();
 		}
-
-		long countTotal = threeSaleMapper.countSecondTeam(uid, state);
-
+		long countTotal = threeSaleMapper.countSecondTeam(uid);
 		return organizeTeam(countTotal, list);
 	}
 
@@ -549,11 +474,7 @@
 		return threeSaleMapper.getByWorkerId(workerId);
 	}
 
-	@Override
-	public long countSuccessFirstTeam(Long uid) {
-		return threeSaleMapper.countFirstTeam(uid, 1);
-	}
-
+	 
 	@Override
 	public ThreeSale selectByWorkerId(Long workerId) {
 		return threeSaleMapper.selectSuccessByWorkerId(workerId);
@@ -570,34 +491,25 @@
 	}
 
 	@Override
-	public List<ThreeSale> listFirstTeam(long start, int count, Long uid, Integer state) {
-		return threeSaleMapper.listFirstTeam(start, count, uid, state);
+	public List<ThreeSale> listFirstTeam(long start, int count, Long uid) {
+		return threeSaleMapper.listFirstTeam(start, count, uid);
 	}
 
 	@Override
-	public List<ThreeSale> listFirstTeamByUndeleted(long start, int count, Long uid) {
-		return threeSaleMapper.listFirstTeamByUndeleted(start, count, uid);
+	public List<ThreeSale> listSecondTeam(long start, int count, Long uid) {
+		return threeSaleMapper.listSecondTeam(start, count, uid);
+	}
+	
+	@Override
+	public long countFirstTeam(Long uid) {
+		return threeSaleMapper.countFirstTeam(uid);
 	}
 
 	@Override
-	public long countFirstTeamByUndeleted(Long uid) {
-		return threeSaleMapper.countFirstTeamByUndeleted(uid);
+	public long countSecondTeam(Long uid) {
+		return threeSaleMapper.countSecondTeam(uid);
 	}
-
-	@Override
-	public List<ThreeSale> listSecondTeamByUndeleted(long start, int count, Long uid) {
-		return threeSaleMapper.listSecondTeamByUndeleted(start, count, uid);
-	}
-
-	@Override
-	public long countSecondTeamByUndeleted(Long uid) {
-		return threeSaleMapper.countSecondTeamByUndeleted(uid);
-	}
-
-	@Override
-	public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state) {
-		return threeSaleMapper.listSecondTeam(start, count, uid, state);
-	}
+	
 
 	@Override
 	public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
@@ -642,46 +554,6 @@
 	public List<ThreeSale> getMyBossDeepList(Long uid) {
 		//TODO 闇�瑕佹洿鍔犵畝渚跨殑鏂瑰紡澶勭悊
 		return getMyBossDeepList(uid, 100);
-	}
-
-	@Override
-	public void remvoeBreak(Long id, Long uid, Long tid) {
-		ThreeSale threeSale = threeSaleMapper.selectByPrimaryKey(id);
-		if (threeSale == null) {
-			return;
-		}
-
-		Long workerId = threeSale.getWorker().getId();
-		if (tid.longValue() != workerId.longValue()) {
-			return;
-		}
-
-		Integer expire = threeSale.getExpire();
-		if (expire == ThreeSale.EXPIRE_NORMAL) {
-			return;
-		}
-
-		int upExpire = expire;
-		Long bossId = threeSale.getBoss().getId();
-		if (bossId.longValue() == uid.longValue()) { // 鐩存帴绮変笣
-			if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL4) {
-				upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL34;
-			} else {
-				upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL3;
-			}
-		} else { // 闂存帴绮変笣
-			if (expire == ThreeSale.EXPIRE_BREAK_VIP_DEL3) {
-				upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL34;
-			} else {
-				upExpire = ThreeSale.EXPIRE_BREAK_VIP_DEL4;
-			}
-		}
-
-		ThreeSale update = new ThreeSale();
-		update.setId(id);
-		update.setExpire(upExpire);
-		update.setUpdateTime(java.lang.System.currentTimeMillis());
-		threeSaleMapper.updateByPrimaryKeySelective(update);
 	}
 
 }

--
Gitblit v1.8.0