yujian
2020-04-02 0ec22dcf4fd9c4496e6f681e7fab89f56c6e4e8a
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -1750,15 +1750,27 @@
      TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
      taoBaoGoods.setAuctionId(detail.getGoodsId());
      taoBaoGoods.setBiz30day(detail.getMonthSales());
      // 券相关转换
      taoBaoGoods.setCouponAmount(detail.getCouponPrice());
      taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getCouponConditions(),
      taoBaoGoods.setCouponInfo(String.format("满%s元减%s元", detail.getOriginalPrice(),
            MoneyBigDecimalUtil.getWithNoZera(detail.getCouponPrice())));
      if (detail.getCouponTotalNum() != null && detail.getCouponReceiveNum() != null)
         taoBaoGoods.setCouponLeftCount(detail.getCouponTotalNum() - detail.getCouponReceiveNum());
      else
         taoBaoGoods.setCouponLeftCount(0);
      taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
      try {
         taoBaoGoods.setCouponStartFee(detail.getOriginalPrice());
      } catch (Exception e) {
      }
      taoBaoGoods.setCouponTotalCount(detail.getCouponTotalNum());
      taoBaoGoods.setCouponLink(detail.getCouponLink());
      taoBaoGoods.setCouponEffectiveStartTime(TimeUtil.getGernalTime(
            TimeUtil.convertToTimeTemp(detail.getCouponStartTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
      taoBaoGoods.setCouponEffectiveEndTime(TimeUtil.getGernalTime(
            TimeUtil.convertToTimeTemp(detail.getCouponEndTime(), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd"));
      taoBaoGoods.setPictUrl(detail.getMainPic());
      taoBaoGoods.setPictUrlWhite(detail.getMainPic());
      if (taoBaoGoods.getPictUrl() != null && !taoBaoGoods.getPictUrl().startsWith("http"))
@@ -2002,14 +2014,14 @@
         if (elements.size() >= 0) {
            for (int i = 0; i < elements.size(); i++) {
               String content = elements.get(i).toString();
               if (content.contains("var _DATA_Mdskip")) {
               if (content.contains("var _DATA_Detail")) {
                  content = content.replace("<script>", "");
                  content = content.replace("</script>", "");
                  if (content.contains("videoDetail")) {
                     content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL};   return JSON.stringify(json);}";
                     content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]};   return JSON.stringify(json);}";
                  } else {
                     content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videos[0].videoThumbnailURL};   return JSON.stringify(json);}";
                     content += ";function getData(){ var json={title:_DATA_Detail.item.title,pictUrl:_DATA_Detail.item.images[0]};   return JSON.stringify(json);}";
                  }
                  ScriptEngineManager manager = new ScriptEngineManager();
@@ -2024,6 +2036,9 @@
                     taoBaoGoodsBrief = new TaoBaoGoodsBrief();
                     taoBaoGoodsBrief.setTitle(title.toString());
                     taoBaoGoodsBrief.setPictUrl(pictUrl.toString());
                     if (!pictUrl.toString().startsWith("http")) {
                        taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize220Img("http:" + pictUrl.toString()));
                     }
                  }
                  break;
@@ -2143,6 +2158,7 @@
      for (String st : marks)
         list.add(st);
      list.add("\\(-\\)");
      list.add("(-)");
      return getTokenListFromText(str, list);
   }