public Map<String, Object> routeAutoComplete(Map<String, Object> params) {

    ArgCheckUtils.validataRequiredArgs("keyword", params);
    Map<String, Object> resultMap = new HashMap<String, Object>();
    // ClientPlaceSearchVO searchVo = new ClientPlaceSearchVO();
    ClientRouteSearchVO searchVo = new ClientRouteSearchVO();
    // searchVo.setStage(ClientUtils.convetToList("1,2"));

    /** 补全所有目的地关键字 */
    if (params.get("subProductType") != null) {
      if (this.isFreness(params)) {
        params.put("fromDest", null);
      }
      searchVo.setSubProductType(ClientUtils.convetToList(params.get("subProductType").toString()));
    }

    if (params.get("fromDest") != null) {
      searchVo.setFromDest(params.get("fromDest").toString());
    }

    List<String> productTypes = new ArrayList<String>();
    productTypes.add(Constant.PRODUCT_TYPE.ROUTE.name());
    searchVo.setProductType(productTypes);
    searchVo.setChannel(Constant.CHANNEL.CLIENT.name());
    // searchVo.setKeyword(params.get("keyword").toString());
    searchVo.setToDest(StringUtil.subStringStrNoSuffix(params.get("keyword").toString(), 60));
    // List<AutoCompletePlaceObject> list =
    // clientPlaceService.getAutoCompletePlace(searchVo);
    List<AutoCompletePlaceObject> list = vstClientProductService.getAutoComplete(searchVo);
    List<Map<String, Object>> keyList = new ArrayList<Map<String, Object>>();
    Map<String, Object> tempMap = new HashMap<String, Object>();

    if (list != null) {
      for (AutoCompletePlaceObject bean : list) {
        tempMap.put(bean.getShortId(), bean);
      }
    }
    Iterator<Entry<String, Object>> it = tempMap.entrySet().iterator();

    while (it.hasNext()) {
      Entry<String, Object> entry = it.next();
      AutoCompletePlaceObject bean = (AutoCompletePlaceObject) entry.getValue();
      Map<String, Object> map = new HashMap<String, Object>();
      map.put("name", bean.getWords());
      map.put("id", bean.getShortId());
      map.put("stage", bean.getStage());
      keyList.add(map);
    }

    resultMap.put("datas", keyList);
    return resultMap;
  }
 /**
  * 已审核(审核通过、审核不通过)房价变价列表页面.
  *
  * @return
  */
 @Action("ebkRouteStockList")
 public String ebkRouteStockList() {
   this.initSuggestAuditStatusList(true);
   Map<String, Object> params = new HashMap<String, Object>();
   // 申请状态查询条件:为空或全部时查询"审核通过"、"审核不通过".
   if (StringUtils.isEmpty(this.ebkHousePrice.getStatus())
       || "ALL".equals(this.ebkHousePrice.getStatus())) {
     params.put(
         "includeAduitStatus",
         new String[] {
           Constant.EBK_SUGGEST_AUDIT_STATUS.PASSED_AUDIT.name(),
           Constant.EBK_SUGGEST_AUDIT_STATUS.UNPASSED_AUDIT.name()
         });
   } else {
     params.put("status", this.ebkHousePrice.getStatus());
   }
   // 申请单号
   if (this.ebkHousePrice.getHousePriceId() != null) {
     params.put("housePriceId", this.ebkHousePrice.getHousePriceId());
   }
   // 提交时间.
   if (this.createTimeBegin != null && !StringUtils.isEmpty(this.createTimeBegin)) {
     params.put("createTimeBegin", this.createTimeBegin);
   }
   if (this.createTimeEnd != null && !StringUtils.isEmpty(this.createTimeEnd)) {
     params.put("createTimeEnd", this.createTimeEnd);
   }
   // 提交人.
   if (this.ebkHousePrice.getSubmitUser() != null
       && !StringUtils.isEmpty(this.ebkHousePrice.getSubmitUser())) {
     params.put("submitUser", this.ebkHousePrice.getSubmitUser().trim());
   }
   // 供应商名称.
   if (this.ebkHousePrice.getSupplierId() != null) {
     params.put("supplierId", this.ebkHousePrice.getSupplierId());
   }
   params.put("productType", Constant.PRODUCT_TYPE.ROUTE.name());
   params.put("applyType", Constant.EBK_HOUSE_PRICE_APPLY_TYPE.STOCK_APPLY.name());
   this.ebkHousePricePage.setTotalResultSize(
       this.ebkHousePriceService.countEbkHousePriceListByExample(params));
   ebkHousePricePage.buildUrl(getRequest());
   ebkHousePricePage.setCurrentPage(this.page);
   params.put("start", ebkHousePricePage.getStartRows());
   params.put("end", ebkHousePricePage.getEndRows());
   params.put("orderby", "CREATE_TIME");
   params.put("order", "DESC");
   this.ebkHousePriceList = this.ebkHousePriceService.findEbkHousePriceListByExample(params);
   this.ebkHousePricePage.setItems(this.ebkHousePriceList);
   return "ebkRouteStockList";
 }
  protected Page<PlaceBean> getPlaceSearchList(Map<String, Object> params) {
    ClientPlaceSearchVO searchVo = new ClientPlaceSearchVO();
    if (params.get("keyword") != null) {
      ArgCheckUtils.validataRequiredArgs("stage", "page", "keyword", params);
    } else {
      ArgCheckUtils.validataRequiredArgs("stage", "page", "windage", params);
      searchVo.setLongitude(params.get("longitude").toString());
      searchVo.setLatitude(params.get("latitude").toString());
      searchVo.setWindage(params.get("windage").toString());
    }

    if (params.get("keyword") != null) {
      searchVo.setKeyword(StringUtil.subStringStrNoSuffix(params.get("keyword").toString(), 60));
    }
    if (params.get("page") != null) {
      searchVo.setPage(Integer.parseInt(params.get("page").toString()));
    }

    if (params.get("subject") != null) {
      searchVo.setSubject(params.get("subject").toString());
    }

    if (params.get("sort") != null) {
      searchVo.setSort(params.get("sort").toString());
    }

    if (params.get("pageSize") != null) {
      searchVo.setPageSize(Integer.parseInt(params.get("pageSize").toString()));
    }

    if (params.get("stage") != null) {
      searchVo.setStage(ClientUtils.convetToList(params.get("stage").toString()));
    }

    if (params.get("productType") != null) {
      searchVo.setProductType(ClientUtils.convetToList(params.get("productType").toString()));
    } else { // 默认有门票
      /** 必须含有门票 */
      searchVo.setProductType(ClientUtils.convetToList("TICKET"));
    }

    if (params.get("hasRoute") != null) {
      searchVo.setProductType(ClientUtils.convetToList(Constant.PRODUCT_TYPE.ROUTE.name()));
    }
    // searchVo.setChannel(Constant.CHANNEL.CLIENT.name());

    Page<PlaceBean> pageConfig = vstClientPlaceService.placeSearch(searchVo);
    return pageConfig;
  }
 /**
  * 待审核线路库存变更列表页面.
  *
  * @return
  */
 @Action("ebkRouteStockApplyList")
 public String ebkRouteStockApplyList() {
   Map<String, Object> params = new HashMap<String, Object>();
   params.put("status", Constant.EBK_SUGGEST_AUDIT_STATUS.WAITING_FOR_AUDIT.name());
   if (this.ebkHousePrice.getHousePriceId() != null) {
     params.put("housePriceId", this.ebkHousePrice.getHousePriceId());
   }
   // 提交时间开始.
   if (this.createTimeBegin != null && !StringUtils.isEmpty(this.createTimeBegin)) {
     params.put("createTimeBegin", this.createTimeBegin);
   }
   // 提交时间结束
   if (this.createTimeEnd != null && !StringUtils.isEmpty(this.createTimeEnd)) {
     params.put("createTimeEnd", this.createTimeEnd);
   }
   // 提交人.
   if (this.ebkHousePrice.getSubmitUser() != null
       && !StringUtils.isEmpty(this.ebkHousePrice.getSubmitUser())) {
     params.put("submitUser", this.ebkHousePrice.getSubmitUser().trim());
   }
   // 供应商名称.
   if (this.ebkHousePrice.getSupplierId() != null) {
     params.put("supplierId", this.ebkHousePrice.getSupplierId());
   }
   params.put("productType", Constant.PRODUCT_TYPE.ROUTE.name());
   params.put("applyType", Constant.EBK_HOUSE_PRICE_APPLY_TYPE.STOCK_APPLY.name());
   this.ebkHousePricePage.setTotalResultSize(
       this.ebkHousePriceService.countEbkHousePriceListByExample(params));
   ebkHousePricePage.buildUrl(getRequest());
   ebkHousePricePage.setCurrentPage(this.page);
   params.put("start", ebkHousePricePage.getStartRows());
   params.put("end", ebkHousePricePage.getEndRows());
   params.put("orderby", "CREATE_TIME");
   params.put("order", "DESC");
   this.ebkHousePriceList = this.ebkHousePriceService.findEbkHousePriceListByExample(params);
   this.ebkHousePricePage.setItems(this.ebkHousePriceList);
   return "ebkRouteStockApplyList";
 }
  public Page<ProductBean> listRoute(Map<String, Object> params) {
    if (isFreness(params)) {
      ArgCheckUtils.validataRequiredArgs("toDest", "page", params);
    } else {
      ArgCheckUtils.validataRequiredArgs("fromDest", "toDest", "page", params);
    }

    ClientRouteSearchVO searchVo = new ClientRouteSearchVO();
    searchVo.setChannel(Constant.CHANNEL.CLIENT.name());
    List<String> productTypes = new ArrayList<String>();
    productTypes.add(Constant.PRODUCT_TYPE.ROUTE.name());
    searchVo.setProductType(productTypes);

    if (params.get("pageSize") != null) {
      searchVo.setPageSize(Integer.parseInt(params.get("pageSize").toString()));
    }

    if (params.get("subject") != null) {
      searchVo.setSubject(params.get("subject").toString());
    }

    if (params.get("placeId") != null) {
      searchVo.setCityId(params.get("placeId").toString());
    }

    searchVo.setPage(Integer.valueOf(params.get("page").toString()));

    if (params.get("searchType") != null) {
      if (params.get("subProductType") != null && !"".equals(params.get("subProductType"))) {
        String searchType = params.get("searchType").toString();
        if (this.isNotOverSeaTravel(searchType)) {
          if (params.get("fromDest") != null) {
            String fromDest = params.get("fromDest").toString();
            if (fromDest.contains(",")) {
              fromDest = fromDest.substring(0, fromDest.lastIndexOf(","));
              params.put("fromDest", fromDest);
            }
          }
        }
      }
    }

    if (params.get("subProductType") != null) {
      if (this.isFreness(params)) {
        params.put("fromDest", null);
      }
      searchVo.setSubProductType(ClientUtils.convetToList(params.get("subProductType").toString()));
    } else {
      searchVo.setSubProductType(new ArrayList<String>());
    }

    if (params.get("fromDest") != null) {
      searchVo.setFromDest(params.get("fromDest").toString());
    }

    if (params.get("toDest") != null) {
      searchVo.setToDest(StringUtil.subStringStrNoSuffix(params.get("toDest").toString(), 60));
    }

    if (params.get("sort") != null) {
      searchVo.setSort(params.get("sort").toString());
    } else { // 添加默认seq排序
      searchVo.setSort("seq");
    }

    if (params.get("day") != null) {
      searchVo.setVisitDay(params.get("day").toString());
    }

    if (params.get("keyword") != null) {
      searchVo.setKeyword(StringUtil.subStringStrNoSuffix(params.get("keyword").toString(), 60));
    }

    Page<ProductBean> pageConfig = vstClientProductService.routeSearch(searchVo);
    return pageConfig;
  }
  public Map<String, Object> routeSearch(Map<String, Object> params) {
    if (isFreness(params)) {
      ArgCheckUtils.validataRequiredArgs("toDest", "page", params);
    } else {
      ArgCheckUtils.validataRequiredArgs("fromDest", "toDest", "page", params);
    }
    Map<String, Object> resultMap = new HashMap<String, Object>();

    ClientRouteSearchVO searchVo = new ClientRouteSearchVO();
    searchVo.setChannel(Constant.CHANNEL.CLIENT.name());
    List<String> productTypes = new ArrayList<String>();
    productTypes.add(Constant.PRODUCT_TYPE.ROUTE.name());
    searchVo.setProductType(productTypes);

    if (params.get("pageSize") != null) {
      searchVo.setPageSize(Integer.parseInt(params.get("pageSize").toString()));
    }

    if (params.get("subject") != null) {
      searchVo.setSubject(params.get("subject").toString());
    }

    if (params.get("palceId") != null) {
      searchVo.setPlaceId(params.get("palceId").toString());
    }

    searchVo.setPage(Integer.valueOf(params.get("page").toString()));

    if (params.get("searchType") != null) {
      if (params.get("subProductType") != null && !"".equals(params.get("subProductType"))) {
        String searchType = params.get("searchType").toString();
        if (this.isNotOverSeaTravel(searchType)) {
          if (params.get("fromDest") != null) {
            String fromDest = params.get("fromDest").toString();
            if (fromDest.contains(",")) {
              fromDest = fromDest.substring(0, fromDest.lastIndexOf(","));
              params.put("fromDest", fromDest);
            }
          }
        }
      }
    }

    if (params.get("subProductType") != null) {
      if (this.isFreness(params)) {
        params.put("fromDest", null);
      }
      searchVo.setSubProductType(ClientUtils.convetToList(params.get("subProductType").toString()));
    } else {
      searchVo.setSubProductType(new ArrayList<String>());
    }

    if (params.get("fromDest") != null) {
      searchVo.setFromDest(params.get("fromDest").toString());
    }

    if (params.get("toDest") != null) {
      searchVo.setToDest(StringUtil.subStringStrNoSuffix(params.get("toDest").toString(), 60));
    }

    if (params.get("sort") != null) {
      searchVo.setSort(params.get("sort").toString());
    }
    if (params.get("day") != null) {
      searchVo.setVisitDay(params.get("day").toString());
    }

    if (params.get("keyword") != null) {
      searchVo.setKeyword(StringUtil.subStringStrNoSuffix(params.get("keyword").toString(), 60));
    }

    Page<ProductBean> pageConfig = vstClientProductService.routeSearch(searchVo);
    List<MobileProductTitle> mpList = new ArrayList<MobileProductTitle>();
    Map<String, String> visitMap = new HashMap<String, String>();

    for (ProductBean productBean : pageConfig.getAllItems()) {
      if (!StringUtil.isEmptyString(productBean.getRouteTopic())) {
        String[] topics = productBean.getRouteTopic().split(",");
        for (String string : topics) {
          String str = StringUtils.trimAllWhitespace(string);
          visitMap.put(str, str);
        }
      }
    }

    List<Map<String, Object>> topicList = new ArrayList<Map<String, Object>>();
    Iterator<Entry<String, String>> it = visitMap.entrySet().iterator();

    // subjectList列表
    Map<String, Object> t_m = new HashMap<String, Object>();
    t_m.put("title", "全部主题");
    t_m.put("value", "");
    topicList.add(t_m);
    while (it.hasNext()) {
      Map<String, Object> m = new HashMap<String, Object>();
      Map.Entry<String, String> entry = (Map.Entry<String, String>) it.next();
      String key = entry.getKey();
      m.put("title", key);
      m.put("value", key);
      topicList.add(m);
    }

    for (ProductBean productBean : pageConfig.getItems()) {
      // 过滤掉超级自由行
      if ("true".equals(productBean.getSelfPack())) {
        continue;
      }
      MobileProductTitle mp = new MobileProductTitle();
      mp.setProductName(productBean.getProductName());
      mp.setMarketPriceYuan(productBean.getMarketPrice());
      mp.setSmallImage(productBean.getSmallImage());
      mp.setSellPriceYuan(productBean.getSellPrice());
      mp.setProductId(productBean.getProductId());
      mp.setClientOnly(Constant.CHANNEL.CLIENT.name().equals(productBean.getProductChannel()));
      // 返现金额 分
      mp.setMaxCashRefund(
          null == productBean.getCashRefund()
              ? 0l
              : PriceUtil.convertToFen(productBean.getCashRefund()));
      mp.setCmtNum(productBean.getCmtNum()); // 点评数
      mp.setSubProductType(productBean.getSubProductType()); // 主题类型
      mp.setVisitDay(productBean.getVisitDay() + ""); // 天数
      try {
        ProductSearchInfo psi =
            this.productSearchInfoService.queryProductSearchInfoByProductId(
                productBean.getProductId());
        mp.setHasBusinessCoupon(ClientUtils.hasBusinessCoupon(psi)); // 优惠
      } catch (Exception e) {
        e.printStackTrace();
      }

      mpList.add(mp);
    }

    resultMap.put("subjects", topicList);
    resultMap.put("datas", mpList);
    resultMap.put("isLastPage", isLastPage(pageConfig));
    return resultMap;
  }