admin
2020-06-10 271ae63c20fcbe28d29c47f1881138ff6551a2a1
fanli/src/main/java/com/yeshi/fanli/util/suning/SuningApiUtil.java
@@ -122,7 +122,9 @@
      model.setPicHeight(320);
      String key = "querySearchcommoditynew";
      String json = new Gson().toJson(model);
      //String result = baseRequest("suning.netalliance.searchcommoditynew.query", key, JSONObject.fromObject(json));
      // String result =
      // baseRequest("suning.netalliance.searchcommoditynew.query", key,
      // JSONObject.fromObject(json));
      String result = baseRequest("suning.netalliance.searchcommoditynew.query", key, JSONObject.fromObject(json));
      JSONObject resultJSON = JSONObject.fromObject(result);
      JSONArray array = resultJSON.optJSONObject("sn_responseContent").optJSONObject("sn_body").optJSONObject(key)
@@ -137,7 +139,6 @@
      return null;
   }
   /**
    * 查询商品
    * @Title: searchGoods
@@ -156,23 +157,23 @@
      JSONObject resultJSON = JSONObject.fromObject(result);
      JSONObject responseContent = resultJSON.optJSONObject("sn_responseContent");
      if (responseContent != null) {
          JSONObject snBody = responseContent.optJSONObject("sn_body");
          if (snBody != null) {
             JSONArray array = snBody.optJSONArray(key);
             if (array != null) {
         JSONObject snBody = responseContent.optJSONObject("sn_body");
         if (snBody != null) {
            JSONArray array = snBody.optJSONArray(key);
            if (array != null) {
               Type type = new TypeToken<ArrayList<SuningGoodsInfo>>() {
               }.getType();
               List<SuningGoodsInfo> goodsList = new Gson().fromJson(array.toString(), type);
               return goodsList;
            }
          }
         }
      }
      return null;
   }
   public static SuningGoodsInfo getGoodsDetail(String goodsCode, String supplierCode) {
      JSONObject model = new JSONObject();
      model.put("commodityStr", goodsCode + "-" + supplierCode);
      model.put("commodityStr", goodsCode + "-" +SuningUtil.getFullSupplierCode( supplierCode));
      model.put("picWidth", 600);
      model.put("picHeight", 600);
      model.put("couponMark", 1);
@@ -187,8 +188,7 @@
      }
      return null;
   }
   /**
    * 查询关联商品
    * @Title: searchGoods
@@ -204,7 +204,7 @@
      model.put("supplierCode", supplierCode);
      model.put("picWidth", 320);
      model.put("picHeight", 320);
      String key = "getMorerecommend";
      String json = new Gson().toJson(model);
      String result = baseRequest("suning.netalliance.morerecommend.get", key, JSONObject.fromObject(json));
@@ -219,7 +219,6 @@
      }
      return null;
   }
   public static List<SuningGoodsInfo> getGoodsDetailList(List<String> list) {
      String sts = "";
@@ -280,7 +279,7 @@
    * @param startTime
    * @param endTime
    * @param page
    * @param orderLineStatus
    * @param orderLineStatus  (0:全部状态;1:等待付款;2:支付完成;3:退款;4:订单已取消;5:确认收货)
    * @return 
    * SuningOrderQueryResultDTO 返回类型
    * @throws
@@ -297,7 +296,15 @@
      String result = baseRequest("suning.netalliance.order.query", key, model);
      JSONObject resultJSON = JSONObject.fromObject(result);
      resultJSON = resultJSON.optJSONObject("sn_responseContent");
      JSONArray array = resultJSON.optJSONObject("sn_body").optJSONArray(key);
      JSONObject snBody = resultJSON.optJSONObject("sn_body");
      if (snBody == null)
         return null;
      JSONArray array = snBody.optJSONArray(key);
      if (array == null)
         return null;
      Gson gson = new Gson();
      Type type = new TypeToken<ArrayList<SuningOrderInfo>>() {