| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getGoodsDetial") |
| | | public void getGoodsDetial(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Long uid, |
| | | public void getGoodsDetial(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Long uid, |
| | | PrintWriter out) { |
| | | if (goodsType == null || goodsType < 2 || goodsType > 3) { |
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数")); |
| | |
| | | |
| | | /*-------- 拼多多商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) { |
| | | getDetialPDD(acceptData, goodsId, uid, from, out); |
| | | getDetialPDD(acceptData, Long.parseLong(goodsId), uid, from, out); |
| | | return; |
| | | } |
| | | } |
| | |
| | | * @param from |
| | | * @param out |
| | | */ |
| | | private void getDetialJD(WXMPAcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | private void getDetialJD(WXMPAcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(id); // 高级接口 |
| | | if (jdGoods == null) { |
| | | jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页 |
| | | // jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页 |
| | | // jdGoods = JDApiUtil.getGoodsDetail(id); // 普通接口 |
| | | } |
| | | |
| | |
| | | if (couponInfo != null) { |
| | | // 券链接处理 |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), |
| | | null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); |
| | | String url = null; |
| | | try { |
| | | url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), |
| | | null, pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.coupon), null); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | couponInfo.setLink(url); |
| | | } |
| | | |
| | |
| | | extraVO.setListShareUser(listShareUser); |
| | | |
| | | // 领券人列表 |
| | | List<ShamUser> listCouponUser = new ArrayList<ShamUser>(); |
| | | List<ShamUser> listCouponUser = new ArrayList<>(); |
| | | if (goodsDetail.isHasCoupon() && Integer.parseInt(inOrderCount30Days.toString()) >= 1000) { |
| | | listCouponUser = shamUserService.listRandCouponUser(5, 1, 300); |
| | | } |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_JD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | } |
| | |
| | | |
| | | if (uid != null) { |
| | | // 是否加入收藏 |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, |
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id+"", |
| | | Constant.SOURCE_TYPE_PDD); |
| | | extraVO.setCollected(collectionGoods != null ? true : false); |
| | | } |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getBuyLink", method = RequestMethod.POST) |
| | | public void getBuyLink(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, String couponUrl, |
| | | public void getBuyLink(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, String couponUrl, |
| | | Long uid, String inviteCode, PrintWriter out) { |
| | | if (goodsId == null || goodsType == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品信息传递错误")); |
| | |
| | | if (share) { |
| | | position = Long.parseLong(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.share)); |
| | | } |
| | | String jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); |
| | | String jdLink = null; |
| | | try { |
| | | jdLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, position + "", subUnionId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | jumpLink = "/pages/union/proxy/proxy?spreadUrl=" + URLEncoder.encode(jdLink, "UTF-8"); |
| | | } catch (Exception e) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "sharePoster", method = RequestMethod.POST) |
| | | public void sharePoster(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type, |
| | | public void sharePoster(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type, |
| | | Long uid, PrintWriter out) { |
| | | if (uid == null || uid < 1) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | |
| | | /** |
| | | * 创建京东分享海报 |
| | | */ |
| | | private void createPosterJD(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type, |
| | | private void createPosterJD(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type, |
| | | UserInfo user, String inviteCode, PrintWriter out) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | if (jdGoods == null) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getPicUrl()); |
| | | history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); |
| | | history.setShareImg(posterLink); |
| | |
| | | /** |
| | | * 创建拼多多分享海报 |
| | | */ |
| | | private void createPosterPDD(WXMPAcceptData acceptData, Long goodsId, Integer goodsType, String from, Integer type, |
| | | private void createPosterPDD(WXMPAcceptData acceptData, String goodsId, Integer goodsType, String from, Integer type, |
| | | UserInfo user, String inviteCode, PrintWriter out) { |
| | | PDDGoodsDetail pddGoods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | if (pddGoods == null) { |
| | |
| | | history.setTkCode(null); |
| | | history.setLink(null); |
| | | history.setQuanLink(null); |
| | | history.setGoodsId(goodsId); |
| | | history.setGoodsId(goodsId+""); |
| | | history.setPostPicture(goods.getPicUrl()); |
| | | history.setPictures(JsonUtil.getGson().toJson(goods.getImgList())); |
| | | history.setShareImg(posterLink); |