| | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.buwan.domain.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService; |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.service.inter.video.VideoInfoExtraService; |
| | | import com.yeshi.buwan.util.JuHe.VideoResourceUtil; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.SQLQuery; |
| | |
| | | private CategoryRecommendVideoService categoryRecommendVideoService; |
| | | |
| | | @Resource |
| | | private VideoResourceMapExtraInfoService videoResourceMapExtraInfoService; |
| | | private VideoInfoExtraService videoInfoExtraService; |
| | | |
| | | @Resource |
| | | private VideoResourceUtil videoResourceUtil; |
| | |
| | | |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | @Cacheable(value = "topCache", key = "'getVideoListByRank'+'-'+#videotype+'-'+#detailSystem+'-'+#platform+'-'+#version") |
| | | public List<VideoInfo> getVideoListByRank(final int videotype, final String detailSystem, String platform, Integer version) { |
| | | @Cacheable(value = "topCache", key = "'getVideoListByRank'+'-'+#videotype+'-'+#detailSystem+'-'+#platform+'-'+#version+'-'+#channel") |
| | | public List<VideoInfo> getVideoListByRank(final int videotype, final String detailSystem, String platform, Integer version, String channel) { |
| | | |
| | | List<Long> resourceList = videoResourceUtil.getAvailableResourceIds(new DetailSystem(detailSystem), version); |
| | | List<Long> resourceList = videoResourceUtil.getAvailableResourceIds(new DetailSystem(detailSystem), version, channel); |
| | | |
| | | final int count = categoryRecommendVideoService.getRankVideoNumber(videotype); |
| | | List<VideoInfo> videoInfoList = (List<VideoInfo>) dao.excute(new HibernateCallback<List<VideoInfo>>() { |
| | |
| | | vr.setHpicture(objs[5] + ""); |
| | | vr.setLatestVpicture(objs[6] + ""); |
| | | vr.setLatestHpicture(objs[7] + ""); |
| | | vr.setWatchCount(objs[8] + ""); |
| | | vr.setCommentCount(Integer.parseInt(objs[9] + "")); |
| | | vr.setWatchCount(objs[8] != null ? objs[8] + "" : "0"); |
| | | vr.setCommentCount(objs[9] != null ? Integer.parseInt(objs[9] + "") : 0); |
| | | vr.setOrderBy(Integer.parseInt(objs[10] + "")); |
| | | vr.setTag(objs[11] + ""); |
| | | vr.setVideocount(0); |
| | | if (vr.getRank() > 0) { |
| | | rks.add(vr); |
| | | } else |
| | |
| | | } |
| | | }); |
| | | |
| | | return videoResourceMapExtraInfoService.batchExtraInfo(videoInfoList, resourceList); |
| | | return videoInfoExtraService.batchExtra(videoInfoList, resourceList); |
| | | } |
| | | |
| | | public CategoryRecommendCacheVideo getByVid(String vid) { |