yj
2020-03-05 b842c5a62188655b9892a09debe7985fa395f1ea
所有平台商品不管有没有券都自动生成评论
1个文件已修改
58 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
                    
                }