yujian
2019-08-01 ba94d20eea2cc91a57f4ffed9f09ee0eb6352bfc
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -17,6 +17,7 @@
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.ShamUser;
@@ -583,8 +584,7 @@
      if (couponInfo != null) {
         // 券链接处理
         String materialId = "https://item.jd.com/" + id + ".html";
         String url = JDApiUtil.convertLink(materialId, couponInfo.getLink(), JDApiUtil.POSITION_COUPON + "",
               null);
         String url = JDApiUtil.convertLink(materialId, couponInfo.getLink(), JDApiUtil.POSITION_COUPON + "", null);
         couponInfo.setLink(url);
      }
@@ -715,9 +715,11 @@
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
      CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
      PDDPromotionUrl convertUrl = null;
      if (couponInfo != null) {
         String url = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
         couponInfo.setLink(url);
         convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
         if (convertUrl != null)
            couponInfo.setLink(convertUrl.getShortUrl());
      }
      ShopInfoVO shopInfo = goodsDetail.getShopInfo();
@@ -776,12 +778,7 @@
         extraVO.setStorage(userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_PDD));
      }
      // 测试
      SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
            "goods_detail_jump_taobao");
      if ("1".equalsIgnoreCase((params.getValue() + "").trim())) {
         extraVO.setIsNative(true);
      }
      extraVO.setIsNative(true);
      // 分享路径
      String h5Url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
@@ -803,6 +800,11 @@
      ShareVO shareInfoVO = new ShareVO();
      shareInfoVO.setHelpLink(helpLink);
      extraVO.setShare(shareInfoVO);
      if (convertUrl != null) {
         extraVO.setCouponJumpLink(convertUrl.getShortUrl());
         extraVO.setNativeCouponJumpLink(PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
      }
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
@@ -1060,10 +1062,11 @@
         return;
      }
      String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_FANLI + "", uid + "");
      PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_FANLI + "", uid + "");
      JSONObject data = new JSONObject();
      data.put("native", true);
      data.put("jumpLink", jumpLink);
      data.put("jumpLink", convertUrl.getShortUrl());
      data.put("nativeJumpLink", PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
      out.print(JsonUtil.loadTrueResult(data));
   }