From a58c15bbfc4e3aecbbfe2f232edf8cba4d841882 Mon Sep 17 00:00:00 2001 From: yj <Administrator@192> Date: 星期三, 04 三月 2020 17:49:53 +0800 Subject: [PATCH] 发圈更新 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 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 0f63cda..f562bf1 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 @@ -24,6 +24,7 @@ import com.google.gson.GsonBuilder; import com.yeshi.fanli.dto.ConfigParamsDTO; import com.yeshi.fanli.dto.jd.JDCouponInfo; +import com.yeshi.fanli.dto.jd.JDPingouInfo; import com.yeshi.fanli.dto.pdd.PDDGoodsDetail; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.accept.AcceptData; @@ -624,7 +625,7 @@ String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); commentText = quickCommentText.replace("[鍘熶环]", goods.getZkPrice().toString()); - commentText = commentText.replace("[鍙d护]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); + commentText = commentText.replace("[娣樺彛浠", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) { commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘"); commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", ""); @@ -782,15 +783,31 @@ if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) { String template2 = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); recommendText = template2.replace("[鍟嗗搧鏍囬]", jdGoods.getSkuName()); - // 鏃犳帹鑽愯 recommendText = recommendText.replace("鎺ㄨ崘鐞嗙敱:[鎺ㄨ崘璇璢", ""); - String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days()); if (sales.equals("0")) { recommendText = recommendText.replace("閿�閲�:[閿�閲廬", ""); } else { recommendText = recommendText.replace("[閿�閲廬", sales.replace("涓�", "w")); } + + BigDecimal price = jdGoods.getPrice(); + JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo(); + if (pinGouInfo != null) { + price = pinGouInfo.getPingouPrice(); + } + + String template3 = configService.get(ConfigKeyEnum.quickShareJDCommentText.getKey()); + commentText = template3.replace("[鍘熶环]", BigDecimalUtil.getWithNoZera(price).toString()); + if (!hasCoupon) { + recommendText = recommendText.replace("浼樻儬鍒�:[鍒搁潰棰漖鍏�", ""); + commentText = commentText.replace("銆愬埜鍚庝环銆慬鍒稿悗浠穄鍏�", ""); + commentText = commentText.replace("棰嗗埜鎶㈣喘", "鎶㈣喘"); + } else { + recommendText = recommendText.replace("[鍒搁潰棰漖", BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString()); + commentText = commentText.replace("[鍒稿悗浠穄", BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString()); + } + commentText = commentText.replace("[閾炬帴]", jumpLink); } else { commentText = shareInfo.getShareText(); recommendText = shareInfo.getDescText(); -- Gitblit v1.8.0