From 6fdcc0c26dd33e87a024a69ed635d9aedb59cad6 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 07 一月 2020 12:02:50 +0800
Subject: [PATCH] 订单搜索引擎增量更新

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 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 fee5ff4..57cd720 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
@@ -44,6 +44,7 @@
 import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
 import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
 import com.yeshi.fanli.util.Constant;
+import com.yeshi.fanli.util.RedisKeyEnum;
 import com.yeshi.fanli.util.RedisManager;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.VersionUtil;
@@ -135,8 +136,8 @@
 			if (wxUnionId == null || wxUnionId.trim().length() == 0)
 				throw new UserInfoExtraException(1, "寰俊鎺堟潈澶辫触");
 
-			String activeWX = StringUtil.Md5("activeWX:" + weiXinUser.getUnionid());
-			redisManager.cacheCommonString(activeWX, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
+			String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
+			redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
 
 			// 閭�璇峰叧绯荤敤鎴蜂俊鎭�
 			UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, wxUnionId);
@@ -145,7 +146,7 @@
 			data.put("nickName", userInfo.getNickName());
 			data.put("portrait", userInfo.getPortrait());
 			data.put("tips", "纭瑕佹垚涓篢A鐨勭洿鎺ョ矇涓濆悧锛熼個璇峰叧绯讳竴鏃﹀缓绔嬩笉鍙洿鏀广��");
-			data.put("key", activeWX);
+			data.put("key", key);
 			out.print(JsonUtil.loadTrueResult(data));
 		} catch (UserInfoExtraException e) {
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -211,7 +212,7 @@
 		}
 
 		boolean needVIPInfo = false;
-		if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
+		if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
 			needVIPInfo = true;
 
 		// 缁勭粐鏁版嵁
@@ -370,7 +371,7 @@
 	 */
 	@RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
 	public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
-		JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid));
+		JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
 		JSONObject resultData = new JSONObject();
 
 		long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
@@ -423,6 +424,23 @@
 	}
 
 	/**
+	 * 鑾峰彇鐢ㄦ埛淇℃伅
+	 * @param acceptData
+	 * @param uid
+	 * @param out
+	 */
+	@RequestMapping(value = "getBossInfo", method = RequestMethod.POST)
+	public void getBossInfo(AcceptData acceptData, Long uid, PrintWriter out) {
+		if (uid == null || uid <= 0) {
+			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
+			return;
+		}
+		JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
+		out.print(JsonUtil.loadTrueResult(bossData));
+	}
+	
+	
+	/**
 	 * 涓婄骇淇℃伅缁勭粐
 	 * 
 	 * @param acceptData
@@ -430,7 +448,7 @@
 	 * @param threeSale
 	 * @return
 	 */
-	private JSONObject getBossInfo(AcceptData acceptData, long uid, ThreeSale threeSale) {
+	private JSONObject getBossInfo(long uid, ThreeSale threeSale) {
 		JSONObject bossData = new JSONObject();
 		if (threeSale != null && threeSale.getBoss() != null) {
 			UserInfo boss = threeSale.getBoss();
@@ -608,4 +626,28 @@
 			out.print(JsonUtil.loadFalseResult("閭�璇蜂俊鎭幏鍙栧け璐�"));
 		}
 	}
+	
+	/**
+	 * 绔欏唴淇℃彁閱掗槦鍛樻坊鍔犲井淇″彿
+	 * 
+	 * @param acceptData
+	 * @param uid
+	 * @param inviteId
+	 * @param out
+	 */
+	@RequestMapping(value = "tailorCode")
+	public void tailorCode(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
+		if (uid == null) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛id缂哄け"));
+			return;
+		}
+
+		JSONObject data = new JSONObject();
+		data.put("num", threeSaleSerivce.countFirstTeam(uid, 1));
+		data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
+		JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
+	}
+	
+	
+	
 }

--
Gitblit v1.8.0