From 7def9937241d8c5fada7a63c8a0fd144bf0c05ff Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 23 三月 2021 19:32:21 +0800
Subject: [PATCH] IOS上线版本资源隐藏

---
 src/main/java/com/yeshi/buwan/service/imp/SearchService.java |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/service/imp/SearchService.java b/src/main/java/com/yeshi/buwan/service/imp/SearchService.java
index 5f589fb..57b6482 100644
--- a/src/main/java/com/yeshi/buwan/service/imp/SearchService.java
+++ b/src/main/java/com/yeshi/buwan/service/imp/SearchService.java
@@ -1,13 +1,15 @@
 package com.yeshi.buwan.service.imp;
 
 import com.yeshi.buwan.dao.*;
+import com.yeshi.buwan.dao.system.DetailSystemDao;
 import com.yeshi.buwan.domain.*;
 import com.yeshi.buwan.domain.solr.SolrAlbumVideo;
+import com.yeshi.buwan.domain.system.DetailSystem;
 import com.yeshi.buwan.domain.web.DetailSystemSelect;
 import com.yeshi.buwan.domain.web.HotSearchAdmin;
 import com.yeshi.buwan.dto.search.SolrResultDTO;
 import com.yeshi.buwan.dto.search.SolrVideoSearchFilter;
-import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService;
+import com.yeshi.buwan.pptv.PPTVUtil;
 import com.yeshi.buwan.service.inter.video.VideoInfoExtraService;
 import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager;
 import com.yeshi.buwan.util.*;
@@ -16,6 +18,8 @@
 import com.yeshi.buwan.vo.video.VideoListResultVO;
 import org.hibernate.HibernateException;
 import org.hibernate.Session;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.orm.hibernate4.HibernateCallback;
 import org.springframework.stereotype.Service;
@@ -27,6 +31,9 @@
 
 @Service
 public class SearchService {
+    private Logger logger= LoggerFactory.getLogger(SearchService.class);
+
+
     @Resource
     private SearchDao searchDao;
     @Resource
@@ -284,7 +291,11 @@
 
             SolrVideoSearchFilter filter = new SolrVideoSearchFilter();
             filter.setKey(key);
-            filter.setVideoType(videoType == 0 ? null : videoType);
+            if (videoType == Constant.SEARCH_RESULT_TYPE_HIGH_DEFINITION) {
+                filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""});
+                logger.info("楂樻竻鎼滅储# key锛歿}",key);
+            } else
+                filter.setVideoType(videoType == 0 ? null : videoType);
             filter.setContentType(1);
 
             SolrResultDTO solrResultDTO = solrAlbumDataManager.find(filter, page, pageSize);
@@ -327,11 +338,15 @@
 
             if (videoType == 0 && commonSolrPage > 0) {
                 //鎼滅储鍘熷鐨�
-                List<VideoInfo> solrList = SolrUtil.search(key, commonSolrPage);
-                for (VideoInfo vi : solrList) {
-                    if (!solrAlbumVids.contains(vi.getId())) {
-                        localList.add(vi);
+                try {
+                    List<VideoInfo> solrList = SolrUtil.search(key, commonSolrPage);
+                    for (VideoInfo vi : solrList) {
+                        if (!solrAlbumVids.contains(vi.getId())) {
+                            localList.add(vi);
+                        }
                     }
+                } catch (Exception e) {
+
                 }
             }
             System.out.println("鎼滅储鑰楁椂:" + (System.currentTimeMillis() - startt));
@@ -615,4 +630,23 @@
 
     }
 
+
+    /**
+     * 灏嗘悳绱㈢粨鏋滃璞¤浆涓鸿棰戝璞�
+     *
+     * @param solrAlbumVideoList
+     * @param resourceList
+     * @return
+     */
+    public List<VideoInfo> convertSolrAlbumResultToVideo(List<SolrAlbumVideo> solrAlbumVideoList, List<Long> resourceList) {
+        List<VideoInfo> videoInfoList = new ArrayList<>();
+        for (SolrAlbumVideo sv : solrAlbumVideoList) {
+            VideoInfo video = VideoInfoFactory.create(sv);
+            videoInfoList.add(video);
+        }
+        //鑾峰彇闄勫姞淇℃伅
+        videoInfoList = videoInfoExtraService.batchExtra(videoInfoList, resourceList);
+        return videoInfoList;
+    }
+
 }

--
Gitblit v1.8.0