Antiloveg 8 years ago
parent
commit
857f75b1e5

+ 2 - 4
src/main/java/com/goafanti/activity/service/impl/ActivityServiceImpl.java

@@ -1,12 +1,10 @@
 package com.goafanti.activity.service.impl;
 
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.activity.service.ActivityService;
-import com.goafanti.common.dao.ActivityMapper;
 @Service
 public class ActivityServiceImpl implements ActivityService {
-	@Autowired
-	private ActivityMapper activityMapper;
+	/*@Autowired
+	private ActivityMapper activityMapper;*/
 }

+ 3 - 3
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -350,11 +350,11 @@ public class WebpageController extends BaseController {
 	}
 
 	/**
-	 * 新闻页
+	 * 新闻详情(非列表页)
 	 */
-	@RequestMapping(value = "/portal/news", method = RequestMethod.GET)
+	@RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
 	public ModelAndView portalNews(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/portal/news");
+		modelview.setViewName("/portal/news/newsDetail");
 		return modelview;
 	}
 

+ 5 - 0
src/main/java/com/goafanti/common/dao/StarMapper.java

@@ -3,6 +3,7 @@ package com.goafanti.common.dao;
 import java.util.List;
 
 import com.goafanti.common.model.Star;
+import com.goafanti.star.bo.BigShotStarInterest;
 import com.goafanti.star.bo.BigShotStarListBo;
 import com.goafanti.star.bo.HotStarListBo;
 
@@ -28,4 +29,8 @@ public interface StarMapper {
 	void insertBatch(List<Star> startList);
 
 	List<BigShotStarListBo> listBigShotStar();
+
+	List<BigShotStarInterest> findBigShotInterestStatus(String uid);
+
+	List<BigShotStarInterest> findStarInterestStatus(String uid);
 }

+ 23 - 0
src/main/java/com/goafanti/common/mapper/StarMapper.xml

@@ -106,6 +106,7 @@
   	left join user_career uc on uc.uid = s.uid
   	left join achievement_demand_count adc on adc.uid = s.uid 
   	where s.hot = 1 and ui.celebrity = 1
+  	order by adc.achievement_count desc
   </select>
   
   <select id="listStarList"  parameterType="java.lang.String" resultType="com.goafanti.star.bo.HotStarListBo">
@@ -126,6 +127,7 @@
   	left join user_info info on info.uid = s.uid
   	left join user_interest interest on interest.to_uid = s.uid and interest.from_uid = #{uid,jdbcType=VARCHAR}
   	where s.star = 1 and ui.celebrity = 1
+  	order by adc.achievement_count desc
   </select>
   
   <delete id="deleteAll">
@@ -160,5 +162,26 @@
   	left join user_career uc on uc.uid = s.uid
   	left join achievement_demand_count adc on adc.uid = s.uid 
   	where s.hot = 1 
+  	order by adc.achievement_count desc
+  </select>
+  
+  <select id="findBigShotInterestStatus" parameterType="java.lang.String" resultType="com.goafanti.star.bo.BigShotStarInterest">
+  	select
+  		ui.id as interestId,
+  		s.uid as fromUid,
+  		ui.to_uid as toUid
+  	from star s
+  	left join user_interest ui on s.uid = ui.to_uid and ui.from_uid = #{uid,jdbcType=VARCHAR} 
+  	where  s.hot = 1 
+  </select>
+  
+  <select id="findStarInterestStatus" parameterType="java.lang.String" resultType="com.goafanti.star.bo.BigShotStarInterest">
+  	select
+  		ui.id as interestId,
+  		s.uid as fromUid,
+  		ui.to_uid as toUid
+  	from star s
+  	left join user_interest ui on s.uid = ui.to_uid and ui.from_uid = #{uid,jdbcType=VARCHAR} 
+  	where  s.star = 1 
   </select>
 </mapper>

+ 1 - 0
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -103,4 +103,5 @@ public class NewsController extends BaseController {
 		res.setData(newsService.findNewsDetail(id));
 		return res;
 	}
+	
 }

