From 5fffa0cbd5e72ffd51a0d4116449733292de8442 Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期三, 04 三月 2020 14:02:41 +0800 Subject: [PATCH] 加入拼多多转链 --- fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java index 03f752c..47cef12 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java @@ -417,7 +417,7 @@ if (addComment) { String commentText = ""; if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { - TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsId, null); + TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsId, "0"); String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); commentText = template.replace("[鍙d护]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); } else if (goodsType == Constant.SOURCE_TYPE_JD) { @@ -443,6 +443,9 @@ } else { commentText = commentText.replace("[鍒稿悗浠穄", goodsDetailVO.getCouponPrice().toString()); } + + commentText =commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); + CommentInfo commentInfo = new CommentInfo(); commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); @@ -1277,7 +1280,15 @@ for (CommentInfo commentInfo: comments) { String typeCoupon = commentInfo.getType(); if (StringUtil.isNullOrEmpty(typeCoupon)) { - commentInfo.setType(commentInfo.getTypeEnum().getDesc()); + if (commentInfo.getTypeEnum() == null) { + commentInfo.setType(""); + } else { + commentInfo.setType(commentInfo.getTypeEnum().getDesc()); + } + } else if (typeCoupon.equals(CommentInfoEnum.goodsCoupon.name())) { + commentInfo.setType("鍟嗗搧浼樻儬鍒�"); + } else if (typeCoupon.equals(CommentInfoEnum.currencyCoupon.name())) { + commentInfo.setType("閫氱敤浼樻儬鍒�"); } String coupon = commentInfo.getCoupon(); @@ -1470,7 +1481,7 @@ goodsEvaluate.setGoods(goodsVO); - TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(0L, goodsVO.getGoodsId(), null); + TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), null); String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); String commentText = template.replace("[鍙d护]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); @@ -1481,6 +1492,8 @@ } else { commentText = commentText.replace("[鍒稿悗浠穄", goodsVO.getCouponPrice().toString()); } + commentText =commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); + CommentInfo commentInfo = new CommentInfo(); commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); -- Gitblit v1.8.0