From b842c5a62188655b9892a09debe7985fa395f1ea Mon Sep 17 00:00:00 2001 From: yj <Administrator@192> Date: 星期四, 05 三月 2020 10:42:48 +0800 Subject: [PATCH] 所有平台商品不管有没有券都自动生成评论 --- fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java | 58 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 29 insertions(+), 29 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 195ec61..48eba2c 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 @@ -424,11 +424,10 @@ } } - // 鏃犲埜涓嶈兘鑷姩 鐢熸垚璇勮 - CouponInfoVO couponInfo1 = goodsDetailVO.getCouponInfo(); - if (couponInfo1 == null) { - addComment = false; - } + /* + * // 鏃犲埜涓嶈兘鑷姩 鐢熸垚璇勮 CouponInfoVO couponInfo1 = goodsDetailVO.getCouponInfo(); if + * (couponInfo1 == null) { addComment = false; } + */ if (addComment) { @@ -1618,32 +1617,33 @@ } else { simpleGoods.setPrice(goodsVO.getCouponPrice()); simpleGoods.setAmount(couponInfo.getAmount()); - - TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), null); - String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); - String commentText = template.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); - - commentText = commentText.replace("[鍘熶环]", goodsVO.getZkPrice().toString()); - if (!goodsVO.isHasCoupon()) { - commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘"); - commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", ""); - } 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("-", "")); - commentInfo.setContent(commentText); - commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); - commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); - - List<CommentInfo> commentsNew = new ArrayList<>(); - commentsNew.add(commentInfo); - goodsEvaluate.setComments(commentsNew); } imgInfo.setGoods(simpleGoods); + + TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), null); + String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); + String commentText = template.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); + + commentText = commentText.replace("[鍘熶环]", goodsVO.getZkPrice().toString()); + if (!goodsVO.isHasCoupon()) { + commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘"); + commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", ""); + } 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("-", "")); + commentInfo.setContent(commentText); + commentInfo.setTypeEnum(CommentInfoEnum.goodsCoupon); + commentInfo.setType(CommentInfoEnum.goodsCoupon.getDesc()); + + List<CommentInfo> commentsNew = new ArrayList<>(); + commentsNew.add(commentInfo); + goodsEvaluate.setComments(commentsNew); + goodsEvaluate.setGoods(goodsVO); } -- Gitblit v1.8.0