Quellcode durchsuchen

新闻显示发布时间调整

anderx vor 3 Jahren
Ursprung
Commit
c3d8957c4e

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

@@ -15,31 +15,31 @@
     <result column="summary" jdbcType="VARCHAR" property="summary" />
     <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
     <result column="province_id" jdbcType="INTEGER" property="provinceId" />
-    <result column="keyword" jdbcType="VARCHAR" property="keyword" /> 
+    <result column="keyword" jdbcType="VARCHAR" property="keyword" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.News">
     <result column="content" jdbcType="LONGVARCHAR" property="content" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, create_time, edit_time, title, title_img, author, type, hot, source, source_url, 
+    id, create_time, edit_time, title, title_img, author, type, hot, source, source_url,
     summary,jmrh_flag,province_id,keyword
   </sql>
   <sql id="Blob_Column_List">
     content
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultType="com.goafanti.news.bo.NewsResult">
-    select 
+    select
     n.id,
     n.content,
-    n.create_time as createTime, 
-    n.edit_time as editTime, 
-    n.title, 
-    n.title_img as titleImg, 
-    n.author, 
-    n.type, 
+    n.create_time as createTime,
+    n.edit_time as editTime,
+    n.title,
+    n.title_img as titleImg,
+    n.author,
+    n.type,
     n.hot,
-    n.source, 
-    n.source_url as sourceUrl, 
+    n.source,
+    n.source_url as sourceUrl,
     n.summary,
     n.province_id as provinceId,
     n.audit_status as auditStatus,
@@ -56,14 +56,14 @@
     where id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.News">
