From ee5c8055b1c0dd7c67a9025a76b10bd287c93d9a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 15 四月 2020 09:52:27 +0800
Subject: [PATCH] 资金明细增加团队分红

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java |   64 ++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 23 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
index a3ebca6..fddba37 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -29,6 +29,7 @@
 import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
 import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
 import com.yeshi.fanli.entity.bus.user.WeiXinUser;
+import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
 import com.yeshi.fanli.entity.system.BusinessSystem;
 import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.system.SystemClientParams;
@@ -359,7 +360,7 @@
 					} else {
 						if (!threeSaleExtraInfoSerivce.isRemindWorker(uid, workerId)) {
 							object.put("weiXinState", 1);
-							object.put("weiXinTip", "鐐瑰嚮鎻愰啋TA锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
+							object.put("weiXinTip", "鐐瑰嚮鎻愰啋锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
 						} else {
 							object.put("weiXinState", 2);
 							object.put("weiXinTip", "绯荤粺宸插彂閫佹彁閱掞紝閭�璇蜂汉娣诲姞寰俊鍚庝綘鍙鍒讹紝濡傚鏂硅繜杩熶笉娣诲姞锛屼綘鍙仈绯讳汉宸ュ鏈嶅姹傚府鍔�");
@@ -458,7 +459,6 @@
 				}
 			}
 			
-			
 			// 閭�璇锋垚鍔熸椂闂�
 			Long succeedTime = threeSale.getSucceedTime(); 
 			if (succeedTime == null) {
@@ -471,7 +471,7 @@
 				validFans = true;
 			}
 			
-			// 鏈�杩戠櫥褰曟椂闂�
+			// 鏈�杩戠矇涓濈櫥褰曟椂闂�
 			Date lastLoginTime = new Date(threeSale.getCreateTime());
 			UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
 			if (userInfoExtra != null && userInfoExtra.getActiveTime() != null) {
@@ -488,25 +488,31 @@
 			JSONArray array = new JSONArray();
 			array.add(loginJson);
 
-			// 绛夌骇
-			UserInviteLevelEnum level = null;
-			UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(uid);
-			if (vipLevel != null) {
-				if (vipLevel.getLevel() == UserVIPLevel.LEVEL_3) {
-					level = UserInviteLevelEnum.actived;
-				} else if (vipLevel.getLevel() == UserVIPLevel.LEVEL_7) {
-					level = UserInviteLevelEnum.actived;
-				} else if (vipLevel.getLevel() == UserVIPLevel.LEVEL_10) {
-					level = UserInviteLevelEnum.actived;
+			// 鏌ヨ绮変笣绛夌骇
+			UserLevelEnum level = null;
+			UserInviteLevelEnum inviteLevel = null;
+			UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(workerId);
+			if (vipLevel != null && vipLevel.getLevelEnum() != null) {
+				inviteLevel = vipLevel.getLevelEnum();
+				if (UserInviteLevelEnum.vipPre1 == inviteLevel) {
+					level = UserLevelEnum.normalVIP;
+				} else if (UserInviteLevelEnum.vipPre2 == inviteLevel || UserInviteLevelEnum.vipApply == inviteLevel) {
+					level = UserLevelEnum.highVIP;
+					inviteLevel = UserInviteLevelEnum.vipPre2;
+				} else if (UserInviteLevelEnum.vip == inviteLevel || UserInviteLevelEnum.tearcherApply == inviteLevel) {
+					level = UserLevelEnum.superVIP;
+					inviteLevel = UserInviteLevelEnum.vip;
+				} else if (UserInviteLevelEnum.tearcher == inviteLevel ) {
+					level = UserLevelEnum.tearcher;
 				}
 			}
 			
 			if(level == null) {
-				if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
-					level = UserInviteLevelEnum.noActive;
-				} else {
-					level = UserInviteLevelEnum.actived;
-				}
+				level = UserLevelEnum.daRen;
+			}
+			
+			if (inviteLevel == null) {
+				inviteLevel = UserInviteLevelEnum.actived;
 			}
 			
 			
@@ -518,13 +524,14 @@
 			object.put("inviteTime", format.format(new Date(succeedTime)) + " 鍔犲叆");
 			object.put("state", state? 1 : 2);
 			object.put("recentMsg", array);
-			object.put("level", level.name());
+			object.put("level", inviteLevel.name());
 			object.put("validFans", validFans);
 			
 			
 			// 鍒ゆ柇鏄惁瀛樺湪鑴辩鍏崇郴闃熷憳
-			if (vipLevel != null) {
-				UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(workerId, uid);
+			if (vipLevel != null && state) {
+				Long bossId = threeSale.getBoss().getId();
+				UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(workerId, bossId);
 				if (separate != null && separate.getEndTime() != null) {
 					try {
 						JSONObject contentJson1 = new JSONObject();
@@ -582,7 +589,7 @@
 				} else {
 					if (!threeSaleExtraInfoSerivce.isRemindWorker(uid, workerId)) {
 						object.put("weiXinState", 1);
-						object.put("weiXinTip", "鐐瑰嚮鎻愰啋TA锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
+						object.put("weiXinTip", "鐐瑰嚮鎻愰啋锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
 					} else {
 						object.put("weiXinState", 2);
 						object.put("weiXinTip", "绯荤粺宸插彂閫佹彁閱掞紝閭�璇蜂汉娣诲姞寰俊鍚庝綘鍙鍒讹紝濡傚鏂硅繜杩熶笉娣诲姞锛屼綘鍙仈绯讳汉宸ュ鏈嶅姹傚府鍔�");
@@ -727,7 +734,7 @@
 			} else {
 				if (!threeSaleExtraInfoSerivce.isRemindBoss(boss.getId(), uid)) {
 					bossData.put("weiXinState", 1);
-					bossData.put("weiXinTip", "鐐瑰嚮鎻愰啋TA锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
+					bossData.put("weiXinTip", "鐐瑰嚮鎻愰啋锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��");
 				} else {
 					bossData.put("weiXinState", 2);
 					bossData.put("weiXinTip", "绯荤粺宸插彂閫佹彁閱掞紝閭�璇蜂汉娣诲姞寰俊鍚庝綘鍙鍒讹紝濡傚鏂硅繜杩熶笉娣诲姞锛屼綘鍙仈绯讳汉宸ュ鏈嶅姹傚府鍔�");
@@ -907,6 +914,17 @@
 		JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 	}
 	
+	 
 	
+	@RequestMapping(value = "remvoeBreak")
+	public void remvoeBreak(String callback, AcceptData acceptData,Long inviteId, Long uid, Long tid, PrintWriter out) {
+		if (uid == null || inviteId == null || tid == null) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("浼犺緭鍙傛暟涓嶅畬鏁�"));
+			return;
+		}
+		threeSaleSerivce.remvoeBreak(inviteId, uid, tid);
+		
+		JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+	}
 	
 }

--
Gitblit v1.8.0