From 92c681fabac989d1a9f16fa13202d7f5ccac52d9 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 14 一月 2019 10:22:22 +0800 Subject: [PATCH] 订单优化 + 后台提现曲线图 --- fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java index 036d8ae..30b5e1b 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java @@ -24,6 +24,7 @@ import com.yeshi.fanli.util.MoneyBigDecimalUtil; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.TimeUtil; + import org.yeshi.utils.taobao.TbImgUtil; import net.sf.json.JSONArray; @@ -192,6 +193,7 @@ goods.setProvcity(item.optString("provcity")); goods.setPictUrl(item.optString("pict_url")); goods.setShopTitle(item.optString("nick")); + goods.setSellerId(item.optLong("seller_id")); String optString = item.optString("shop_dsr"); if (!StringUtil.isNullOrEmpty(optString)) { @@ -221,6 +223,24 @@ return goods; } return null; + } + + public static List<TaoBaoGoodsBrief> getBatchGoodsInfo(List<Long> listId) + throws TaoKeApiException, TaobaoGoodsDownException { + if (listId == null || listId.size() == 0) { + throw new TaobaoGoodsDownException(1, "娣樺疂鍟嗗搧ID涓嶈兘涓虹┖"); + } + + if (listId.size() > 40) { + throw new TaobaoGoodsDownException(1, "娣樺疂鍟嗗搧ID涓嶈兘瓒呰繃40涓�"); + } + + StringBuffer ids = new StringBuffer(); + for (Long id : listId) { + ids.append(id + ","); + } + + return getBatchGoodsInfos(ids.substring(0, ids.length() - 1)); } /** @@ -1415,6 +1435,29 @@ return result; } + /** + * 浠庢窐瀹濋摼鎺ヤ腑瑙f瀽鍟嗗搧ID锛堥珮绾ф帴鍙o級 + * @param link + * @return + */ + public static String parseAuctionIdFromLink(String link) { + Map<String, String> map = new HashMap<>(); + map.put("method", "taobao.tbk.item.click.extract"); + map.put("click_url", link + ""); + JSONObject resultJSON = null; + try { + resultJSON = TaoKeBaseUtil.baseRequest(map, true); + } catch (TaoKeApiException e) { + e.printStackTrace(); + } + if (resultJSON == null) + return null; + + + return null; + + } + private static TaoBaoGoodsBrief parseWuLiaoItemFromMaterialId(JSONObject item) { TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); // 璁剧疆鎴�320*320鐨勫浘鐗囧昂瀵� -- Gitblit v1.8.0