From 941271bb52d26e484e2fe9c82d19bd9f94b84838 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 29 六月 2020 16:38:33 +0800
Subject: [PATCH] 拉新与免单JOB修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java |   62 +++++++++++++++++--------------
 1 files changed, 34 insertions(+), 28 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
index aca34ea..f28bd1f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -31,7 +31,6 @@
 import com.yeshi.fanli.dto.vip.VIPSearchResult;
 import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
 import com.yeshi.fanli.entity.accept.AcceptData;
-import com.yeshi.fanli.entity.bus.activity.RecommendActivity;
 import com.yeshi.fanli.entity.bus.help.AppPageNotification;
 import com.yeshi.fanli.entity.goods.CommonGoods;
 import com.yeshi.fanli.entity.jd.JDGoods;
@@ -88,7 +87,6 @@
 import com.yeshi.fanli.vo.recommend.RecommendJumpInfoVO;
 import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
 
-import net.sf.json.JSON;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 
@@ -296,7 +294,7 @@
 																		acceptData.getPlatform(),
 																		acceptData.getVersion()))));
 										// 璺宠浆璇︽儏
-										if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
+										if (VersionUtil.greaterThan_2_1_3(acceptData.getPlatform(),
 												acceptData.getVersion())) {
 											buildGoodsClick(data, goods, acceptData, gson);
 										}
@@ -315,10 +313,12 @@
 															orderHongBaoMoneyComputeService.getShowComputeRate(
 																	acceptData.getPlatform(),
 																	acceptData.getVersion()))));
-//									if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
-//											acceptData.getVersion())) {
-//										buildGoodsClick(data, goods, acceptData, gson);
-//									}
+									// if
+									// (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(),
+									// acceptData.getVersion())) {
+									// buildGoodsClick(data, goods, acceptData,
+									// gson);
+									// }
 									out.print(JsonUtil.loadTrueResult(data));
 									return;
 								}
@@ -385,40 +385,46 @@
 		JSONObject params = new JSONObject();
 		params.put("id", goods.getGoodsId() + "");
 		params.put("from", "鐚滀綘鍠滄");
-		
-		String type="";
-		switch(goods.getGoodsType()){
+
+		String type = "";
+		switch (goods.getGoodsType()) {
 		case Constant.SOURCE_TYPE_TAOBAO:
-			type="goodsdetail";
+			type = "goodsdetail";
 			break;
 		case Constant.SOURCE_TYPE_JD:
-			type="goodsdetail_jd";
+			type = "goodsdetail_jd";
 			break;
 		case Constant.SOURCE_TYPE_PDD:
-			type="goodsdetail_pdd";
+			type = "goodsdetail_pdd";
 			break;
 		case Constant.SOURCE_TYPE_VIP:
-			type="goodsdetail_vip";
+			type = "goodsdetail_vip";
 			break;
 		case Constant.SOURCE_TYPE_SUNING:
-			type="goodsdetail_suning";
+			type = "goodsdetail_suning";
 			break;
-		
+
 		}
 
-		RecommendJumpInfoVO left = new RecommendJumpInfoVO(
-				"鍘荤湅鐪�", jumpDetailV2Service.getByTypeCache(type,
-						Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())),
-				params);
-		data.put("left", gson.toJson(left));
-		
-		// 鍘荤綉椤�
-		params = new JSONObject();
-		params.put("url", "http://www.baidu.com");
-
-		RecommendJumpInfoVO right = new RecommendJumpInfoVO("鏈夋洿楂樿繑鍒╋紵", jumpDetailV2Service.getByTypeCache("web",
+		RecommendJumpInfoVO left = new RecommendJumpInfoVO("鍘荤湅鐪�", jumpDetailV2Service.getByTypeCache(type,
 				Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())), params);
-		data.put("right", gson.toJson(right));
+		data.put("left", gson.toJson(left));
+
+		// 鍘荤綉椤�
+		String rightValue = configService.getByVersion(ConfigKeyEnum.clipboardRecommendGoodsMakeMore.name(),
+				acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
+
+		if (StringUtil.isNullOrEmpty(rightValue)) {
+			data.remove("left");
+		} else {
+			params = new JSONObject();
+			params.put("url", "http://www.baidu.com");
+
+			RecommendJumpInfoVO right = new RecommendJumpInfoVO("鏈夋洿楂樿繑鍒╋紵", jumpDetailV2Service.getByTypeCache("web",
+					Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())),
+					params);
+			data.put("right", gson.toJson(right));
+		}
 	}
 
 	/**

--
Gitblit v1.8.0