From 2f2860b50f24e5e3598d223db03d43df61d95c97 Mon Sep 17 00:00:00 2001 From: yj <Administrator@192> Date: 星期五, 13 三月 2020 16:31:30 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java | 38 +++++++++++++++----------------------- 1 files changed, 15 insertions(+), 23 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 ea215a9..663d431 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 @@ -490,9 +490,15 @@ String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", "1"); String template = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey()); + if (jumpLink == null) { + throw new GoodsEvaluateException(1, "璇ュ晢鍝佽浆閾惧け璐�"); + } commentText = template.replace("[閾炬帴]", jumpLink); } else if (goodsType == Constant.SOURCE_TYPE_PDD) { String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", "1"); + if (jumpLink == null) { + throw new GoodsEvaluateException(1, "璇ュ晢鍝佽浆閾惧け璐�"); + } String template = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey()); commentText = template.replace("[閾炬帴]", jumpLink); } @@ -1541,7 +1547,6 @@ List<GoodsEvaluate> listNew = new ArrayList<>(); for (GoodsEvaluate goodsEvaluate : list) { - GoodsEvaluate evaluateNew = new GoodsEvaluate(); try { PropertyUtils.copyProperties(evaluateNew, goodsEvaluate); @@ -1550,7 +1555,6 @@ continue; } - int comment = 0; List<CommentInfo> comments = evaluateNew.getComments(); if (comments != null && comments.size() > 0) { EvaluateEnum typeEnum = evaluateNew.getType(); @@ -2288,13 +2292,8 @@ for (GoodsEvaluate goodsEvaluate: listExist) { GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null - && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType ) { - if (goodsDetailVO.getTitle().equalsIgnoreCase(goodsNew.getTitle())) { - goodsEvaluate.setGoods(goodsNew); - } else { - goodsEvaluate.setState(1); - goodsEvaluate.setRemarks("鍟嗗搧鏍囬鍙戠敓鍙樺寲涓嬫灦锛�" + goodsDetailVO.getTitle() +" / 鏂帮細" + goodsNew.getTitle()); - } + && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType) { + goodsEvaluate.setGoods(goodsNew); } // 鏇存柊鍟嗗搧淇℃伅 @@ -2310,26 +2309,19 @@ continue; } - GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); - if (goodsVO != null) { - if (goodsVO.getTitle().equalsIgnoreCase(goodsNew.getTitle())) { - simpleGoods.setState(0); - } else { - simpleGoods.setState(1); - simpleGoods.setRemarks("鍟嗗搧鏍囬鍙戠敓鍙樺寲涓嬫灦锛�" + goodsVO.getTitle() +" / 鏂帮細" + goodsNew.getTitle()); - } - } - simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); - CouponInfoVO couponInfo = goodsDetailVO.getCouponInfo(); + simpleGoods.setState(0); + simpleGoods.setPrice(goodsNew.getCouponPrice()); + CouponInfoVO couponInfo = goodsNew.getCouponInfo(); if (couponInfo == null) { - simpleGoods.setPrice(goodsDetailVO.getZkPrice()); + simpleGoods.setPrice(goodsNew.getZkPrice()); } else { - simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); + simpleGoods.setPrice(goodsNew.getCouponPrice()); simpleGoods.setAmount(couponInfo.getAmount()); } + imgInfo.setGoods(simpleGoods); - imgInfo.setGoodsVO(goodsDetailVO); + imgInfo.setGoodsVO(goodsNew); } goodsEvaluate.setImgList(imgList); -- Gitblit v1.8.0