| | |
| | | try { |
| | | goods = TaoKeApiUtil.searchGoodsDetail(id, app); |
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) { |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app, null, null); |
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCouponV2(goods.getAuctionId(), app, null, null); |
| | | if (linkInfo != null) { |
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl()); |
| | | goods.setCouponLink(linkInfo.getCouponLink()); |
| | |
| | | if (uid != null && uid > 0) { |
| | | String specialId = userExtraTaoBaoInfoService.getSpecialIdByUid(uid); |
| | | //获取最新的比例 |
| | | TaoBaoGoodsBrief rateGoods = TaoKeApiUtil.specialConvertCoupon(tb.getAuctionId(), TaoBaoConstant.getSpecialAuthAppInfo(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanli)), specialId, null); |
| | | TaoBaoGoodsBrief rateGoods = TaoKeApiUtil.specialConvertCouponV2(tb.getAuctionId(), TaoBaoConstant.getSpecialAuthAppInfo(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_TAOBAO, SystemPIDInfo.PidType.fanli)), specialId, null); |
| | | if (rateGoods != null) |
| | | tb.setMinTkRate(rateGoods.getTkRate()); |
| | | } |
| | |
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()) |
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()), acceptData.getSystem())) |
| | | otherInfo.setRewardCoupon(null); |
| | | |
| | | goodsDetail.setOtherInfo(otherInfo); |
| | | } |
| | | extraVO.setFanliValid(fanliValid); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getDetailJD") |
| | | public void getDetialJD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | public void getDetialJD(AcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | // uid=2255993L; |
| | | // 系统验证 |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | |
| | | |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(id); // 高级接口 |
| | | if (jdGoods == null) { |
| | | jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页 |
| | | // jdGoods = JDUtil.getGoodsDetail(id); // 爬取网页 |
| | | // jdGoods = JDApiUtil.getGoodsDetail(id); // 普通接口 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 图文详情 |
| | | extraVO.setDetailUrl("https://in.m.jd.com/product/jieshao/video/" + id + ".html"); |
| | | extraVO.setDetailUrl("https://in.m.jd.com/product/jieshao/video/" + jdGoods.getSpuid() + ".html"); |
| | | |
| | | // 测试 |
| | | SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getDetailPDD", method = RequestMethod.POST) |
| | | public void getDetialPDD(AcceptData acceptData, Long id, Long uid, String from, PrintWriter out) { |
| | | public void getDetialPDD(AcceptData acceptData, String id, Long uid, String from, PrintWriter out) { |
| | | // 系统验证 |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | |
| | | * @param source |
| | | * @param out |
| | | */ |
| | | private void getJDLinkWithoutFanLi(AcceptData acceptData, Long id, String couponUrl, String source, PrintWriter out) { |
| | | private void getJDLinkWithoutFanLi(AcceptData acceptData, String id, String couponUrl, String source, PrintWriter out) { |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(id); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(2, "商品已下架")); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getJDLink") |
| | | public void getJDLink(AcceptData acceptData, Long uid, Long id, String couponUrl, String source, PrintWriter out) { |
| | | public void getJDLink(AcceptData acceptData, Long uid, String id, String couponUrl, String source, PrintWriter out) { |
| | | |
| | | |
| | | if (id == null || id <= 0) { |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品ID不能为空")); |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | String jumpLink = null; |
| | | String materialId = "https://item.jd.com/" + id + ".html"; |
| | | |
| | | String materialId = JDUtil.getMaterialId(id); |
| | | String pid = pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_JD, SystemPIDInfo.PidType.fanli); |
| | | |
| | | if (StringUtil.isNullOrEmpty(couponUrl)) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getPDDLink") |
| | | public void getPDDLink(AcceptData acceptData, Long uid, Long id, String source, PrintWriter out) { |
| | | public void getPDDLink(AcceptData acceptData, Long uid, String id, String source, PrintWriter out) { |
| | | |
| | | if (id == null || id <= 0) { |
| | | if (id == null ) { |
| | | out.print(JsonUtil.loadFalseResult(1, "商品ID不能为空")); |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods goods = JDApiUtil.getGoodsDetail(Long.parseLong(goodsId)); |
| | | JDGoods goods = JDApiUtil.getGoodsDetail(goodsId); |
| | | if (goods == null) { |
| | | data.put("extend", false); |
| | | data.put("url", String.format("https://item.m.jd.com/product/%s.html", goodsId)); |
| | |
| | | data.put("extend", true); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(goodsId)); |
| | | PDDGoodsDetail goods = PinDuoDuoApiUtil.getGoodsDetail(goodsId); |
| | | if (goods == null) { |
| | | data.put("extend", false); |
| | | data.put("url", String.format("https://mobile.yangkeduo.com/goods.html?goods_id=%s", goodsId)); |
| | |
| | | |
| | | // 分离各个平台的商品信息 |
| | | List<String> tbGoodsList = new ArrayList<>(); |
| | | List<Long> jdGoodsList = new ArrayList<>(); |
| | | List<String> jdGoodsList = new ArrayList<>(); |
| | | List<Long> pddGoodsList = new ArrayList<>(); |
| | | |
| | | List<String> keyList = new ArrayList<>(); |
| | |
| | | if (cg.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | tbGoodsList.add(cg.getGoodsId()); |
| | | } else if (cg.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | jdGoodsList.add(Long.parseLong(cg.getGoodsId())); |
| | | jdGoodsList.add(cg.getGoodsId()); |
| | | } else if (cg.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | pddGoodsList.add(Long.parseLong(cg.getGoodsId())); |
| | | } |
| | |
| | | if (jdGoodsList.size() > 0) { |
| | | List<JDGoods> goodsList = JDApiUtil.getGoodsDetail(jdGoodsList); |
| | | for (JDGoods goods : goodsList) { |
| | | tempGoodsList.put(goods.getSkuId() + "-" + Constant.SOURCE_TYPE_JD, |
| | | tempGoodsList.put(goods.getItemId() + "-" + Constant.SOURCE_TYPE_JD, |
| | | GoodsDetailVOFactory.convertJDGoods(goods, params)); |
| | | } |
| | | } |