| | |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | |
| | | |
| | | int pageSize = Constant.pageCount; |
| | | boolean hasNextPage = false; |
| | | if (searchSpecial.getAlbumQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrAlbumVideoDataManager.find(searchSpecial.getAlbumQuery(), pageIndex, pageSize); |
| | | |
| | | //获取搜索条件 |
| | | SearchSpecial.QueryConditions conditions = null; |
| | | |
| | | if (searchSpecial.getContainerList() != null) { |
| | | //按version排序 |
| | | Comparator<SearchSpecial.QueryConditionsContainer> cm = (o1, o2) -> o1.getMinVersion() - o2.getMinVersion(); |
| | | Collections.sort(searchSpecial.getContainerList(), cm); |
| | | |
| | | |
| | | for (SearchSpecial.QueryConditionsContainer container : searchSpecial.getContainerList()) { |
| | | if (acceptData.getDetailSystem().getId().equalsIgnoreCase(container.getDetailSystemId())) { |
| | | if (acceptData.getVersion() >= container.getMinVersion()) { |
| | | if (acceptData.getChannel().equalsIgnoreCase(container.getChannel())) { |
| | | conditions = container.getQueryConditions(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (conditions == null) { |
| | | for (SearchSpecial.QueryConditionsContainer container : searchSpecial.getContainerList()) { |
| | | if (acceptData.getDetailSystem().getId().equalsIgnoreCase(container.getDetailSystemId())) { |
| | | if (acceptData.getVersion() >= container.getMinVersion()) { |
| | | conditions = container.getQueryConditions(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (conditions.getAlbumQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrAlbumVideoDataManager.find(conditions.getAlbumQuery(), pageIndex, pageSize); |
| | | if (solrResultDTO != null) { |
| | | List<SolrAlbumVideo> list = solrResultDTO.getVideoList(); |
| | | if (list != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | if (searchSpecial.getInternetQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrInternetSearchVideoDataManager.find(searchSpecial.getInternetQuery(), pageIndex, pageSize); |
| | | if (conditions.getInternetQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrInternetSearchVideoDataManager.find(conditions.getInternetQuery(), pageIndex, pageSize); |
| | | if (solrResultDTO != null) { |
| | | List<InternetSearchVideo> list = solrResultDTO.getVideoList(); |
| | | if (list != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | if (searchSpecial.getShortQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrShortVideoDataManager.find(searchSpecial.getShortQuery(), pageIndex, pageSize); |
| | | if (conditions.getShortQuery() != null) { |
| | | SolrResultDTO solrResultDTO = solrShortVideoDataManager.find(conditions.getShortQuery(), pageIndex, pageSize); |
| | | if (solrResultDTO != null) { |
| | | List<SolrShortVideo> list = solrResultDTO.getVideoList(); |
| | | if (list != null) { |
| | |
| | | item.put("name", StringUtil.isNullOrEmpty(map.getShowName()) ? map.getSpecial().getName() : map.getShowName()); |
| | | item.put("id", map.getSpecialId()); |
| | | item.put("icon", map.getIcon()); |
| | | array.add(item); |
| | | String name = item.optString("name"); |
| | | //魅族和小米不添加 |
| | | if (("xiaomi" .equalsIgnoreCase(acceptData.getChannel()) || "meizu" .equalsIgnoreCase(acceptData.getChannel())) && "hanju-video-types" .equalsIgnoreCase(pid)) { |
| | | if (name.contains("电视剧") || name.contains("电影") || name.contains("综艺") || name.contains("少儿")) { |
| | | array.add(item); |
| | | } |
| | | } else { |
| | | array.add(item); |
| | | } |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | data.put("list", array); |