yujian
2019-07-29 a1175313094799efcdbbecf2840a90350d3159a7
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -75,6 +75,7 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
import com.yeshi.fanli.vo.goods.CouponInfoVO;
import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.goods.MoneyInfoVO;
@@ -396,9 +397,8 @@
         extraVO.setIsNative(true);
      } 
      // 商品链接
      String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePath(), id + "");
      String h5Url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePath(), "", id + "");
      try {
         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      } catch (Exception e) {
@@ -519,9 +519,7 @@
      }
      
      // 分享路径
      String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShare(shareInfoVO);
@@ -585,8 +583,16 @@
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, null, fanLiRate, shareRate);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, fanLiRate, shareRate);
      CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
      if (couponInfo != null) {
         // 券链接处理
         String materialId = "https://item.jd.com/" + id + ".html";
         String url = JDApiUtil.convertShortLink(materialId, couponInfo.getLink(), JDApiUtil.POSITION_COUPON+"", null);
         couponInfo.setLink(url);
      }
      ShopInfoVO shopInfo = goodsDetail.getShopInfo();
      if (shopInfo != null) {
         if (shopInfo.getId() == null || shopInfo.getScoreGoods() == null || shopInfo.getScoreLogistics() == null
@@ -649,8 +655,8 @@
      }
      // 商品链接
      String h5Url = String.format("http://%s%s?id=%s&appType=flq&goodsType=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePath(), jdGoods.getSkuId() + "", Constant.SOURCE_TYPE_JD);
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePathJD(), "", id + "");
      try {
         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      } catch (Exception e) {
@@ -664,11 +670,7 @@
         helpLink = configService.get("no_rebate_help_link");
      }
      // 分享路径
      String shareUrl = String.format("%s?id=" + jdGoods.getSkuId(),
            Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShare(shareInfoVO);
@@ -717,8 +719,13 @@
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, null, fanLiRate, shareRate);
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
      CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
      if (couponInfo != null) {
         String url = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
         couponInfo.setLink(url);
      }
      ShopInfoVO shopInfo = goodsDetail.getShopInfo();
      if (shopInfo != null) {
         if (shopInfo.getId() == null || shopInfo.getScoreGoods() == null || shopInfo.getScoreLogistics() == null
@@ -782,9 +789,9 @@
         extraVO.setIsNative(true);
      }
      // 商品链接
      String h5Url = String.format("http://%s%s?id=%s&appType=flq&goodsType=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePath(), id + "", Constant.SOURCE_TYPE_PDD);
      // 分享路径
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
            Constant.systemCommonConfig.getShareGoodsPagePathPDD(), "",   id + "");
      try {
         extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
      } catch (Exception e) {
@@ -798,10 +805,8 @@
      if (StringUtil.isNullOrEmpty(helpLink)) {
         helpLink = configService.get("no_rebate_help_link");
      }
      // 分享路径
      String shareUrl = String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl());
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setUrl(shareUrl);
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShare(shareInfoVO);
@@ -853,7 +858,7 @@
         List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
         
         for (JDGoods goods: list) {
            listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, null, fanLiRate, shareRate));
            listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate));
         }
         
         // 取偶数个数据
@@ -893,7 +898,7 @@
                  BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
                  BigDecimal shareRate = hongBaoManageService.getShareRate();
                  for (PDDGoodsDetail goods : goodsList) {
                     listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, null, fanLiRate, shareRate));
                     listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate));
                  }
               }
            }
@@ -1024,7 +1029,7 @@
      if (couponInfo != null) {
         couponUrl = couponInfo.getLink();
      }
      String jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", id + "");
      String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
      
      JSONObject data = new JSONObject();
      data.put("native", true);