admin
2019-06-24 480fa41fa7ee8b3b3a38f46f28c2b8403299b44d
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/SearchController.java
@@ -91,10 +91,9 @@
   @Resource
   private TaoBaoGoodsCacheUtil taoBaoGoodsCacheUtil;
   @Resource
   private TaoBaoShopService taoBaoShopService;
   @Resource
   private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
@@ -420,15 +419,20 @@
      historySearchService.addHistorySearch(kw, bid);
//      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
//            acceptData.getPackages());
//      if (system == null) {
//         out.print(JsonUtil.loadFalseResult("系统不存在"));
//         return;
//      }
      // BusinessSystem system =
      // businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
      // acceptData.getPackages());
      // if (system == null) {
      // out.print(JsonUtil.loadFalseResult("系统不存在"));
      // return;
      // }
      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;
      }
@@ -477,9 +481,10 @@
         if (listRecommendWords == null || listRecommendWords.size() == 0) {
            listRecommendWords = new ArrayList<String>();
         }
         List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKey(kw);
         if (listShop != null && listShop.size() > 0) {
         List<TaoBaoShopVO> listShop =null; //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)));
         }
      }
@@ -947,7 +952,7 @@
   private JSONObject searchDaTaoKeGoods(String key, int page, String filter, String order, String startprice,
         String endprice) {
      page=page+1;
      page = page + 1;
      int sort = DaTaoKeApiUtil.SORT_DEFAULT;
      if ("5".equalsIgnoreCase(order)) {
         sort = DaTaoKeApiUtil.SORT_COMMISSION;
@@ -962,7 +967,7 @@
      List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
      BigDecimal proportion = manageService.getFanLiRate();
      DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, 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(