admin
2019-05-29 a438c5735834c26c584abfcc7221a06c1ccadcdc
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -11,6 +11,7 @@
import com.taobao.api.ApiException;
import com.yeshi.fanli.dto.taobao.TaoBaoShopInfoDTO;
import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
import com.yeshi.fanli.entity.taobao.RelateGoods;
import com.yeshi.fanli.entity.taobao.SearchFilter;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
@@ -1238,7 +1239,6 @@
      return list;
   }
   /**
    * 店铺搜索
    * 
@@ -1777,7 +1777,6 @@
      }
   }
   
   public static void taoKeContentSource(String contentId,String source) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.dg.optimus.material");
@@ -1787,7 +1786,6 @@
      map.put("content_id",contentId);
      map.put("content_source", source);
      map.put("material_id", "1");
      
      TaoKeAppInfo app = new TaoKeAppInfo();
      app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
@@ -1799,9 +1797,6 @@
         e.printStackTrace();
      }
   }
   // AA5ISJ
@@ -1897,8 +1892,7 @@
      return goods;
   }
   
   public static void getShopGoodsList(Long shopId)
   {
   public static void getShopGoodsList(Long shopId) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "tmall.omni.pc.iteminfo.getbyshopid");
      map.put("shop_id",shopId+"");
@@ -1913,8 +1907,7 @@
      }
   }
   
   public static void getTaoKeContentEffective()
   {
   public static void getTaoKeContentEffective() {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.dg.optimus.material");
      map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID.split("_")[3]);
@@ -1934,9 +1927,7 @@
      
   }
   
   public static void getTaoKeContent()
   {
   public static void getTaoKeContent() {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.content.get");
      map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID.split("_")[3]);
@@ -1956,22 +1947,22 @@
   
   //淘礼金创建
   
   public static void getLiJin()
   {
   public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
         int useDayLimit, Date sendStartTime, Date sendEndTime, Date useStartTime) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.dg.vegas.tlj.create");
      map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
      map.put("item_id", "538982295340");
      map.put("total_num", "1");
      map.put("name", "返利券新人淘礼金红包");
      map.put("item_id", auctionId + "");
      map.put("total_num", totalNum + "");
      map.put("name", name);
      map.put("user_total_win_num_limit", "1");
      map.put("security_switch", "false");
      map.put("per_face", "1.00");
      map.put("send_start_time", "2019-05-27 00:00:00");
      map.put("send_end_time", "2019-06-01 00:00:00");
      map.put("use_end_time", "1");
      map.put("per_face", perface.toString());
      map.put("send_start_time", TimeUtil.getGernalTime(sendStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
      map.put("send_end_time", TimeUtil.getGernalTime(sendEndTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
      map.put("use_end_time", useDayLimit + "");
      map.put("use_end_time_mode", "1");
      map.put("use_start_time", "2019-05-27 00:00:00");
      map.put("use_start_time", TimeUtil.getGernalTime(useStartTime.getTime(), "yyyy-MM-dd HH:mm:ss"));
      
      TaoKeAppInfo app = new TaoKeAppInfo();
      app.setAppKey( TaoBaoConstant.TAOBAO_AUTH_APPKEY);
@@ -1979,29 +1970,36 @@
      try {
         JSONObject json = TaoKeBaseUtil.baseRequest(map,app);
         System.out.println(json);
         JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_create_response");
         if (root != null && root.optJSONObject("result") != null) {
            if (root.optJSONObject("result").optBoolean("success")) {
               JSONObject modelJson = root.optJSONObject("result").optJSONObject("model");
               TaoLiJinDTO dto = new TaoLiJinDTO();
               dto.setRightsId(modelJson.optString("rights_id"));
               dto.setSendUrl(modelJson.optString("send_url"));
               return dto;
            }
         }
      } catch (TaoKeApiException e) {
         e.printStackTrace();
      }
      return null;
   }
   
   //lCj1Alo8b9L4Ed6yJLq6iqJ7%2BkHL3AEW
   
   public static void getLiJinXG()
   {
   public static void getTaoLiJinEffective() {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.dg.vegas.tlj.instance.report");
      map.put("rights_id", "ZrIIvF%2Fnd7SlL5Bg59eTK6J7%2BkHL3AEW");
      map.put("rights_id", "ZrIIvF/nd7SlL5Bg59eTK6J7+kHL3AEW");
      
      TaoKeAppInfo app = new TaoKeAppInfo();
      app.setAppKey( TaoBaoConstant.TAOBAO_AUTH_APPKEY);
      app.setAppSecret( TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
      try {
         JSONObject json = TaoKeBaseUtil.baseRequest(map,app);
      String json = TaoKeBaseUtil.baseRequestForThreeTimes(map, app);
         System.out.println(json);
      } catch (TaoKeApiException e) {
         e.printStackTrace();
      }
   }
}