zou_ht 8 years ago
parent
commit
9036ec6b70

File diff suppressed because it is too large
+ 810 - 1571
src/main/java/com/goafanti/common/mapper/DemandMapper.xml


+ 15 - 4
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -28,9 +28,20 @@
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
     select 
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
+    id,
+    content,
+    create_time as createTime, 
+    edit_time as editTime, 
+    title, 
+    title_img as titleImg, 
+    author, 
+    type, 
+    hot,
+    source, 
+    source_url as sourceUrl, 
+    summary,
+    jmrh_flag as jmrhFlag,
+    province_id as provinceId
     from news
     where id = #{id,jdbcType=BIGINT}
   </select>
@@ -220,7 +231,7 @@
   <select id="portalNewsList" resultType="com.goafanti.news.bo.NewsPortalList">
 		select
 			a.id,
-			a.create_time as createTime,
+			DATE_FORMAT(a.create_time,'%Y-%d-%m') as createTime,
 			a.title,
 			a.title_img as titleImg,
 			a.type,

+ 16 - 0
src/main/java/com/goafanti/common/model/News.java

@@ -18,6 +18,12 @@ public class News {
 	 * 创建时间
 	 */
 	private Date	createTime;
+	
+	/**
+	 * 创建时间
+	 */
+	private String	CreateTimeS;
+	
 
 	/**
 	 * 修改时间
@@ -203,4 +209,14 @@ public class News {
 	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
 
 	}
+
+	public String getCreateTimeS() {
+		return CreateTimeS;
+	}
+
+	public void setCreateTimeS(String createTimeS) {
+		CreateTimeS = createTimeS;
+	}
+	
+	
 }

+ 24 - 0
src/main/java/com/goafanti/news/bo/NewsPortalList.java

@@ -1,8 +1,22 @@
 package com.goafanti.news.bo;
 
+
 public class NewsPortalList extends NewsSummary {
 
 	private String	content;
+	
+	private String title;
+	
+	private String DataS;
+	
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
 
 	public String getContent() {
 		return content;
@@ -12,4 +26,14 @@ public class NewsPortalList extends NewsSummary {
 		this.content = content;
 	}
 
+	public String getDataS() {
+		return DataS;
+	}
+
+	public void setDataS(String dataS) {
+		DataS = dataS;
+	}
+	
+	
+
 }

+ 23 - 2
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -1,5 +1,6 @@
 package com.goafanti.news.controller;
 
+import java.text.SimpleDateFormat;
 import java.util.List;
 
 import javax.annotation.Resource;
@@ -17,7 +18,10 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.model.News;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.news.bo.NewsPortalList;
 import com.goafanti.news.enums.NewsType;
 import com.goafanti.news.service.NewsService;
 
@@ -98,18 +102,35 @@ public class NewsController extends BaseController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新闻ID"));
 			return res;
 		}
+		
+		/*newsService.portalNewsList(6,1, type,hot,provinceId,keyword)*/
+		
 		res.setData(newsService.findNewsDetail(id));
 		return res;
 	}
 
 	@RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
-	public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview) {
+	public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview,Long id) {
 		modelview.setViewName("/portal/news/newsDetail");
+		Pagination<NewsPortalList> newsList = newsService.portalNewsList(6,1,5,null,null,null);
+		News newsDetail = newsService.findNewsDetail(id);
+		Object news = newsList.getList().get(0);
+		SimpleDateFormat fmt =new SimpleDateFormat();
+		newsDetail.setCreateTimeS(fmt.format( newsDetail.getCreateTime()));
+		@SuppressWarnings("unchecked")
+		List<NewsPortalList> la = (List<NewsPortalList>)newsList.getList();
+		for(NewsPortalList n : la) {
+			String createTimeFormattedDate = n.getCreateTimeFormattedDate();
+			n.setDataS(createTimeFormattedDate);
+		}
+		modelview.addObject("newsDetail", newsDetail);
+		modelview.addObject("newsList", newsList.getList());
+		modelview.addObject("news", news);
 		return modelview;
 		
 	}
 
