admin
2019-01-03 5981b2cae7c20ec9021c8ccbe1a926f35f640210
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)) {
@@ -222,6 +224,25 @@
      }
      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));
   }
   /**
    * 获取商品详情,简版