admin
2021-09-24 f788607ff771a47bc60d6a86e00b3433c40f3d2c
src/main/java/com/yeshi/buwan/controller/parser/ClassParser.java
@@ -5,22 +5,20 @@
import com.yeshi.buwan.domain.ad.CommonAdPositionAd;
import com.yeshi.buwan.domain.recommend.CategoryRecommendVideo;
import com.yeshi.buwan.domain.recommend.HomeRecommendSpecial;
import com.yeshi.buwan.domain.solr.SolrAlbumVideo;
import com.yeshi.buwan.domain.special.Special;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.system.DetailSystemConfig;
import com.yeshi.buwan.dto.search.SolrResultDTO;
import com.yeshi.buwan.dto.search.SolrVideoSearchFilter;
import com.yeshi.buwan.pptv.PPTVUtil;
import com.yeshi.buwan.videos.pptv.PPTVUtil;
import com.yeshi.buwan.service.imp.*;
import com.yeshi.buwan.service.imp.recommend.CategoryRecommendVideoService;
import com.yeshi.buwan.service.inter.recommend.HomeRecommendSpecialService;
import com.yeshi.buwan.service.manager.SolrAlbumVideoDataManager;
import com.yeshi.buwan.service.manager.SolrCommonVideoDataManager;
import com.yeshi.buwan.service.manager.search.SolrAlbumVideoDataManager;
import com.yeshi.buwan.util.*;
import com.yeshi.buwan.util.JuHe.VideoResourceUtil;
import com.yeshi.buwan.util.ad.CommonAdUtil;
import com.yeshi.buwan.util.annotation.RequireUid;
import com.yeshi.buwan.util.factory.VideoInfoFactory;
import com.yeshi.buwan.util.video.VideoConstant;
import com.yeshi.buwan.vo.AcceptData;
import com.yeshi.buwan.vo.HomeClassVO;
@@ -35,7 +33,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
@Controller
public class ClassParser {
@@ -76,6 +73,9 @@
    @Resource
    private HomeRecommendSpecialService homeRecommendSpecialService;
    @Resource
    private DetailSystemConfigService detailSystemConfigService;
    @RequireUid
    public void getClass(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
@@ -328,6 +328,13 @@
            if (sv.getType().getId() != 309L && sv.getType().getId() != 310L)
                typelist.add(vo);
        }
        //IOS审核版本
        DetailSystemConfig onLineVersion = detailSystemConfigService.getConfigByKey("ios_online_version", acceptData.getDetailSystem(), acceptData.getVersion());
        if (onLineVersion != null && Integer.parseInt(onLineVersion.getValue()) <= acceptData.getVersion()) {
            typelist.clear();
        }
        //获取首页推荐标签
        List<HomeRecommendSpecial> specialList = homeRecommendSpecialService.listSpecialByDetailSystemId(acceptData.getDetailSystem().getId(), null, 1, Constant.pageCount);
        if (specialList != null) {
@@ -342,7 +349,6 @@
                if (vo.getName().contains("高清"))
                    vo.setColor("#ff6600");
                typelist.add(0, vo);
            }
        }
@@ -413,7 +419,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(detailSystem, acceptData.getVersion(), acceptData.getChannel());
        List<VideoInfo> list = starService.getStarVideo(detailSystem.getId(), starId, pageIndex,
                CacheUtil.getMD5Long(resourceList));
@@ -475,7 +481,7 @@
        if (Utils.isTest(request, user, detailSystem.getId()))
            detailSystem = systemService.getDetailSystemById(40 + "");
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        List<Long> resourceList = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel());
        String resourceMD5 = CacheUtil.getMD5Long(resourceList);
@@ -565,7 +571,7 @@
                                break;
                            default:
                        }
                        filter.setResourceIds(new String[]{PPTVUtil.RESOURCE_ID + ""});
                        filter.setResourceIds(Arrays.asList(new String[]{PPTVUtil.RESOURCE_ID + ""}));
                        //更新时间
                        if ("1".equalsIgnoreCase(order)) {
@@ -853,7 +859,7 @@
        String specialid = request.getParameter("Id");
        Special special = specialService.getSpecial(specialid);
        List<VideoInfo> list = specialService.getSpecialVideoList(specialid);
        List<Long> availableResourceIds = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion());
        List<Long> availableResourceIds = videoResouceUtil.getAvailableResourceIds(acceptData.getDetailSystem(), acceptData.getVersion(), acceptData.getChannel());
        List<VideoInfo> tempList = new ArrayList<>();
        for (VideoInfo videoInfo : list) {
            List<VideoResource> resourceList = videoResourceService.getResourceByVideo(videoInfo);
@@ -945,21 +951,22 @@
        String typeid = request.getParameter("Type");
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        List<VideoInfo> rankList = null;
        if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= Constant.IOS_ONLINING_VERSION) {
            SolrVideoSearchFilter filter = new SolrVideoSearchFilter();
            filter.setResourceIds(new String[]{25 + ""});
            filter.setVideoType(Integer.parseInt(typeid));
            filter.setFreeType(0);
            SolrResultDTO dto = solrAlbumVideoDataManager.find(filter, 1, 30);
            List<SolrAlbumVideo> list = dto.getVideoList();
            rankList = new ArrayList<>();
            for (SolrAlbumVideo video : list) {
                rankList.add(VideoInfoFactory.create(video));
            }
        } else {
            rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid),
                    detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion());
        }
//        if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && acceptData.getVersion() >= Constant.IOS_ONLINING_VERSION) {
//            SolrVideoSearchFilter filter = new SolrVideoSearchFilter();
//            filter.setResourceIds(new String[]{25 + ""});
//            filter.setVideoType(Integer.parseInt(typeid));
//            filter.setFreeType(0);
//            SolrResultDTO dto = solrAlbumVideoDataManager.find(filter, 1, 30);
//            List<SolrAlbumVideo> list = dto.getVideoList();
//            rankList = new ArrayList<>();
//            for (SolrAlbumVideo video : list) {
//                rankList.add(VideoInfoFactory.create(video));
//            }
//        }
//        else {
        rankList = categoryRecommendCacheVideoService.getVideoListByRank(Integer.parseInt(typeid),
                detailSystem.getId(), acceptData.getPlatform(), acceptData.getVersion(), acceptData.getChannel());
//        }
        List<VideoInfo> list = new ArrayList<>();