public Map<String, Object> shakePlace(Map<String, Object> params) { ClientPlaceSearchVO searchVo = new ClientPlaceSearchVO(); searchVo.setPage(1); searchVo.setPageSize(60); searchVo.setStage(ClientUtils.convetToList("2")); searchVo.setSort("salse"); searchVo.setProductType(ClientUtils.convetToList(Constant.PRODUCT_TYPE.TICKET.name())); if (params.get("keyword") != null) { searchVo.setKeyword(params.get("keyword").toString()); } else { searchVo.setKeyword("上海"); } Page<PlaceBean> pageConfig = vstClientPlaceService.placeSearch(searchVo); Map<String, Object> resultMap = new HashMap<String, Object>(); /* * List<MobilePlace> mplaceList = new ArrayList<MobilePlace>(); * * for (PlaceBean placeBean : pageConfig.getItems()) { * * mplaceList.add(this.convertToMobilePlace(placeBean)); } * resultMap.put("datas", mplaceList); */ resultMap.put("isLastPage", isLastPage(pageConfig)); List<PlaceBean> placeList = pageConfig.getItems(); MobilePlace pb = getRandomPlaceBean(placeList, String.valueOf(params.get("placeId"))); resultMap.put("datas", pb); return resultMap; }
public Map<String, Object> placeAutoComplete(Map<String, Object> params) { ArgCheckUtils.validataRequiredArgs("keyword", params); Map<String, Object> resultMap = new HashMap<String, Object>(); ClientPlaceSearchVO searchVo = new ClientPlaceSearchVO(); searchVo.setStage(ClientUtils.convetToList("1,2")); List<String> productTypes = new ArrayList<String>(); productTypes.add(Constant.PRODUCT_TYPE.TICKET.name()); searchVo.setProductType(productTypes); searchVo.setChannel(Constant.CHANNEL.CLIENT.name()); searchVo.setKeyword(StringUtil.subStringStrNoSuffix(params.get("keyword").toString(), 60)); List<AutoCompletePlaceObject> list = vstClientPlaceService.getAutoCompletePlace(searchVo); List<Map<String, Object>> keyList = new ArrayList<Map<String, Object>>(); if (list != null) { for (AutoCompletePlaceObject autoCompletePlaceObject : list) { Map<String, Object> map = new HashMap<String, Object>(); map.put("name", autoCompletePlaceObject.getWords()); map.put("id", autoCompletePlaceObject.getShortId()); map.put("stage", autoCompletePlaceObject.getStage()); keyList.add(map); } } resultMap.put("datas", keyList); return resultMap; }
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; }