示例#1
0
  /**
   * site map
   *
   * @param dto
   * @param model
   * @return
   */
  @RequestMapping("/siteMap")
  public String siteMap(YouSearchDto dto, Model model) {
    model.addAttribute("curPageTag", "sitemap");
    model.addAttribute("siteMapType", dto.getSiteMapType());
    model.addAttribute("dataCityKey", Constants.XML_CITY_KEY);
    model.addAttribute("searchDto", dto);
    List list = new ArrayList();
    // 3 酒店
    if ("3".equals(dto.getSiteMapType())) {
      list = hotelService.getSiteMapList(dto);
      // 酒店站点城市
      Map<String, String> hotelMap = hotelService.getHotelCity();
      hotelMap.remove("-1");
      hotelMap.remove(Constants.XML_CITY_KEY.get(dto.getIpLocate()));
      model.addAttribute("hotelCity", hotelMap);
    } else {
      // 其他城市
      list = goodsService.getSiteMapList(dto);
      Map<String, String> youCity = goodsService.getYouCity(dto);
      youCity.remove("-1");
      youCity.remove(Constants.XML_CITY_KEY.get(dto.getIpLocate()));
      model.addAttribute("youCity", youCity);
    }

    model.addAttribute("siteList", list);
    return "siteMap";
  }
示例#2
0
  private void getCtiys(YouSearchDto dto, Model model, String type) {
    // 酒店站点城市
    Map<String, String> hotelMap = hotelService.getHotelCity();
    model.addAttribute("hotelCity", hotelMap);

    // 帮5游站点城市
    Map<String, String> youCity = goodsService.getYouCity(dto);
    model.addAttribute("youCity", youCity);

    // 攻略站点城市
    Map<String, String> notesCity = guideNotesService.findNotesCity();
    model.addAttribute("notesCity", notesCity);

    if (("hotel").equals(type)) {
      String isCity = hotelMap.get(Constants.XML_CITY_KEY.get(dto.getIpLocate()));
      if (null == isCity || ("").equals(isCity)) {
        String shCity = hotelMap.get(Constants.XML_CITY_KEY.get("上海"));
        if ((null == shCity || ("").equals(shCity)) && hotelMap.keySet().size() > 0)
          dto.setIpLocate((String) ((hotelMap.keySet().toArray())[0]));
        else dto.setIpLocate("2");
      }
    } else if (("you").equals(type)) {
      String isCity = youCity.get(Constants.XML_CITY_KEY.get(dto.getIpLocate()));
      if (null == isCity || ("").equals(isCity)) {
        String shCity = youCity.get(Constants.XML_CITY_KEY.get("上海"));
        if ((null == shCity || ("").equals(shCity)) && youCity.keySet().size() > 0)
          dto.setIpLocate((String) ((youCity.keySet().toArray())[0]));
        else dto.setIpLocate("2");
      }
    } else {
      if ("-1".equals(dto.getSelectedCityId())) {
        dto.setIpLocate("全部");
      }
    }
  }