private static void wrapSiteEpisodeLog(AuditEpisodeLogBo auditEpisodeLogBo, int siteId)
      throws Exception {
    Criteria crit = new Criteria();
    crit.add(ProgrammeSitePeer.FK_PROGRAMME_ID, auditEpisodeLogBo.getId());
    List<ProgrammeSite> psList = ProgrammeSitePeer.doSelect(crit);
    List<AuditEpisodeLogBo.SiteEpisodeLog> siteEpisodeLogList =
        new ArrayList<AuditEpisodeLogBo.SiteEpisodeLog>();
    List<AuditEpisodeLogBo.SiteEpisodeLog> hasEpisodeSiteList =
        new ArrayList<AuditEpisodeLogBo.SiteEpisodeLog>();
    if (psList != null && !psList.isEmpty()) {
      for (ProgrammeSite ps : psList) {
        // log.info("siteId" + siteId);
        if (siteId > 0 && ps.getSourceSite() != siteId) {
          continue;
        }
        AuditEpisodeLogBo.SiteEpisodeLog siteEpisode =
            getSiteEpisodeLog(ps.getId(), ps.getSourceSite());

        hasEpisodeSiteList.add(getHasEpisodeSite(ps.getId(), ps.getSourceSite()));

        /*//审核特殊显示全剧情况
        if(auditEpisodeLogBo.getConcernLevel() == Constants.CONCERN_FLAG) {
        	AuditEpisodeLogBo.SiteEpisodeLog allEpisode = processConcernProgramme(ps.getId(), siteId);
        	if(allEpisode.getEpisodeLogList() != null) {
        		siteEpisode.getEpisodeLogList().addAll(allEpisode.getEpisodeLogList());
        	}
        	Collections.sort(siteEpisode.getEpisodeLogList(), new Comparator<EpisodeLog>() {

        		@Override
        		public int compare(EpisodeLog o1, EpisodeLog o2) {
        			return o1.getOrderId() - o2.getOrderId();
        		}
        	});
        }*/
        siteEpisodeLogList.add(siteEpisode);
      }
    }

    auditEpisodeLogBo.setHasEpisodeSiteIds(hasEpisodeSiteList);
    auditEpisodeLogBo.setSiteEpisodeLogList(siteEpisodeLogList);
    auditEpisodeLogBo.setCateName(
        CategoryService.getCategoryMap().get(auditEpisodeLogBo.getCateId()));
  }
예제 #2
0
 /** 优酷收录完成的,优酷优先 未完成的,集数多的优先 */
 @Override
 public int compare(ProgrammeSite o1, ProgrammeSite o2) {
   if (o1 == null && o2 == null) {
     return 0;
   }
   if (o1 == null) {
     return 1;
   }
   if (o1.getSourceSite() == ProgrammeSiteType.优酷网.getValue() && o1.getCompleted() > 0) {
     return -1;
   }
   if (o2 == null) {
     return -1;
   }
   if (o2.getSourceSite() == ProgrammeSiteType.优酷网.getValue() && o2.getCompleted() > 0) {
     return 1;
   }
   if (o2.getSourceSite() == ProgrammeSiteType.优酷网.getValue()
       && (o2.getEpisodeCollected() == o1.getEpisodeCollected())) {
     return 1;
   }
   return o2.getEpisodeCollected() - o1.getEpisodeCollected();
 }