| | |
| | | JSONObject item = array.optJSONObject(i); |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setPictUrl(item.optString("pict_url")); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | |
| | | private static TaoBaoGoodsBrief parseSimpleGoodsInfo(JSONObject item) { |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl(item.optString("item_url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (item.optJSONObject("small_images") != null) { |
| | |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | System.out.println(goods.getAuctionId() + ":" + g.getAuctionId()); |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | g.setMaterialLibType(goods.getMaterialLibType()); |
| | | g.setProvcity(goods.getProvcity()); |
| | |
| | | goods.getUserType(), app); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | // 判断是否有优惠券 |
| | | if (!StringUtil.isNullOrEmpty(g.getCouponActivityId())) { |
| | | // 获取优惠券详情 |
| | |
| | | goods.getUserType(), app); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setCreatetime(new Date()); |
| | | return g; |
| | | } |
| | |
| | | goods.getUserType()); |
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) |
| | | for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { |
| | | if (goods.getAuctionId().longValue() == g.getAuctionId()) { |
| | | g.setId(goods.getAuctionId()); |
| | | if ( TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null |
| | | && searchResult.getTaoBaoGoodsBriefs().size() > 0) { |
| | | for (TaoBaoGoodsBrief g : searchResult.getTaoBaoGoodsBriefs()) { |
| | | if (g.getAuctionId().longValue() == goods.getAuctionId()) { |
| | | if (TaoBaoUtil.isEqual(g.getAuctionId() , goods.getAuctionId())) { |
| | | g.setImgList(goods.getImgList()); |
| | | g.setId(goods.getAuctionId()); |
| | | g.setAuctionId(goods.getAuctionId()); |
| | | g.setAuctionUrl(goods.getAuctionUrl()); |
| | | g.setShopTitle(goods.getShopTitle()); |
| | | |
| | |
| | | /** |
| | | * 商品物料搜索 |
| | | * |
| | | * @param filter |
| | | * @return |
| | | */ |
| | | public static TaoBaoSearchResult searchWuLiaoForDetail(String title, BigDecimal zkPrice, String provcity, |
| | |
| | | /** |
| | | * 商品物料搜索 |
| | | * |
| | | * @param filter |
| | | * @return |
| | | */ |
| | | public static TaoBaoSearchResult searchWuLiaoForDetail(String title, BigDecimal zkPrice, String provcity, |
| | |
| | | goods.setPictUrlWhite(item.optString("white_image")); |
| | | } |
| | | |
| | | goods.setAuctionId(item.optLong("num_iid")); |
| | | goods.setAuctionId(item.optString("num_iid")); |
| | | goods.setAuctionUrl("https:" + item.optString("url")); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | goods.setCouponInfo(item.optString("coupon_info")); |
| | |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | public static TaoKeApiUtil.QuanInfo getQuanInfo(Long auctionId, String activityId) { |
| | | public static TaoKeApiUtil.QuanInfo getQuanInfo(String auctionId, String activityId) { |
| | | TaoKeApiUtil.QuanInfo info = new TaoKeApiUtil.QuanInfo(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.coupon.get"); |
| | |
| | | /** |
| | | * 店铺搜索 |
| | | * |
| | | * @param key -店铺名称 |
| | | * @param page -页码 |
| | | * @return |
| | | */ |
| | | public static List<TaoBaoShopInfo> searchShop(SearchShopFilter filter) { |
| | |
| | | System.out.println(resultStr); |
| | | } |
| | | |
| | | public static void getTAEGoodsDetail(Long auctionId) { |
| | | public static void getTAEGoodsDetail(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tae.items.list"); |
| | | map.put("fields", "title,nick,pic_url,location,cid,price,post_fee,promoted_service,ju,shop_name"); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void specialConvertItem(Long auctionId, TaoKeAppInfo app) { |
| | | public static void specialConvertItem(String auctionId, TaoKeAppInfo app) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(Long auctionId, TaoKeAppInfo app) { |
| | | public static TaoBaoGoodsBrief specialConvertCoupon(String auctionId, TaoKeAppInfo app) { |
| | | String pid = app.getPid(); |
| | | String[] sts = pid.split("_"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); |
| | | // 设置成320*320的图片尺寸 |
| | | goods.setPictUrl(TbImgUtil.getTBSize320Img("https:" + item.optString("pict_url"))); |
| | | goods.setAuctionId(item.optLong("item_id")); |
| | | goods.setAuctionId(item.optString("item_id")); |
| | | goods.setAuctionUrl("https://item.taobao.com/item.htm?id=" + goods.getAuctionId()); |
| | | goods.setBiz30day(item.optInt("volume")); |
| | | if (!StringUtil.isNullOrEmpty(item.optString("coupon_amount"))) { |
| | |
| | | } |
| | | |
| | | // 淘礼金创建 |
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum, |
| | | public static TaoLiJinDTO createTaoLiJin(String auctionId, String name, BigDecimal perface, int totalNum, |
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app) |
| | | throws TaoLiJinCreateException, TaoKeApiException { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static void getCouponByAuctionId(Long auctionId) { |
| | | public static void getCouponByAuctionId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", 2 + ""); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(Long auctionId, int count) { |
| | | public static List<TaoBaoGoodsBrief> guessLikeByAuctionId(String auctionId, int count) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.dg.optimus.material"); |
| | | map.put("item_id", auctionId + ""); |
| | |
| | | return goodsList; |
| | | } |
| | | |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(Long auctionId) { |
| | | public static List<TaoBaoGoodsBrief> getCouponListByItemId(String auctionId) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.itemid.coupon.get"); |
| | | map.put("platform", auctionId + ""); |