From 7804263c6061aef813f0db27cb3046f746572606 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 06 三月 2021 16:07:26 +0800
Subject: [PATCH] 后台管理优化

---
 src/main/java/com/yeshi/buwan/service/imp/ClassService.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/service/imp/ClassService.java b/src/main/java/com/yeshi/buwan/service/imp/ClassService.java
index 4c94e05..7d0ce5d 100644
--- a/src/main/java/com/yeshi/buwan/service/imp/ClassService.java
+++ b/src/main/java/com/yeshi/buwan/service/imp/ClassService.java
@@ -7,6 +7,7 @@
 import javax.annotation.Resource;
 
 import com.yeshi.buwan.service.inter.VideoResourceMapExtraInfoService;
+import com.yeshi.buwan.service.inter.video.VideoInfoExtraService;
 import org.hibernate.CacheMode;
 import org.hibernate.HibernateException;
 import org.hibernate.Session;
@@ -36,8 +37,9 @@
     private VideoInfoDao videoInfoDao;
     @Resource
     private SuperVideoTypeDao superVideoTypeDao;
+
     @Resource
-    private VideoResourceMapExtraInfoService videoResourceMapExtraInfoService;
+    private VideoInfoExtraService videoInfoExtraService;
 
     public List<VideoType> getTypeList() {
         List<VideoType> list = videoTypeDao.list("from VideoType v where v.show='1' and v.parent=null");
@@ -234,7 +236,7 @@
         if (StringUtil.isNullOrEmpty(type)) {
             return getVideoInfoData(videoInfoDao.sqlList(
                     "select v.id,v.`name`,v.`tag`,v.`picture`,v.`hpicture`,v.`latest_hpicture`,v.watchcount,v.commentcount from wk_video_video v INNER JOIN  (SELECT  DISTINCT(v.id) FROM wk_category_video ca LEFT JOIN wk_video_video v ON v.id= ca.videoid LEFT JOIN wk_resource_video rv ON rv.`videoid`= v.`id`  AND( ? ) WHERE v.show= 1 and ca.id is not null AND rv.`resourceid` IS NOT NULL ? ) a using(id)",
-                    (page - 1) * pageCount, pageCount, new Serializable[]{resourceWhere, orderby,}),resourceList);
+                    (page - 1) * pageCount, pageCount, new Serializable[]{resourceWhere, orderby,}), resourceList);
         }
 
         List<VideoInfo> list = new ArrayList<VideoInfo>();
@@ -264,7 +266,7 @@
         });
 
         System.out.println("鏌ヨSQL璐规椂:" + (System.currentTimeMillis() - startTime));
-        return getVideoInfoData(list,resourceList);
+        return getVideoInfoData(list, resourceList);
     }
 
     public List<VideoInfo> getVideoInfoData(List list, List<Long> resourceIdList) {
@@ -293,7 +295,7 @@
             dataList.add(info);
         }
 
-        dataList = videoResourceMapExtraInfoService.batchExtraInfo(dataList, resourceIdList);
+        dataList = videoInfoExtraService.batchExtra(dataList, resourceIdList);
 
         return dataList;
     }
@@ -579,7 +581,7 @@
      */
 
     @SuppressWarnings("unchecked")
-    public List<com.yeshi.buwan.domain.web.VideoTypeAdmin> getVideoTypeAdmin(final int detailSystem, final int pid,
+    public List<com.yeshi.buwan.domain.web.VideoTypeAdmin> getVideoTypeAdmin(final String systemId, final int detailSystem, final int pid,
                                                                              final int page) {
         return (List<com.yeshi.buwan.domain.web.VideoTypeAdmin>) videoTypeDao
                 .excute(new HibernateCallback<List<com.yeshi.buwan.domain.web.VideoTypeAdmin>>() {
@@ -587,7 +589,7 @@
                             throws HibernateException {
                         List<com.yeshi.buwan.domain.web.VideoTypeAdmin> hotTypeList = new ArrayList<com.yeshi.buwan.domain.web.VideoTypeAdmin>();
                         try {
-                            List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem").list();
+                            List<DetailSystem> detailSystemList = session.createQuery("from DetailSystem ds where ds.system.id=" + systemId).list();
                             String where = "";
 
                             List<VideoType> list = null;

--
Gitblit v1.8.0