yujian
2019-07-23 5de85a1e6e1c6658e3c6379ef778b7aa009e2103
fanli/src/main/java/com/yeshi/fanli/util/jd/JDApiUtil.java
@@ -499,6 +499,50 @@
      return goods;
   }
   public static JDSearchResult getJingFenGoods(int pageIndex, int eliteId) {
      JDSearchResult searchResult = new JDSearchResult();
      List<JDGoods> list = new ArrayList<>();
      JSONObject json = new JSONObject();
      json.put("pageIndex", pageIndex);
      json.put("pageSize", 20);
      json.put("sortName", "inOrderCount30DaysSku");
      json.put("sort", "desc");
      json.put("eliteId", eliteId);
      JSONObject jsonDTO = new JSONObject();
      jsonDTO.put("goodsReq", json);
      String result = baseRequest2("jd.union.open.goods.jingfen.query", null, jsonDTO);
      System.out.println(result);
      JSONObject resultJson = JSONObject.fromObject(result);
      resultJson = resultJson.optJSONObject("jd_union_open_goods_jingfen_query_response");
      if (resultJson.optInt("code") == 0) {
         result = resultJson.optString("result");
         resultJson = JSONObject.fromObject(result);
         String message = resultJson.optString("message");
         if ("SUCCESS".equalsIgnoreCase(message)) {
            JSONArray array = resultJson.optJSONArray("data");
            if (array != null) {
               for (int i = 0; i < array.size(); i++) {
                  JDGoods goods = parseJDGoods(array.optJSONObject(i));
                  if (goods != null)
                     list.add(goods);
               }
            }
         }
         long totalCount = resultJson.optLong("totalCount");
         PageEntity pageEntity = new PageEntity();
         pageEntity.setTotalCount(totalCount);
         searchResult.setPageEntity(pageEntity);
      }
      searchResult.setGoodsList(list);
      return searchResult;
   }
   public static JDGoods getGoodsDetail(Long skuId) {
      List<Long> skuIdList = new ArrayList<>();