Просмотр исходного кода

Merge branch 'master' of https://git.coding.net/aft/AFT.git

albertshaw лет назад: 8
Родитель
Сommit
9074816057

+ 3 - 0
src/main/java/com/goafanti/common/dao/LectureMapper.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.dao;
 
 import java.util.List;
+import java.util.Map;
 
 import com.goafanti.common.model.Lecture;
 import com.goafanti.lecture.bo.BigShotLectureListBo;
@@ -32,4 +33,6 @@ public interface LectureMapper {
 	List<BigShotLectureListBo> listBigShotLecture();
 
 	List<LectureListBo> findLectureList();
+
+	List<LectureListBo> findMoreLectureList(Map<String, Object> params);
 }

+ 4 - 11
src/main/java/com/goafanti/common/mapper/LectureMapper.xml

@@ -333,7 +333,7 @@
 	  	limit 0 , 5
   </select>
   
-  <select id="findMoreLectureListByPage" parameterType="String" resultType="com.goafanti.lecture.bo.LectureListBo">
+  <select id="findMoreLectureList"  resultType="com.goafanti.lecture.bo.LectureListBo">
 	  	select 
 	  		l.id,
 	  		l.uid,
@@ -350,17 +350,10 @@
 	  	where 
 	  	l.deleted_sign = 0 
 	  	order by l.lecture_time desc
-	  	<if test="page_sql!=null">
-			${page_sql}
+	   <if test="pageNo != null and pageSize != null">
+		limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
 		</if>
   </select>
   
-  <select id="findMoreLectureCount" parameterType="String" resultType="java.lang.Integer">
-  		select 
-	  		count(1)
-	  	from lecture l
-	  	left join  user_identity ui on ui.uid = l.uid
-	  	where 
-	  	l.deleted_sign = 0 
-  </select>
+  
 </mapper>

+ 4 - 0
src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java

@@ -16,6 +16,10 @@ public class FastJsonRedisSerializer implements RedisSerializer<Object> {
 		pc.addAccept("com.goafanti.common.model.News");
 		pc.addAccept("com.goafanti.news.bo.NewsSummary");
 		pc.addAccept("com.goafanti.common.model.Banners");
+		pc.addAccept("com.goafanti.common.model.EngagedFieldGlossory");
+		pc.addAccept("com.goafanti.star.bo.BigShotStarListBo");
+		pc.addAccept("com.goafanti.lecture.bo.LectureListBo");
+		pc.addAccept("com.goafanti.lecture.bo.BigShotLectureListBo");
 	}
 
 	@Override

+ 1 - 1
src/main/java/com/goafanti/lecture/service/LectureService.java

@@ -30,7 +30,7 @@ public interface LectureService {
 
 	List<LectureListBo> findLectureList(Integer lectureListCacheKey);
 
-	Pagination<LectureListBo> loadMore(Integer pSize, Integer pNo);
+	List<LectureListBo> loadMore(Integer pSize, Integer pNo);
 
 	void clearBigShotLectureList(Integer bigShotLectureCacheKey);
 

+ 11 - 8
src/main/java/com/goafanti/lecture/service/impl/LectureServiceImpl.java

@@ -12,6 +12,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.constant.AFTConstants;
@@ -121,7 +122,7 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 	}
 
 	@Override
-	//@Cacheable(value = "LectureDynamicListCache", key = "'LectureDynamicList:'+#lectureDynamicListCacheKey")
+	@Cacheable(value = "LectureDynamicListCache", key = "'LectureDynamicList:'+#lectureDynamicListCacheKey")
 	public List<LectureListBo> listDynamic(Integer lectureDynamicListCacheKey) {
 		return lectureMapper.listDynamic();
 	}
@@ -133,7 +134,7 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 	}
 
 	@Override
