admin
2019-08-08 3fc84b5d4b36ce9ab5cea84ee1b54942c8e04ef9
fanli/src/main/java/com/yeshi/fanli/service/impl/goods/recommend/HomeRecommendGoodsServiceImpl.java
@@ -30,7 +30,6 @@
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@Service
public class HomeRecommendGoodsServiceImpl implements HomeRecommendGoodsService {
@@ -171,7 +170,16 @@
      if (fList != null && fList.size() > 0)
         return fList;
      DaTaoKeGoodsResult result = DaTaoKeApiUtil.getRankingList(type, null);
      DaTaoKeGoodsResult result = null;
      int count = 0;
      while (result == null && count < 4) {
         count++;
         try {
            result = DaTaoKeApiUtil.getRankingList(type, null);
         } catch (Exception e) {
         }
      }
      List<DaTaoKeDetailV2> list = result.getGoodsList();
      List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
      if (list != null)
@@ -200,7 +208,8 @@
      if (list != null && list.size() > 0)
         return list;
      TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(3756, page, Constant.PAGE_SIZE);
      // 爆款商品库
      TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(14624, page, Constant.PAGE_SIZE);
      if (result != null) {
         list = daTaoKeGoodsDetailService.filterTaoBaoGoods(result.getTaoBaoGoodsBriefs());
         saveObjList(list, name, key);
@@ -244,8 +253,15 @@
      Map<Long, TLJBuyGoods> map = new ConcurrentHashMap<>();
      if (list != null)
         for (TLJBuyGoods goods : list) {
            map.put(goods.getGoods().getAuctionId(), goods);
            finalList.add(goods.getGoods());
            try {
               if (goods.getGoods().getAuctionId() == null) {
                  goods.getGoods().setAuctionId(goods.getGoods().getId());
               }
               map.put(goods.getGoods().getAuctionId(), goods);
               finalList.add(goods.getGoods());
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      finalList = recommendGoodsDeleteHistoryService.filterGoods(device, finalList);