+ 7 - 1
src/main/java/com/goafanti/portal/controller/PortalBigShotController.java

@@ -13,6 +13,8 @@ import org.springframework.web.servlet.ModelAndView;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
+import com.goafanti.common.model.User;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.engagedFieldGlossory.service.EngagedFieldGlossoryService;
 import com.goafanti.lecture.bo.BigShotLectureListBo;
 import com.goafanti.lecture.service.LectureService;
@@ -67,10 +69,14 @@ public class PortalBigShotController extends BaseController {
 	}
 	
 	/**
-	 * 关注
+	 * 关注状态
 	 */
+	@RequestMapping(value = "/portal/scienceTechnology/bigShot/interestStatus", method = RequestMethod.GET)
 	public Result interestStatus(){
 		Result res = new Result();
+		if (TokenManager.getToken() instanceof User){
+			res.setData(starService.findBigShotInterestStatus(TokenManager.getUserId()));
+		}
 		return res;
 	}
 

+ 16 - 2
src/main/java/com/goafanti/portal/controller/PortalStarController.java

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.User;
@@ -35,13 +36,14 @@ public class PortalStarController extends BaseController {
 	@Resource
 	private EngagedFieldGlossoryService	engagedFieldGlossoryService;
 
-	 @RequestMapping(value = "/portal/scienceTechnology/star", method = RequestMethod.GET)
+	@RequestMapping(value = "/portal/scienceTechnology/star", method = RequestMethod.GET)
 	public ModelAndView star() {
 		ModelAndView mv = new ModelAndView();
 		List<LectureListBo> lectureDynamicList = lectureService
 				.listDynamic(AFTConstants.LECTURE_DYNAMIC_LIST_CACHE_KEY);
 		mv.addObject("lectureDynamicList", lectureDynamicList);
-		List<HotStarListBo> starList = starService.listStarList(TokenManager.getToken() instanceof User ? TokenManager.getUserId() : null);
+		List<HotStarListBo> starList = starService
+				.listStarList(TokenManager.getToken() instanceof User ? TokenManager.getUserId() : null);
 		if (null != starList && starList.size() > 0) {
 			for (HotStarListBo bo : starList) {
 				if (StringUtils.isNotBlank(bo.getUid())) {
@@ -66,4 +68,16 @@ public class PortalStarController extends BaseController {
 		mv.setViewName("/portal/scienceTechnology/star");
 		return mv;
 	}
+
+	/**
+	 * 当前用户关注"科技明星"页面科技明星状态
+	 */
+	@RequestMapping(value = "/portal/scienceTechnology/star/interestStatus", method = RequestMethod.GET)
+	public Result interestStatus() {
+		Result res = new Result();
+		if (TokenManager.getToken() instanceof User) {
+			res.setData(starService.findStarInterestStatus(TokenManager.getUserId()));
+		}
+		return res;
+	}
 }

+ 34 - 0
src/main/java/com/goafanti/star/bo/BigShotStarInterest.java

@@ -0,0 +1,34 @@
+package com.goafanti.star.bo;
+
+public class BigShotStarInterest {
+	private String	interestId;
+
+	private String	fromUid;
+
+	private String	toUid;
+
+	public String getInterestId() {
+		return interestId;
+	}
+
+	public void setInterestId(String interestId) {
+		this.interestId = interestId;
+	}
+
+	public String getFromUid() {
+		return fromUid;
+	}
+
+	public void setFromUid(String fromUid) {
+		this.fromUid = fromUid;
+	}
+
+	public String getToUid() {
+		return toUid;
+	}
+
+	public void setToUid(String toUid) {
+		this.toUid = toUid;
+	}
+
+}

+ 5 - 0
src/main/java/com/goafanti/star/service/StarService.java

@@ -3,6 +3,7 @@ package com.goafanti.star.service;
 import java.util.List;
 
 import com.goafanti.common.model.Star;
+import com.goafanti.star.bo.BigShotStarInterest;
 import com.goafanti.star.bo.BigShotStarListBo;
 import com.goafanti.star.bo.HotStarListBo;
 
@@ -18,6 +19,10 @@ public interface StarService {
 	public List<BigShotStarListBo> listBigShotStar(Integer bigShotStarCacheKey);
 	
 	public void clearBigShotStarList(Integer bigShotStarCacheKey);
+
+	List<BigShotStarInterest> findBigShotInterestStatus(String uid);
+
+	List<BigShotStarInterest> findStarInterestStatus(String userId);
 	
 	
 

+ 11 - 0
src/main/java/com/goafanti/star/service/impl/StarServiceImpl.java

@@ -15,6 +15,7 @@ import com.goafanti.common.enums.StarHotType;
 import com.goafanti.common.enums.StarType;
 import com.goafanti.common.model.Star;
 import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.star.bo.BigShotStarInterest;
 import com.goafanti.star.bo.BigShotStarListBo;
 import com.goafanti.star.bo.HotStarListBo;
 import com.goafanti.star.service.StarService;
@@ -70,4 +71,14 @@ public class StarServiceImpl implements StarService {
 		LoggerUtils.debug(logger, "清除大咖说科技明星列表缓存:[%s]", bigShotStarCacheKey);
 	}
 
+	@Override
+	public List<BigShotStarInterest> findBigShotInterestStatus(String uid) {
+		return starMapper.findBigShotInterestStatus(uid);
+	}
+
+	@Override
+	public List<BigShotStarInterest> findStarInterestStatus(String uid) {
+		return starMapper.findStarInterestStatus(uid);
+	}
+
 }

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/detail/achievementDetail.html

@@ -146,8 +146,8 @@
 		</div>
 	</div>
 
-	<input type="hidden" id="achievementId" th:value=${achievement.id}>
-	<input type="hidden" id="interestId" th:value=${achievement.interestId}>
+	<input type="hidden" id="achievementId" th:value="${achievement.id}">
+	<input type="hidden" id="interestId" th:value="${achievement.interestId}">
 
 	<div class="modal fade" tabindex="-1" role="dialog" id="order"
 		aria-labelledby="myModalLabel">

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/detail/demandDetail.html

@@ -136,8 +136,8 @@
 		</ul>
 	</div>
 
-	<input type="hidden" id="demandId" th:value=${demand.id}>
-	<input type="hidden" id="interestId" th:value=${demand.interestId}>
+	<input type="hidden" id="demandId" th:value="${demand.id}">
+	<input type="hidden" id="interestId" th:value="${demand.interestId}">
 
 	<div class="modal fade" tabindex="-1" role="dialog" id="order"
 		aria-labelledby="myModalLabel">

+ 16 - 0
src/main/webapp/WEB-INF/views/portal/news/newsDetail.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org">
+<head th:replace="common::header(~{::title},~{::link})">
+	<title>新闻详情</title>
+	<link th:href="${staticHost+'/portal/news/newsDetail.css'}" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/portal/news/newsDetail.css'}"></script>
+	</div>
+</body>
+</html>

+ 9 - 8
src/main/webapp/WEB-INF/views/portal/scienceTechnology/bigShot.html

@@ -61,16 +61,17 @@
 						<img th:if="${star.personPortraitUrl!=null && star.personPortraitUrl!=''}" th:src="${avatarUploadHost + star.personPortraitUrl}">
 						<a href="#" class="interest-star">
                             <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-                            <input type="hidden" id="interestId" th:value=${star.interestId}>
+                            <input type="hidden" id="interestId" th:value="${star.interestId}">
+                            <input type="hidden" id="uid" th:value="${star.uid}">
                             关注
                         </a>
 					</div>
 					<div class="star_content_info">
-						<h4 th:text="${star.username}" th:title="${star.username}">陈政清</h4>
-						<h5 th:text="${star.workUnit}" th:title="${star.workUnit}">湖南大学 土木工程学院</h5>
-						<h5 th:text="${star.professionalTitle}" th:title="${star.professionalTitle}">“985”工程首席科学家</h5>
-						<p class="mt20"><label>技术:</label> <span class="red" th:text="${star.achievementNum}">4</span>项</p>
-						<p><label>粉丝:</label> <span class="red" th:text="${star.fansNum}">456</span>人</p>
+						<h4 th:text="${star.username}" th:title="${star.username}"></h4>
+						<h5 th:text="${star.workUnit}" th:title="${star.workUnit}"></h5>
+						<h5 th:text="${star.professionalTitle}" th:title="${star.professionalTitle}"></h5>
+						<p class="mt20"><label>技术:</label> <span class="red" th:text="${star.achievementNum}"></span>项</p>
+						<p><label>粉丝:</label> <span class="red" th:text="${star.fansNum}"></span>人</p>
 					</div>
 				</li>
 			</ul>
@@ -108,8 +109,8 @@
 						<img th:if="${lecture.lectureUrl != null && lecture.lectureUrl != ''}" th:src="${avatarUploadHost + lecture.lectureUrl}">
 					</div>
 					<div class="lecture_content_info">
-						<h5 th:text="${lecture.name}" th:title="${lecture.name}">科技成果转化项目开展讲座</h5>
-						<p class="mt20" th:text="${lecture.lectureTimeFormattedDate}" th:title="${lecture.lectureTimeFormattedDate}">2017-06-30</p>
+						<h5 th:text="${lecture.name}" th:title="${lecture.name}"></h5>
+						<p class="mt20" th:text="${lecture.lectureTimeFormattedDate}" th:title="${lecture.lectureTimeFormattedDate}"></p>
 						<a href="#" class="customer-service">报名中</a>
 					</div>
 				</li>

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

@@ -136,9 +136,9 @@
 				<div class="qimo">
 					<div id="active_notice_ul1">
 						<ul th:each="lectureDynamic,iterStart:${lectureDynamicList}">
-							<li th:text="${lectureDynamic.username}" th:title="${lectureDynamic.username}"><a href='#'>· 袁隆平取得重大突破</a></li>
-							<li th:text="${lectureDynamic.name}" th:title="${lectureDynamic.name}"><a href='#'>· 周凌宇举办科技成果发布会</a></li>
-							<li th:text="${lectureDynamic.lectureTimeFormattedDate}" th:title="${lectureDynamic.lectureTimeFormattedDate}"><a href='#'>· 中国科交会</a></li>
+							<li th:text="${lectureDynamic.username}" th:title="${lectureDynamic.username}"><a href='#'></a></li>
+							<li th:text="${lectureDynamic.name}" th:title="${lectureDynamic.name}"><a href='#'></a></li>
+							<li th:text="${lectureDynamic.lectureTimeFormattedDate}" th:title="${lectureDynamic.lectureTimeFormattedDate}"><a href='#'></a></li>
 						</ul>
 					</div>
 					<div id="active_notice_ul2"></div>
@@ -159,17 +159,18 @@
 						<img th:if="${star.personPortraitUrl} != null" th:src="${avatarUploadHost + star.personPortraitUrl}">
 						<a href="#" class="interest-star">
                             <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-                            <input type="hidden" id="interestId" th:value=${star.interestId}>
+                            <input type="hidden" id="interestId" th:value="${star.interestId}">
+                            <input type="hidden" id="uid" th:value="${star.uid}">
                             关注
                         </a>
 					</div>
 					<div class="expert_content_info">
-						<h4 th:text="${star.username}" th:title="${star.username}">薛志敏</h4>
+						<h4 th:text="${star.username}" th:title="${star.username}"></h4>
 						<!--<a href="#" class="start">邀请开讲</a>-->
-						<p th:text="${star.workUnit}" th:title="${star.workUnit}">中南大学湘雅二医院</p>
-						<p th:text="${star.engagedField}" th:title="${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 th:text="${star.workUnit}" th:title="${star.workUnit}"></p>
+						<p th:text="${star.engagedField}" th:title="${star.engagedField}"></p>
+						<p class="mt25"><label>技术: </label> <span class="red" th:text="${star.achievementNum}"></span>项</p>
+						<p><label>粉丝: </label> <span class="red" th:text="${star.fansNum}"></span>个</p>
 					</div>
 				</li>
 			</ul>