admin
2019-07-31 f253c6f0ce5e708850f8e3c84a6a9008fc37df5f
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/SearchController.java
@@ -15,7 +15,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TaoBaoAuthUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
@@ -99,15 +98,21 @@
   private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
   @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
   public void getHotSearch(AcceptData acceptData, PrintWriter out) {
   public void getHotSearch(AcceptData acceptData, Integer goodsType, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
      }
      // 默认淘宝
      if (goodsType == null) {
         goodsType = Constant.SOURCE_TYPE_TAOBAO;
      }
      List<SuperHotSearch> superHotSearchList = superHotSearchSerivce
            .getSuperHotSearchBySystemIdCache(system.getId());
            .getSuperHotSearchBySystemIdCache(system.getId(), goodsType);
      if (superHotSearchList == null || superHotSearchList.size() == 0) {
         out.print(JsonUtil.loadFalseResult("没有数据"));
         return;
@@ -428,7 +433,11 @@
      // }
      if (!StringUtil.isNullOrEmpty(kw) && (kw.startsWith("http://") || kw.startsWith("https://"))) {
         out.print(JsonUtil.loadFalseResult("无法搜索链接"));
         JSONObject data = new JSONObject();
         data.put("result", new JSONArray());
         data.put("count", 0);
         data.put("nav", new JSONArray());
         out.print(JsonUtil.loadTrueResult(data));
         return;
      }
@@ -478,7 +487,7 @@
            listRecommendWords = new ArrayList<String>();
         }
         List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
         List<TaoBaoShopVO> listShop =taoBaoShopService.getShopByKey(kw);
         if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoods() != null
               && listShop.get(0).getListGoods().size() > 2) {
            data.put("shop", JsonUtil.getApiCommonGson().toJson(listShop.get(0)));
@@ -963,7 +972,7 @@
      List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
      BigDecimal proportion = manageService.getFanLiRate();
      DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null,null,null, page, 20, sort);
      DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, null, null, page, 20, sort);
      if (result != null && result.getGoodsList() != null)
         for (DaTaoKeDetailV2 goods : result.getGoodsList()) {
            listExtra.add(