From d5dfd55f3dc45948a59cdcfef30e5fbc770f5721 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@MS-20170306HGUF>
Date: 星期日, 23 二月 2020 15:11:19 +0800
Subject: [PATCH] 图片尺寸保存

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java |   50 ++++++++++++++++++++++++--------------------------
 1 files changed, 24 insertions(+), 26 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 e42cbf1..966378b 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
@@ -162,21 +162,21 @@
 			BigDecimal fanliMoney) {
 		List<ShareGoodsCommentChoiceInfo> list = new ArrayList<>();
 		if (!StringUtil.isNullOrEmpty(token))
-			list.add(
-					new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_TOKEN, "娣樺彛浠�", token, true, false));
+			list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_TOKEN, "娣樺彛浠�",
+					String.format("寰╄=杩欐潯%s\n杩涘叆銆怲ao瀹濄�戝嵆鍙姠璐�", token), true, false));
 		if (!StringUtil.isNullOrEmpty(link)) {
 			list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_LINK, "閾炬帴", link, true, false));
 		}
 		if (!StringUtil.isNullOrEmpty(inviteCode)) {
-			list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_INVITE_CODE, "閭�璇风爜", inviteCode,
-					false, true));
+			list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_INVITE_CODE, "閭�璇风爜",
+					"閭�璇风爜锛�" + inviteCode, false, true));
 		}
 
 		list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_DOWNLOAD_LINK, "涓嬭浇閾炬帴",
-				"http://www.baidu.com", false, true));
+				"涓嬭浇閾炬帴锛�" + Constant.YINGYONGBAO_LINK, false, true));
 
 		list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "杩斿埄閲戦",
-				"楼 " + fanliMoney, false, true));
+				"杩斿埄閲戦锛毬� " + fanliMoney, false, true));
 
 		return list;
 	}
@@ -413,10 +413,8 @@
 
 			String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey());
 			JSONArray array = JSONArray.fromObject(imgs);
-			int p = (int) (array.size() * Math.random());
-			if (p < array.size()) {
-				shareInfo.setNotifyPicture(array.optString(p));
-			}
+			shareInfo.setNotifyPicture(array.optString(0));
+
 			shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
 
 			// 娣诲姞鍒嗕韩璁板綍
@@ -562,13 +560,12 @@
 					taoBaoLink.getGoods(), shareInfo.getToken()));
 
 			// 鎻愮ず鍥炬枃鍐呭
-			String imgs =  configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform,
+			String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), platform,
 					Integer.parseInt(version));
 			JSONArray array = JSONArray.fromObject(imgs);
-			int p = (int) (array.size() * Math.random());
-			if (p < array.size()) {
-				shareInfo.setNotifyPicture(array.optString(p));
-			}
+
+			shareInfo.setNotifyPicture(array.optString(0));
+
 			shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotify.getKey()));
 
 			// 鍒嗕韩閲戦
@@ -592,9 +589,12 @@
 			// 璁剧疆璇勮鏂囨湰閫夐」
 			shareInfo.setCommentTextChoiceList(getCommentChoiceList(shareInfo.getToken(), null, inviteCode,
 					TaoBaoUtil.getGoodsHongBaoMoney(taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate())));
-
 			shareInfo.setCommentText(shareInfo.getShareText());
-			shareInfo.setRecommendText(shareInfo.getDescText());
+
+			if (VersionUtil.greaterThan_2_0_7(platform, version))
+				shareInfo.setRecommendText(taoBaoLink.getGoods().getDescription());
+			else
+				shareInfo.setRecommendText(shareInfo.getDescText());
 
 			out.print(JsonUtil.loadTrueResult(
 					JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
@@ -708,10 +708,9 @@
 		String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(),
 				Integer.parseInt(acceptData.getVersion()));
 		JSONArray array = JSONArray.fromObject(imgs);
-		int p = (int) (array.size() * Math.random());
-		if (p < array.size()) {
-			shareInfo.setNotifyPicture(array.optString(p));
-		}
+
+		shareInfo.setNotifyPicture(array.size() > 1 ? array.optString(1) : array.optString(0));
+
 		shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyJD.getKey()));
 
 		// 娣诲姞鍒嗕韩璁板綍
@@ -842,13 +841,12 @@
 		shareInfo.setDescText(descText);
 
 		//
-		String imgs =  configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(),
+		String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(),
 				Integer.parseInt(acceptData.getVersion()));
 		JSONArray array = JSONArray.fromObject(imgs);
-		int p = (int) (array.size() * Math.random());
-		if (p < array.size()) {
-			shareInfo.setNotifyPicture(array.optString(p));
-		}
+
+		shareInfo.setNotifyPicture(array.size() > 1 ? array.optString(1) : array.optString(0));
+
 		shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyPDD.getKey()));
 
 		// 娣诲姞鍒嗕韩璁板綍

--
Gitblit v1.8.0