From 271ae63c20fcbe28d29c47f1881138ff6551a2a1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 10 六月 2020 19:26:26 +0800
Subject: [PATCH] 唯品会订单bug修复,APP端佣金比例展示错误bug修复

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java |   71 +++++++++++++++++++++--------------
 1 files changed, 43 insertions(+), 28 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 a136c1c..402dcd7 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
@@ -1040,7 +1040,6 @@
 			int darenMonth = 0;
 			int highVIPMonth = 0;
 			int superVIPMonth = 0;
-			Date date = new Date();
 			Date minTime = TimeUtil.parseYYYYMMDD(firstday);
 			Date maxTime = TimeUtil.parseYYYYMMDD_HHMMSS(lastday + " 23:59:59");
 			List<TeamDailyRecord> listMonth = teamDailyRecordService.sumGroupByYearMonth(uid, minTime, maxTime);
@@ -1202,14 +1201,24 @@
 		if (directNum > 0) {
 			indirectNum = threeSaleSerivce.countSecondTeam(workerId);
 		}
-
+		data.put("fansNum", "鐩存帴绮変笣锛� " + directNum + "浜篭n" + "闂存帴绮変笣锛� " + indirectNum + "浜�");
+		
 		// 璁㈠崟缁熻
 		long countTB = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_TAOBAO, 60);
 		long countJD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_JD, 60);
 		long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_PDD, 60);
-
-		data.put("fansNum", "鐩存帴绮変笣锛� " + directNum + "浜篭n" + "闂存帴绮変笣锛� " + indirectNum + "浜�");
-		data.put("orderInfo", "娣樺疂 (" + countTB + "绗�)\n" + "浜笢 (" + countJD + "绗�)\n" + "鎷煎澶� (" + countPDD + "绗�)");
+		
+		StringBuilder builder = new StringBuilder();
+		builder.append("娣樺疂 (" + countTB + "绗�)");
+		builder.append("\n浜笢 (" + countJD + "绗�)");
+		builder.append("\n鎷煎澶� (" + countPDD + "绗�)");
+		if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
+			long countVip = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_VIP, 60);
+			long countSL = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_SUNING, 60);
+			builder.append("\n鍞搧浼� (" + countVip + "绗�)");
+			builder.append("\n鑻忓畞 (" + countSL + "绗�)");
+		}
+		data.put("orderInfo", builder.toString());
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -1299,7 +1308,14 @@
 		if (activeTime == null) {
 			activeTime = new Date(user.getCreatetime());
 		}
-
+		
+		String inviteCode = "";
+		if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
+			inviteCode = userInfoExtra.getInviteCode();
+		if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip()))
+			inviteCode = userInfoExtra.getInviteCodeVip();
+		
+		data.put("inviteCode", inviteCode);
 		data.put("weixin", StringUtil.isNullOrEmpty(weixin) ? "" : weixin);
 		data.put("loginTime", TimeUtil.formatDate(activeTime));
 
@@ -1311,27 +1327,16 @@
 			data.put("taobao", false);
 		}
 
-		UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(fansId);
-		if (userVIPPreInfo != null) {
-			String levelName = null;
-			Integer process = userVIPPreInfo.getProcess();
-			if (process == UserVIPPreInfo.PROCESS_2) {
-				levelName = "楂樼骇浼氬憳";
-			} else if (process == UserVIPPreInfo.PROCESS_3) {
-				levelName = "瓒呯骇浼氬憳";
-			} else if (process == UserVIPPreInfo.PROCESS_4) {
-				levelName = "璧勬繁瀵煎笀";
-			}
-
-			Integer sourceType = userVIPPreInfo.getSourceType();
-			if (sourceType != null && levelName != null) {
-				if (sourceType == UserVIPPreInfo.SOURCE_TYPE_ORDER) {
-					data.put("level", levelName += "(鑷喘鍒嗕韩鍨�)");
-				} else if (sourceType == UserVIPPreInfo.SOURCE_TYPE_TEAM) {
-					data.put("level", levelName += "(閭�璇峰洟闃熷瀷)");
-				}
-			}
+		// 褰撳墠绛夌骇
+		UserLevelEnum level = null;
+		UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(fansId);
+		if (vipLevel != null && vipLevel.getLevel() != null) {
+			level = UserLevelUtil.getByLevel(vipLevel.getLevel());
 		}
+		if (level == null) {
+			level = UserLevelEnum.daRen;
+		}
+		data.put("level", UserLevelUtil.getShowLevel(level));
 
 		// 绮変笣缁熻
 		long indirectNum = 0;
@@ -1339,14 +1344,24 @@
 		if (directNum > 0) {
 			indirectNum = threeSaleSerivce.countSecondTeam(fansId);
 		}
+		data.put("fansNum", "鐩存帴绮変笣锛� " + directNum + "浜篭n" + "闂存帴绮変笣锛� " + indirectNum + "浜�");
 
 		// 璁㈠崟缁熻
 		long countTB = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_TAOBAO, 60);
 		long countJD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_JD, 60);
 		long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_PDD, 60);
 
-		data.put("fansNum", "鐩存帴绮変笣锛� " + directNum + "浜篭n" + "闂存帴绮変笣锛� " + indirectNum + "浜�");
-		data.put("orderInfo", "娣樺疂 (" + countTB + "绗�)\n" + "浜笢 (" + countJD + "绗�)\n" + "鎷煎澶� (" + countPDD + "绗�)");
+		StringBuilder builder = new StringBuilder();
+		builder.append("娣樺疂 (" + countTB + "绗�)");
+		builder.append("\n浜笢 (" + countJD + "绗�)");
+		builder.append("\n鎷煎澶� (" + countPDD + "绗�)");
+		if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
+			long countVip = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_VIP, 60);
+			long countSL = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_SUNING, 60);
+			builder.append("\n鍞搧浼� (" + countVip + "绗�)");
+			builder.append("\n鑻忓畞 (" + countSL + "绗�)");
+		}
+		data.put("orderInfo", builder.toString());
 		JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 	}
 

--
Gitblit v1.8.0