From 534e0d10fdedf5fdaba6f63c99605520314a97d4 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 27 六月 2019 15:39:31 +0800
Subject: [PATCH] 分享爆品修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java |   86 ++++++++++++++++++++++--------------------
 1 files changed, 45 insertions(+), 41 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
index fe3032d..a44323f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -239,27 +239,24 @@
 
 	@Resource
 	private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
-	
+
 	@Resource
 	private UserMoneyExtraService userMoneyExtraService;
-	
+
 	@Resource
 	private UserTaoLiJinOriginService userTaoLiJinOriginService;
-	
+
 	@Resource
 	private ConfigTaoLiJinService configTaoLiJinService;
-	
+
 	@Resource
 	private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService;
-	
+
 	@Resource
 	private DeviceSexService deviceSexService;
-	
+
 	@Resource
 	private UserTaoLiJinRecordService userTaoLiJinRecordService;
-
-	
-	
 
 	@Resource
 	private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
@@ -1625,7 +1622,7 @@
 		try {
 			// 鑾峰彇璁惧瀹氫箟鎬у埆
 			int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
-			
+
 			// 1銆佷笓棰樻ā鍧�
 			JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
 
@@ -2015,7 +2012,7 @@
 		if (uid == null) {
 			data.put("collected", false);
 		} else {
-			CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid,	id);
+			CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id);
 			data.put("collected", collectionGoods != null ? true : false);
 		}
 
@@ -2061,8 +2058,7 @@
 					redisManager.saveCommonTaoToken(tb.getAuctionId(), token);
 				}
 			}
-			// 娴嬭瘯
-			if (!Constant.IS_TEST)
+			if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion()))
 				tb.setCouponLinkTaoToken(token);
 
 			// 鏈嶅姟绔浆閾�
@@ -2080,8 +2076,9 @@
 					+ tb.getCouponEffectiveEndTime().replace("-", "."));
 			// 鍒哥殑鍙d护
 
-			// 娴嬭瘯
-			if (!Constant.IS_TEST)
+			if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion()))
+				couponInfo.put("couponToken", "");
+			else
 				couponInfo.put("couponToken", token);
 			goodsJson.put("couponInfo", couponInfo);
 
@@ -2164,7 +2161,6 @@
 		data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
 
 		String noRebateHelpLink = null;
-		
 
 		// 鍟嗗搧閾炬帴
 		String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
@@ -2174,24 +2170,24 @@
 		} catch (Exception e) {
 			data.put("h5Url", h5Url);
 		}
-		
+
 		// 鏄惁鏈夎繑鍒�
 		boolean fanliValid = true;
-		//璧勯噾绫诲瀷 1-杩�  2-濂�
+		// 璧勯噾绫诲瀷 1-杩� 2-濂�
 		int moneyType = 1;
-		
+
 		// 鎺ㄥ箍绾㈠寘
 		if (from != null && from.equals("taolijin")) {
 			// 璁$畻鎺ㄥ箍绾㈠寘
 			String warningRate = configTaoLiJinService.getValueByKey("warning_value");
 			BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
-			
+
 			// 鎺ㄥ箍绾㈠寘 涓嶈兘灏忎簬1
 			if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
 				out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧涓嶅瓨鍦�"));
 				return;
 			}
-			
+
 			// 鏄惁涓烘柊鐢ㄦ埛
 			boolean isNewUser = userInfoExtraService.isNewUser(uid);
 			if (isNewUser) {
@@ -2201,13 +2197,13 @@
 					isNewUser = false;
 				}
 			}
-			
+
 			SpreadHongBao spreadHongBao = new SpreadHongBao();
 			if (isNewUser) {
 				spreadHongBao.setMoney("1");
 			} else {
 				spreadHongBao.setMoney(spreadMoney.toString());
-				
+
 				moneyType = 2;
 				fanliValid = false;
 				ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
@@ -2222,40 +2218,49 @@
 				ClientTextStyleVO textStyleVO4 = new ClientTextStyleVO();
 				textStyleVO4.setContent("棰嗙孩鍖咃紒");
 				textStyleVO4.setColor("#F14242");
-				
+
 				List<ClientTextStyleVO> listText = new ArrayList<ClientTextStyleVO>();
 				listText.add(textStyleVO1);
 				listText.add(textStyleVO2);
 				listText.add(textStyleVO3);
 				listText.add(textStyleVO4);
-				
+
 				data.put("listTip", listText);
-			} 
+			}
 			spreadHongBao.setTip("褰撴棩棰嗗彇锛屼袱澶╁唴浣跨敤锛岃繃鏃舵棤鏁�");
 			goodsJson.put("spreadHongBao", spreadHongBao);
-			
+
 			// 鐢ㄦ埛鍓╀綑鍙互娣樼ぜ閲戦獙璇�
 			UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
-			if (userMoneyExtra == null ||  userMoneyExtra.getTlj() == null) {
+			if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) {
 				data.put("userHongbao", new BigDecimal(0).setScale(2).toString());
 			} else {
 				data.put("userHongbao", userMoneyExtra.getTlj().setScale(2).toString());
 			}
-			
+
 			noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link");
+
+			if (Constant.IS_TEST) {
+				fanliValid = true;
+				goodsJson.put("shareValid", false);
+				JSONObject tljNum = new JSONObject();
+				tljNum.put("percent", "80");
+				tljNum.put("num", "8825");
+				goodsJson.put("tljNum", tljNum);
+			}
+
 		}
-			
+
 		goodsJson.put("moneyType", moneyType);
 		goodsJson.put("fanliValid", fanliValid);
 		data.put("goods", goodsJson);
-		
+
 		if (!StringUtil.isNullOrEmpty(noRebateHelpLink)) {
 			data.put("noRebateHelpLink", noRebateHelpLink);
 		} else {
 			data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
 		}
-		
-		
+
 		// 鍙栨秷鍒嗕韩娲诲姩
 		// if (!StringUtil.isNullOrEmpty(uid)
 		// &&
@@ -2281,7 +2286,7 @@
 			public void run() {
 				// 娣诲姞娴忚璁板綍
 				try {
-					scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(),goodsInfo);
+					scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(), goodsInfo);
 				} catch (Exception e) {
 					e.printStackTrace();
 				}
@@ -2479,7 +2484,7 @@
 		}
 
 		try {
-			
+
 			List<Special> list = new ArrayList<Special>();
 			// 涓撻娲诲姩
 			String specialCard = "special_activities";
@@ -2490,24 +2495,23 @@
 			if (listSpecial != null) {
 				list.addAll(listSpecial);
 			}
-			
+
 			for (int i = 0; i < list.size(); i++) {
 				Special special = list.get(i);
-				
+
 				JumpDetailV2 jumpDetail = special.getJumpDetail();
 				if (jumpDetail != null) {
 					jumpDetail.setNeedLogin(special.isJumpLogin());
 					special.setJumpDetail(jumpDetail);
 				}
-				
-				
+
 				String name = special.getName();
 				if (StringUtil.isNullOrEmpty(name)) {
 					continue;
 				}
-				
+
 				// 鏄惁闇�瑕佸脊鍑烘
-				if (name.equals("璐︽埛绛夌骇鐗规潈")) { 
+				if (name.equals("璐︽埛绛夌骇鐗规潈")) {
 					if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
 						list.remove(i);
 						i--;

--
Gitblit v1.8.0