private void initTags(PlaceSearchInfo placeSearchInfo) { if (placeSearchInfo != null) { List<ProdTag> tagList = new ArrayList<ProdTag>(); Map<String, List<ProdTag>> tagGroupMap = new HashMap<String, List<ProdTag>>(); String tagsNameStr = placeSearchInfo.getDestTagsName(); if (StringUtils.isNotBlank(tagsNameStr)) { String[] tagsName = tagsNameStr.split(","); String[] tagsDescript = placeSearchInfo.getDestTagsDescript().split(","); String[] tagsCss = placeSearchInfo.getDestTagsCss().split(","); String[] tagsGroup = placeSearchInfo.getDestTagsGroup().split(","); if (tagsName.length == tagsDescript.length && tagsName.length == tagsCss.length && tagsName.length == tagsGroup.length) { for (int i = 0; i < tagsName.length; i++) { String tagName = tagsName[i]; // 去掉TAGNAME后面拼接的"~拼音" if (tagsName[i].indexOf("~") != -1) { tagName = tagsName[i].substring(0, tagsName[i].indexOf("~")); } ProdTag pt = new ProdTag(); pt.setTagName(tagName); String description = tagsDescript[i]; if (StringUtils.isNotBlank(description)) { pt.setDescription(description); } else { pt.setDescription(""); } pt.setCssId(tagsCss[i]); String tagGroup = tagsGroup[i]; pt.setTagGroupName(tagGroup); List<ProdTag> tagGroupList = tagGroupMap.get(tagGroup); if (tagGroupList == null) { tagGroupList = new ArrayList<ProdTag>(); tagGroupMap.put(tagGroup, tagGroupList); } tagGroupList.add(pt); tagList.add(pt); } } else { LOG.warn("place tags length is error. placeid:" + placeSearchInfo.getPlaceId()); } } placeSearchInfo.setTagList(tagList); placeSearchInfo.setTagGroupMap(tagGroupMap); } }