From 09417e97672be66c5e312b10f23a9e30da3acb97 Mon Sep 17 00:00:00 2001 From: Administrator <Administrator@MS-20170306HGUF> Date: 星期一, 24 二月 2020 15:23:08 +0800 Subject: [PATCH] 热销转换发圈 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java | 64 ++++++++++++++++--------------- 1 files changed, 33 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 40e69b7..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,20 +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)); + 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)); + list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_DOWNLOAD_LINK, "涓嬭浇閾炬帴", + "涓嬭浇閾炬帴锛�" + Constant.YINGYONGBAO_LINK, false, true)); - list.add( - new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "杩斿埄閲戦", "楼 "+fanliMoney, false, true)); + list.add(new ShareGoodsCommentChoiceInfo(ShareGoodsCommentChoiceInfo.TYPE_FANLI_MONEY, "杩斿埄閲戦", + "杩斿埄閲戦锛毬� " + fanliMoney, false, true)); return list; } @@ -412,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())); // 娣诲姞鍒嗕韩璁板綍 @@ -561,12 +560,12 @@ taoBaoLink.getGoods(), shareInfo.getToken())); // 鎻愮ず鍥炬枃鍐呭 - String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey()); + 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())); // 鍒嗕韩閲戦 @@ -590,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))); @@ -703,12 +705,12 @@ } shareInfo.setDescText(descText); - String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey()); + 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())); // 娣诲姞鍒嗕韩璁板綍 @@ -732,7 +734,7 @@ // 璁剧疆璇勮鏂囨湰閫夐」 shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode, JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate()))); - + shareInfo.setCommentText(shareInfo.getShareText()); shareInfo.setRecommendText(shareInfo.getDescText()); @@ -839,12 +841,12 @@ shareInfo.setDescText(descText); // - String imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs.getKey()); + 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())); // 娣诲姞鍒嗕韩璁板綍 @@ -869,7 +871,7 @@ // 璁剧疆璇勮鏂囨湰閫夐」 shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getClickUrl(), inviteCode, PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate()))); - + shareInfo.setCommentText(shareInfo.getShareText()); shareInfo.setRecommendText(shareInfo.getDescText()); -- Gitblit v1.8.0