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/ShareControllerV2.java |   60 +++++++++++++++++++++++++++++-------------------------------
 1 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
index 4dbe52b..d782e60 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -219,19 +219,8 @@
 		}
 	}
 
-	public static String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
-		String content = String.format("銆�%s銆�%s鍏�", goods.getUserType() == 1 ? "T鐚环" : "T瀹濅环",
-				MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
-		content += "\n\r";
-
-		if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
-			content += String.format("銆愬埜鍚庝环銆�%s鍏�", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
-			content += "\n\r";
-		}
-		content += "------------";
-		content += "\n\r";
-		content += "寰╁埗杩欐潯" + token + "锛岄�插叆Tao瀹濆嵆鍙喘涔�";
-		return content;
+	public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) {
+		return template.replace("[娣樺彛浠", token);
 	}
 
 	/**
@@ -284,8 +273,9 @@
 			TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
 
 			if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
-				ConfigParamsDTO dto = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
-						hongBaoManageService.getShareRate(), new BigDecimal(80));
+				ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+						acceptData.getVersion());
+
 				GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
 				shareInfo.setGoodsInfo(goodsInfo);
 			}
@@ -362,9 +352,11 @@
 			// 娴嬭瘯
 			// 2.0.2涔嬪墠
 			if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
-				shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
+				shareInfo.setClickUrl(getERCodeContent(configService.get("taobao_share_qrcode_text"),
+						taoBaoLink.getGoods(), shareInfo.getToken()));
 
-			shareInfo.setWxErCode(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
+			shareInfo.setWxErCode(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(),
+					shareInfo.getToken()));
 
 			// 鎻愮ず鍥炬枃鍐呭
 			String imgs = configService.get("goods_share_notify_imgs");
@@ -393,7 +385,8 @@
 				}
 			}
 
-			out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+			out.print(JsonUtil.loadTrueResult(
+					JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 			final TaoBaoLink taobaoLink = taoBaoLink;
 			// 寮傛鎿嶄綔
@@ -411,7 +404,7 @@
 					history.setQuanLink(taobaoLink.getCouponLink());
 					history.setGoodsId(taobaoLink.getGoods().getAuctionId());
 					history.setPostPicture(taobaoLink.getGoods().getPictUrl());
-
+					history.setShareImg(taobaoLink.getClickUrl());
 					List<String> imgList = taobaoLink.getGoods().getImgList();
 					if (imgList == null) {
 						imgList = new ArrayList<>();
@@ -592,7 +585,7 @@
 					history.setQuanLink(taobaoLink.getCouponLink());
 					history.setGoodsId(finalGoods.getAuctionId());
 					history.setPostPicture(finalGoods.getPictUrl());
-
+					history.setShareImg(taobaoLink.getClickUrl());
 					List<String> imgList = finalGoods.getImgList();
 					if (imgList == null) {
 						imgList = new ArrayList<>();
@@ -651,8 +644,8 @@
 		shareInfo.setCommentTexts(new ArrayList<>());
 
 		if (needGoods)
-			shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods, new ConfigParamsDTO(
-					hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), new BigDecimal(80))));
+			shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
+					hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
 
 		String shareText = "";
 		boolean hasCoupon = false;
@@ -706,7 +699,8 @@
 				e1.printStackTrace();
 			}
 		}
-		out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+		out.print(JsonUtil.loadTrueResult(
+				JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 		// 寮傛鎿嶄綔
 		final JDGoods goods = jdGoods;
@@ -724,7 +718,8 @@
 				history.setQuanLink(null);
 				history.setGoodsId(goodsId);
 				history.setPostPicture(goods.getPicUrl());
-
+				history.setShareImg(jumpLink);
+				
 				List<String> imgList = goods.getImageList();
 				if (imgList == null) {
 					imgList = new ArrayList<>();
@@ -767,8 +762,11 @@
 		shareInfo.setRule(configService.get("share_rule_link_pdd"));
 		shareInfo.setPictUrl(goods.getGoodsImageUrl());
 		if (needGoods) {
-			shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, new ConfigParamsDTO(
-					hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), new BigDecimal(80))));
+			shareInfo
+					.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
+							new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
+									hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
+									hongBaoManageService.getVIPFanLiRate())));
 		}
 
 		String template = "";
@@ -828,7 +826,8 @@
 				e1.printStackTrace();
 			}
 		}
-		out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
+		out.print(JsonUtil.loadTrueResult(
+				JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
 
 		// 寮傛鎿嶄綔
 		com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
@@ -845,7 +844,7 @@
 				history.setQuanLink(null);
 				history.setGoodsId(goodsId);
 				history.setPostPicture(goods.getGoodsImageUrl());
-
+				history.setShareImg(jumpLink);
 				List<String> imgList = null;
 				String[] goodsGalleryUrls = goods.getGoodsGalleryUrls();
 				if (goodsGalleryUrls != null) {
@@ -1417,9 +1416,8 @@
 			}
 		}
 
-		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-		BigDecimal shareRate = hongBaoManageService.getShareRate();
-		ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+		ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+				acceptData.getVersion());
 
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();

--
Gitblit v1.8.0