-	private void handleBanners(ModelAndView modelview, BannersType bannersType) {
+	private void handleBanners(ModelAndView modelview,  BannersType bannersType) {
 		List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
 		if (!banners.isEmpty()) {
 			modelview.addObject("banners", banners);

+ 47 - 34
src/main/webapp/WEB-INF/views/portal/news/newsDetail.html

@@ -1,47 +1,59 @@
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 
 <head th:replace="common::header(~{::title},~{::link})">
-	<title>新闻详情</title>
-	<link th:href="${portalHost + '/vendors.css'}" rel="stylesheet">
-	<link th:href="${portalHost + '/news/newsDetail.css'}" rel="stylesheet">
+<title>新闻详情</title>
+<link th:href="${portalHost + '/vendors.css'}" rel="stylesheet">
+<link th:href="${portalHost + '/thinkTank/policyDetail.css'}" rel="stylesheet">
 </head>
 
 <body>
 	<header>
-		<div th:replace="common::{topNav}"></div>
+		<div th:replace="common::nav('news','newsDetail')"></div>
 	</header>
-	<div class="header_nav_detail">
-		<div class="container ">
-			<div class="row clearfix">
-				<div class="col-md-3 logo">
-					<div th:replace="common::sublogo"></div>
+	<div id="policyDetail">
+		<div id="policy_content">
+			<div class="content_left" th:each="newsDetail:${newsDetail}">
+				<h3 th:text="${newsDetail.title}?${newsDetail.title}:''"></h3>
+				<div class="small_title">
+					<span>时间:<span th:text="${newsDetail.createTime}?${newsDetail.createTimeS}:''"></span></span>
+					<span>来源:<span th:text="${newsDetail.source}?${newsDetail.source}:行业新闻"></span></span>
 				</div>
-				<div class="col-md-9">
-					<div th:replace="common::subMenu('news','')"></div>
+				<div class="content_img">
+					<img th:src="${avatarUploadHost+newsDetail.titleImg}" alt="" />
+				</div>
+				<p  th:text="${newsDetail.content}?${newsDetail.content}:'暂无内容'">
+				</p>
+				<h5 class="text_end">文章来自:</h5>
+				<a th:href="${newsDetail.sourceUrl}?${newsDetail.sourceUrl}:'www.jishutao.com'"></a>
+				<hr />
+				<h5 >本文关键词:</h5>
+				<span>高新</span> <span>信息</span> <span>技术</span>
+				<hr />
+				<!-- <div class="next_div">
+					<span class="rf">
+						<h5>下一篇:</h5> <a href="#">科技探索</a>
+					</span> <span>
+						<h5>上一篇:</h5> <a href="#">探索科技</a>
+					</span>
+				</div> -->
+				<hr />
+				<h5>推荐文章:</h5>
+				<div th:each="news:${news}">
+				    <span th:text="${news.title}?${news.title}:'暂无更多内容'"></span>
 				</div>
 			</div>
-		</div>
-		<div class="secondary_navigation"></div>
-	</div>
-	<div th:replace="common::banners"></div>
-	<div class="banner-item" th:if="${banners==null}">
-		<img th:src="${portalHost + '/img/newsDetail_banner.jpg'}" alt="First slide">
-	</div>
-
-	<div class="container newsDetails_content">
-		<ul id="newsDetailsTab">
-			<li><a href="/portal/news/newsDetails.html?type=0">全部</a></li>
-			<li><a href="/portal/news/newsDetails.html?type=1">技淘动态</a></li>
-			<li><a href="/portal/news/newsDetails.html?type=2">政府往来</a></li>
-			<li><a href="/portal/news/newsDetails.html?type=3">科技资讯</a></li>
-			<li><a href="/portal/news/newsDetails.html?type=4">国家政策</a></li>
-			<li><a href="/portal/news/newsDetails.html?type=5">地方政策</a></li>
-		</ul>
-		<div class="newsDetail_content">
-			<h4></h4>
-			<p class="from_info">来源:<span class="from_web"></span>时间:<span class="from_date"></span></p>
-			<div id="content_container">
+			<div class="contetn_right" >
+				<div class="right_title">
+					<div>热点资讯</div>
+				</div>
+				<div th:each="newsList:${newsList}">
+					<h5 ><a th:href="@{/portal/news/newsDetail(id=${newsList.id})}"  th:text="${newsList.title}?${newsList.title}:''"></a></h5>
+					 <!-- <img th:src="${avatarUploadHost+newsDetail.titleImg}" alt="" /> -->
+					<p th:text="${newsList.createTime}?${newsList.DataS}:''"></p>
+				</div>
 			</div>
 		</div>
 	</div>
@@ -50,7 +62,8 @@
 	</footer>
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
-		<script type="text/javascript" th:src="${portalHost + '/news/newsDetail.js'}"></script>
+		<script type="text/javascript"
+			th:src="${portalHost + '/thinkTank/policyDetail.js'}"></script>
 	</div>
 </body>