yujian
2019-03-27 cdcbed9af813b2a02cdc01eefa24db8bec6b51a9
fanli/src/main/java/com/yeshi/fanli/controller/xcx/XcxSearchController.java
@@ -14,6 +14,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -29,13 +30,11 @@
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
import com.yeshi.fanli.service.inter.goods.HonestService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -55,9 +54,6 @@
   @Resource
   private HongBaoManageService manageService;
   @Resource
   private HonestService honestService;
   @Resource
   private GoodsClassService goodsClassService;
@@ -181,7 +177,7 @@
         return;
      }
      String kw = goodsClassService.getKwById(id);
      String kw = goodsClassService.getKeysById(id);
      filter = "[{\"type\": \"quantype\"}]";
      JSONObject data = search(kw, pagesize, filter, order, startprice, endprice);
      // if (StringUtil.isNullOrEmpty(kw)) {
@@ -408,48 +404,6 @@
      data.put("result", gson2.toJson(re));
      data.put("count", result.getTaoBaoHead().getDocsfound());
      return data;
   }
   /**
    *
    * 方法说明: 历史搜索
    *
    * @author mawurui createTime 2018年4月25日 下午3:04:06
    * @param acceptData
    * @param out
    */
   @RequestMapping(value = "gethistorysearch", method = RequestMethod.POST)
   public void getHistorySearch(AcceptData acceptData, PrintWriter out) {
      String bid = getHistorySearchBid(acceptData);
      List<HistorySearch> historySearchList = historySearchService.getHistorySearch(bid);
      if (historySearchList == null || historySearchList.size() == 0) {
         out.print(JsonUtil.loadFalseResult(XcxMiniControllerUtil.NODATA));
         return;
      }
      JSONObject data = new JSONObject();
      data.put("count", historySearchList.size());
      Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
      data.put("historySearchList", gson.toJson(historySearchList));
      out.print(JsonUtil.loadTrueResult(data));
      return;
   }
   /**
    *
    * 方法说明: 清空历史搜索
    *
    * @author mawurui createTime 2018年4月25日 下午3:04:23
    * @param acceptData
    * @param out
    */
   @RequestMapping(value = "clearhistorysearch", method = RequestMethod.POST)
   public void clearHistorySearch(AcceptData acceptData, PrintWriter out) {
      String bid = getHistorySearchBid(acceptData);
      long count = historySearchService.clearHistorySearch(bid);
      JSONObject data = new JSONObject();
      data.put("count", count);
      out.print(JsonUtil.loadTrueResult(data));
      return;
   }
   /**