admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -2133,6 +2133,73 @@
      return goodsList;
   }
   public static List<TaoBaoGoodsBrief> getCouponListByItemId(Long auctionId) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.itemid.coupon.get");
      map.put("platform", auctionId + "");
      map.put("num_iids", auctionId + "");
      map.put("pid", TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
      List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      JSONObject resultJSON = null;
      try {
         resultJSON = TaoKeBaseUtil.baseRequest(map, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
               TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
         JSONObject response = resultJSON.optJSONObject("tbk_dg_optimus_material_response");
         if (response != null && response.optJSONObject("result_list") != null) {
            JSONArray array = response.optJSONObject("result_list").optJSONArray("map_data");
            if (array != null) {
               for (int i = 0; i < array.size(); i++) {
                  JSONObject item = array.optJSONObject(i);
                  TaoBaoGoodsBrief goods = parseWuLiaoItemFromMaterialId(item);
                  if (goods != null)
                     goodsList.add(goods);
               }
            }
         }
      } catch (Exception e) {
         e.printStackTrace();
      }
      return goodsList;
   }
   /**
    * 淘宝客-推广者-官方活动信息获取
    * @Title: getActivityInfo
    * @Description:
    * @param activityMaterialId
    * @param pid
    * @param relationId
    * @return
    * String 返回类型
    * @throws
    */
   public static String getActivityInfo(String activityMaterialId, String pid, String relationId) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.activity.info.get");
      map.put("activity_material_id", activityMaterialId);
      map.put("adzone_id", pid.split("_")[3] + "");
      map.put("relation_id", relationId);
      JSONObject resultJSON = null;
      try {
         resultJSON = TaoKeBaseUtil.baseRequest(map,
               new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET, pid));
         JSONObject response = resultJSON.optJSONObject("tbk_activity_info_get_response");
         if (response != null && response.optJSONObject("data") != null) {
            return response.optJSONObject("data").optString("click_url");
         }
      } catch (Exception e) {
         e.printStackTrace();
      }
      return null;
   }
}
class QuanInfo {