admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
fanli/src/main/java/com/yeshi/fanli/controller/h5/H5SearchController.java
@@ -5,17 +5,14 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
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;
@@ -28,13 +25,16 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
import com.yeshi.fanli.service.inter.config.CustomerContentService;
import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.user.HistorySearchService;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import org.yeshi.utils.JsonUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Controller
@RequestMapping("api/h5/v1/webSearch")
@@ -54,44 +54,11 @@
   @Resource
   private SuperHotSearchService superHotSearchSerivce;
   @Resource
   private CustomerContentService customerContentService;
   // 优惠券
   /*
    * public final static int quanType = 1;
    *
    * public final static int baoyou = 2;
    *
    * public final static int TMALL = 3;
    */
   /**
    *
    * 方法说明: 关键字提示建议搜索
    *
    * @author mawurui createTime 2018年4月25日 下午3:04:52
    * @param acceptData
    * @param kw
    * @param out
    */
   @RequestMapping(value = "suggestsearch", method = RequestMethod.GET)
   public void getSugguestSearch(String callback, AcceptData acceptData, String kw, PrintWriter out) {
      List<String> list = TaoBaoUtil.getSuguestSearch(kw);
      if (list != null && list.size() > 0) {
         JSONArray array = new JSONArray();
         int num = 0;
         for (String st : list) {
            array.add(st);
            num = num + 1;
            if (num >= 5) {
               break;
            }
         }
         out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
      } else {
         out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
      }
      return;
   }
   /**
    * 
@@ -111,12 +78,7 @@
   @RequestMapping(value = "search", method = RequestMethod.GET)
   public void search(String callback, AcceptData acceptData, String kw, int page, String filter, String order,
         String startprice, String endprice, String fastFilter, PrintWriter out) {
      /*
       * System system = webControllerUtil.getSystem(acceptData); if(system ==
       * null){
       * out.print(JsonUtil.loadFalseResult(WebControllerUtil.NOSYSTEM));
       * return; }
       */
      if (!StringUtil.isNullOrEmpty(fastFilter)) {
         if (!StringUtil.isNullOrEmpty(filter)) {
            JSONArray filterArray = JSONArray.fromObject(filter);
@@ -267,20 +229,6 @@
      return data;
   }
   /**
    *
    * 方法说明: 联系客服接口
    *
    * @author mawurui createTime 2018年4月10日 上午9:02:41
    */
   @RequestMapping(value = "contactCustomer", method = RequestMethod.GET)
   public void contactCustomerService(PrintWriter out) {
      String title = "联系客服";
      List<CustomerContent> contentList = systemClientParamsService.contactCustomerService(title);
      JSONObject data = new JSONObject();
      data.put("contentList", JsonUtil.getSimpleGsonWithDate().toJson(contentList));
      out.print(JsonUtil.loadTrueResult(data));
   }
   /**
    * 
@@ -298,7 +246,7 @@
       * out.print(JsonUtil.loadFalseResult(XcxMiniControllerUtil.NOSYSTEM));
       * return; }
       */
      List<SuperHotSearch> superHotSearchList = superHotSearchSerivce.getSuperHotSearchBySystemId(4); // 返利券app
      List<SuperHotSearch> superHotSearchList = superHotSearchSerivce.getSuperHotSearchBySystemId(4, null); // 板栗快省app
      if (superHotSearchList == null || superHotSearchList.size() == 0) {
         out.print(JsonUtil.loadFalseResult(H5ControllerUtil.NODATA));
         return;