-    insert into news (id, create_time, edit_time, 
-      title, title_img, author, 
-      type, hot, source, 
+    insert into news (id, create_time, edit_time,
+      title, title_img, author,
+      type, hot, source,
       source_url, summary, content,province_id,top_number,hotspot,audit_status,release_status,release_date,keyword
       )
-    values (#{id,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP}, 
-      #{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, 
-      #{type,jdbcType=INTEGER}, #{hot,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP},
+      #{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
+      #{type,jdbcType=INTEGER}, #{hot,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR},
       #{sourceUrl,jdbcType=VARCHAR}, #{summary,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR},
       #{provinceId,jdbcType=INTEGER}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER},#{auditStatus,jdbcType=INTEGER},
       #{releaseStatus,jdbcType=INTEGER},#{releaseDate,jdbcType=TIMESTAMP},#{keyword,jdbcType=VARCHAR}
@@ -276,38 +276,38 @@
 			a.summary,
 			a.source,
 			a.content,
-			release_date as releaseDate
+            DATE_FORMAT(a.release_date,'%Y-%m-%d')  as releaseDate
 		from news a
 		where 1=1
-		 and (a.type = 0 or a.type = 99 or a.type =98) 
+		 and (a.type = 0 or a.type = 99 or a.type =98)
 		<if test="provinceId != null">
 			and a.province_id = #{provinceId,jdbcType=INTEGER}
 		</if>
 		<if test="type != null" >
 			and a.type = #{type,jdbcType=INTEGER}
 		</if>
-		<!-- 
+		<!--
 		<if test="hot != null">
 			and a.hot = #{hot,jdbcType=INTEGER}
-		</if> 
+		</if>
 		-->
 		<if test="keyword != null">
 			and a.title like concat('%',#{keyword},'%')
 		</if>
 		<if test="auditStatus!=null">
 		and a.audit_status=#{auditStatus,jdbcType=INTEGER}
-		</if>	
+		</if>
 		order by release_date desc
 		<if test="page_sql != null">
 			${page_sql}
 		</if>
 	</select>
-	
+
 	<select id="portalNewsCount" resultType="java.lang.Integer">
-		select 
+		select
 			count(0)
 		from news a
-		where 
+		where
 		(a.type = 0 or a.type = 99 or a.type =98)
 		<if test="provinceId != null">
 			and a.province_id = #{provinceId,jdbcType=INTEGER}
@@ -315,7 +315,7 @@
 		<if test="type != null and type != 0 and type != 1 and type != 2" >
 			and a.type = #{type,jdbcType=INTEGER}
 		</if>
-		<!-- 	
+		<!--
 		<if test="hot != null">
 			and a.hot = #{hot,jdbcType=INTEGER}
 		</if>
@@ -325,7 +325,7 @@
 		</if>
 		<if test="auditStatus!=null">
 		and a.audit_status=#{auditStatus,jdbcType=INTEGER}
-		</if>	
+		</if>
 	</select>
 	<select id="portalNewsPolicy" resultType="com.goafanti.news.bo.NewsPortalList">
 		select
@@ -366,9 +366,9 @@
 	LEFT  join news n on ni.new_id=n.id
 	where uid=#{uid,jdbcType=VARCHAR}
 	</select>
-	
-	
-	
+
+
+
 <select id="getNewsList" resultType="com.goafanti.common.model.News">
 select
 	title,
@@ -378,17 +378,17 @@ from
 	news
 order by
 	create_time desc limit #{0}
-</select>	
+</select>
 <select id="getPolicyDetail" resultType="com.goafanti.common.bo.PolicyEntity">
 select p.id,p.title,p.title_img as titleImg,p.summary,
-p.content,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p 
+p.content,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p
 left join district_glossory dg1 on dg1.id=p.province
 left join district_glossory dg2 on dg2.id=p.city
 where audit_status = 2 and p.id=#{0}
 </select>
 
-	
-	
+
+
 	<select id="selectTypeNewsList" resultType="com.goafanti.app.bo.AppDiscoveryBo">
 		select
 			a.id,
@@ -399,7 +399,7 @@ where audit_status = 2 and p.id=#{0}
 		from news a
 		left join district_glossory d on a.province_id=d.id
 		where audit_status=2
-		<if test="type != null"> 
+		<if test="type != null">
 		and a.type =#{type}
 		</if>
 		order by a.release_date desc
@@ -407,17 +407,17 @@ where audit_status = 2 and p.id=#{0}
 			${page_sql}
 		</if>
 	</select>
-	
+
 	<select id="selectTypeNewsCount" resultType="java.lang.Integer">
-		select 
+		select
 			count(0)
 		from news a
 		left join district_glossory d on a.province_id=d.id
-		where audit_status=2 
-		<if test="type != null"> 
+		where audit_status=2
+		<if test="type != null">
 		and a.type =#{type}
 		</if>
 	</select>
 
 
-</mapper>
+</mapper>

+ 18 - 6
src/main/java/com/goafanti/news/bo/NewsPortalList.java

@@ -4,9 +4,9 @@ package com.goafanti.news.bo;
 public class NewsPortalList extends NewsSummary {
 
 	private String	content;
-	
+
 	private String title;
-	
+
 	private String DataS;
 
 	private String source;
@@ -14,11 +14,23 @@ public class NewsPortalList extends NewsSummary {
 	 * 置顶
 	 */
 	private Integer topNumber;
-	
+
 	/**
 	 * 热门
 	 */
 	private Integer hotspot;
+	/**
+	 * 发布时间
+	 */
+	private String releaseDate;
+
+	public String getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(String releaseDate) {
+		this.releaseDate = releaseDate;
+	}
 
 	public String getTitle() {
 		return title;
@@ -35,7 +47,7 @@ public class NewsPortalList extends NewsSummary {
 	public void setContent(String content) {
 		this.content = content;
 	}
-	
+
 	public String getSource() {
 		return source;
 	}
@@ -67,7 +79,7 @@ public class NewsPortalList extends NewsSummary {
 	public void setHotspot(Integer hotspot) {
 		this.hotspot = hotspot;
 	}
-	
-	
+
+
 
 }

+ 3 - 11
src/main/java/com/goafanti/news/bo/NewsSummary.java

@@ -43,17 +43,17 @@ public class NewsSummary {
 	 * 简介
 	 */
 	private String	summary;
-	
+
 	/**
 	 * 来源
 	 */
 	private String	source;
-	
+
 	/**
 	 * 审核状态
 	 */
 	private Integer auditStatus;
-	
+
 	/**
 	 * 是否发布
 	 */
@@ -161,14 +161,6 @@ public class NewsSummary {
 		}
 	}
 
-	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
-
-	}
-	public void setCreateTimeFormattedDate_md(String createTimeFormattedDate) {
-
-	}
-	public void setCreateTimeFormattedDate_y(String createTimeFormattedDate) {
 
-	}
 
 }

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -38,7 +38,7 @@ app.name=AFT
 app.mobile.website=http://m.jishutao.com/1.0/template/index.html
 template.cacheable=false
 
-static.host=//ss.jishutao.com/client/1.2.7
+static.host=//ss.jishutao.com/client/1.2.8
 portal.host=//ss.jishutao.com/portal/1.2.11
 skjt.host=//ss.jishutao.com/skjt/1.3
 

+ 7 - 7
src/main/webapp/WEB-INF/views/portal/thinkTank/policyList.html

@@ -40,11 +40,11 @@
 					<li value='99'>技淘观点</li>
 					<li value='98'>知产百科</li>
 				</ol>
-			</div>	
+			</div>
 			<div class="area">
 				<p>地区</p>
 				<ol>
-					
+
 				</ol>
 				<span class="more">更多+</span>
 			</div>
@@ -52,7 +52,7 @@
 		<div class="listContent">
 			<div class="newLsit">
 				<ul>
-					
+
 				</ul>
 				<div class="pagination_box">
 					<nav aria-label="Page navigation" class="clearfix">
@@ -82,9 +82,9 @@
   					<li th:each="news:${newsList}">
   						<a th:href="@{/portal/news/newsDetail(id=${news.id})}">
    						<p th:text="${#strings.abbreviate(news.title,18)}"></p>
-   						<time th:text="${news.createTimeFormattedDate}"></time>
+   						<time th:text="${news.releaseDate}"></time>
   						</a>
-  					</li>     					
+  					</li>
     			</ul>
 			</div>
 		</div>
@@ -92,7 +92,7 @@
   	<!--主体内容区域结束-->
 	<footer>
 		<div th:replace="common::copyright"></div>
-		<div th:replace="common::login"></div>	
+		<div th:replace="common::login"></div>
 	</footer>
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${portalHost + '/dll/dll.js'}"></script>
@@ -100,4 +100,4 @@
 		<script type="text/javascript" th:src="${portalHost + '/thinkTank/policyList.js'}"></script>
 	</div>
 </body>
-</html>
+</html>