admin
2024-10-30 010ef2a907e66efd4702443c06cdd18f8a7ffa5b
src/main/java/com/yeshi/buwan/service/imp/StarService.java
@@ -11,18 +11,18 @@
import javax.annotation.Resource;
import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService;
import com.yeshi.buwan.service.inter.video.VideoInfoExtraService;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.orm.hibernate4.HibernateCallback;
import org.springframework.stereotype.Service;
import com.yeshi.buwan.dao.DetailSystemDao;
import com.yeshi.buwan.dao.system.DetailSystemDao;
import com.yeshi.buwan.dao.HotStarDao;
import com.yeshi.buwan.dao.SuperHotStarDao;
import com.yeshi.buwan.dao.VideoInfoDao;
import com.yeshi.buwan.domain.DetailSystem;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.HotStar;
import com.yeshi.buwan.domain.SuperHotStar;
import com.yeshi.buwan.domain.VideoInfo;
@@ -36,40 +36,16 @@
public class StarService {
    @Resource
    private HotStarDao hotStarDao;
    @Resource
    private VideoInfoDao videoInfoDao;
    @Resource
    private SuperHotStarDao superHotStarDao;
    @Resource
    private DetailSystemDao detailSystemDao;
    @Resource
    private VideoResourceMapExtraInfoService videoResourceMapExtraInfoService;
    public SuperHotStarDao getSuperHotStarDao() {
        return superHotStarDao;
    }
    public void setSuperHotStarDao(SuperHotStarDao superHotStarDao) {
        this.superHotStarDao = superHotStarDao;
    }
    public VideoInfoDao getVideoInfoDao() {
        return videoInfoDao;
    }
    public void setVideoInfoDao(VideoInfoDao videoInfoDao) {
        this.videoInfoDao = videoInfoDao;
    }
    public HotStarDao getHotStarDao() {
        return hotStarDao;
    }
    public void setHotStarDao(HotStarDao hotStarDao) {
        this.hotStarDao = hotStarDao;
    }
    private VideoInfoExtraService videoInfoExtraService;
    public StarService() {
@@ -105,22 +81,6 @@
        return hotStarDao.getCount("select count(*)  from SuperHotStar s where s.detailSystem.id=?",
                new String[]{detailSystem});
    }
    public List<VideoInfo> getHotStarVideo(String starId, int page) {
        List<VideoInfo> list = videoInfoDao.list(
                "select h.video from HotStarVideo as h LEFT JOIN h.video as v where h.video.show='1' and v.id=h.video.id and h.star.id=? order by h.video.updatetime desc",
                (page - 1) * Constant.pageCount, Constant.pageCount, new String[]{starId});
        return list;
    }
    public long getHotStarVideoCount(String starId) {
        long count = hotStarDao.getCount(
                "select count(*)  from HotStarVideo as h where h.video.show='1' and h.star.id=?",
                new String[]{starId});
        return count;
    }
    public List<HotStar> getStarList() {
@@ -207,7 +167,7 @@
            e.printStackTrace();
        }
        list = videoResourceMapExtraInfoService.batchExtraInfo(list, resourceList);
        list = videoInfoExtraService.batchExtra(list, resourceList);
        return list;
    }
@@ -239,18 +199,18 @@
    }
    @SuppressWarnings("unchecked")
    public List<HotStarAdmin> getHotStarAdmin(String key, int detailSystem, int page) {
    public List<HotStarAdmin> getHotStarAdmin(String key, String systemId, int detailSystem, int page) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        List<HotStarAdmin> zhiBoClassList = new ArrayList<>();
        try {
            List<DetailSystem> detailSystemList = detailSystemDao.list("from DetailSystem");
            List<DetailSystem> detailSystemList = detailSystemDao.list("from DetailSystem ds where ds.system.id=" + systemId);
            String sql = "";
            if (detailSystem > 0)
                sql = "select sh.hotStar from SuperHotStar sh where  sh.detailSystem.id=" + detailSystem
                        + " and sh.hotStar.name like ?  order by  sh.hotStar.orderby desc";
            else
                sql = "from HotStar zb where zb.name like ? order by zb.orderby desc";
                sql = "from HotStar zb where zb.name like ? and zb.system.id=" + systemId + " order by zb.orderby desc";
            List<HotStar> list = hotStarDao.list(sql, (page - 1) * Constant.pageCount, Constant.pageCount,
                    new Serializable[]{"%" + key + "%"});
@@ -287,7 +247,7 @@
        return zhiBoClassList;
    }
    public long getHotStarAdminCount(String key, int detailSystem) {
    public long getHotStarAdminCount(String key, String systemId, int detailSystem) {
        key = StringUtil.isNullOrEmpty(key) ? "" : key;
        String sql = "";
@@ -296,7 +256,7 @@
                    + detailSystem + " and c.name like '%" + key + "%' group by zb.hotstarid) s";
        else
            sql = "select count(*) from  (select count(*) from wk_video_hotstar zb left join wk_video_hotstar c on c.id=zb.id where c.name like '%"
                    + key + "%'  group by zb.id) s";
                    + key + "%' and zb.system=" + systemId + "  group by zb.id) s";
        return hotStarDao.getCountSQL(sql);
    }