yj
2020-03-06 207dc8655711cddac2653e18b51e58a88dba2084
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;
@@ -35,7 +36,6 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -244,14 +244,11 @@
      }
   }
   public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) {
       return template.replace("[淘口令]", token);
   }
   
   public static String getERCodeContentNew(String template, TaoBaoGoodsBrief goods, String token) {
      String commentText = template.replace("[原价]", goods.getZkPrice().toString());
      commentText = commentText.replace("[口令]", token);
      commentText = commentText.replace("[淘口令]", token);
      if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
         commentText = commentText.replace("领券抢购", "抢购");
         commentText = commentText.replace("【券后价】[券后价]元", "");
@@ -559,7 +556,7 @@
            shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
                  taoBaoLink.getGoods(), shareInfo.getToken()));
         } else if (!VersionUtil.greaterThan_2_0_2(platform, version)) {
            shareInfo.setClickUrl(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
            shareInfo.setClickUrl(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
                  taoBaoLink.getGoods(), shareInfo.getToken()));
         }
@@ -567,7 +564,7 @@
            shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()),
               taoBaoLink.getGoods(), shareInfo.getToken()));
         } else {
            shareInfo.setWxErCode(getERCodeContent(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
            shareInfo.setWxErCode(getERCodeContentNew(configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()),
                  taoBaoLink.getGoods(), shareInfo.getToken()));
         }
         
@@ -782,15 +779,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();