-	//@Cacheable(value = "BigShotLectureListCache", key = "'BigShotLectureList:'+#bigShotLectureCacheKey")
+	@Cacheable(value = "BigShotLectureListCache", key = "'BigShotLectureList:'+#bigShotLectureCacheKey")
 	public List<BigShotLectureListBo> listBigShotLecture(Integer bigShotLectureCacheKey) {
 		return lectureMapper.listBigShotLecture();
 	}
@@ -145,7 +146,7 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 	}
 
 	@Override
-	//@Cacheable(value = "LectureListCache", key = "'LectureList:'+#lectureListCacheKey")
+	@Cacheable(value = "LectureListCache", key = "'LectureList:'+#lectureListCacheKey")
 	public List<LectureListBo> findLectureList(Integer lectureListCacheKey) {
 		return lectureMapper.findLectureList();
 	}
@@ -156,18 +157,20 @@ public class LectureServiceImpl extends BaseMybatisDao<LectureMapper> implements
 		LoggerUtils.debug(logger, "清除科技讲堂列表缓存:[%s]", lectureListCacheKey);
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<LectureListBo> loadMore(Integer pageSize, Integer pageNo) {
+	public List<LectureListBo> loadMore(Integer pageSize, Integer pageNo) {
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 2;
 		}
 
-		if (pageSize == null || pageSize < 0 || pageSize > 5) {
+		if (pageSize == null || pageSize < 0 || pageSize > 10) {
 			pageSize = 10;
 		}
-		return (Pagination<LectureListBo>) findPage("findMoreLectureListByPage", "findMoreLectureCount", null, pageNo,
-				pageSize);
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("pageSize", pageSize);
+		params.put("pageNo", pageNo);
+		return lectureMapper.findMoreLectureList(params);
+		
 	}
 
 	

+ 2 - 1
src/main/java/com/goafanti/star/service/impl/StarServiceImpl.java

@@ -9,6 +9,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.StarMapper;
@@ -66,7 +67,7 @@ public class StarServiceImpl implements StarService {
 	}
 
 	@Override
-	//@Cacheable(value = "BigShotStarListCache", key = "'BigShotStarList:'+#bigShotStarCacheKey")
+	@Cacheable(value = "BigShotStarListCache", key = "'BigShotStarList:'+#bigShotStarCacheKey")
 	public List<BigShotStarListBo> listBigShotStar(Integer bigShotStarCacheKey) {
 		return starMapper.listBigShotStar();
 	}

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/scienceTechnology/lecture.html


+ 3 - 3
src/main/webapp/WEB-INF/views/portal/scienceTechnology/star.html

@@ -137,7 +137,7 @@
 						<ul th:each="lectureDynamic,iterStart:${lectureDynamicList}">
 							<li th:text="${lectureDynamic.username}"><a href='#'>· 袁隆平取得重大突破</a></li>
 							<li th:text="${lectureDynamic.name}"><a href='#'>· 周凌宇举办科技成果发布会</a></li>
-							<li th:text="${lectureDynamic.lectureTime}"><a href='#'>· 中国科交会</a></li>
+							<li th:text="${lectureDynamic.lectureTimeFormattedDate}"><a href='#'>· 中国科交会</a></li>
 						</ul>
 					</div>
 					<div id="active_notice_ul2"></div>
@@ -166,8 +166,8 @@
 						<!--<a href="#" class="start">邀请开讲</a>-->
 						<p th:text="${star.workUnit}">中南大学湘雅二医院</p>
 						<p th:text="${star.engagedField}">精神病学 精神卫生学 生物精神病学</p>
-						<p class="mt25"><label>技术: </label> <span class="red" th:text="${star.achievementNum}">4</span></p>
-						<p><label>粉丝: </label> <span class="red" th:text="${star.fansNum}">654</span></p>
+						<p class="mt25"><label>技术: </label> <span class="red" th:text="${star.achievementNum}">4</span></p>
+						<p><label>粉丝: </label> <span class="red" th:text="${star.fansNum}">654</span></p>
 					</div>
 				</li>
 			</ul>