Browse Source

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

Conflicts:
	src/main/java/com/goafanti/news/controller/NewsController.java
	src/main/webapp/WEB-INF/views/portal/news/newsDetail.html
wanghui 8 years ago
parent
commit
3830cf4158

+ 8 - 2
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1462,7 +1462,10 @@
 	on 
 		a.field_a = b.id 	
 	where 
-		a.boutique = 1  and a.audit_status = 3 and a.field_a = #{fieldA,jdbcType=INTEGER}
+		a.boutique = 1  and a.audit_status = 3 
+	<if test="dataCategory != null and dataCategory != ''">
+		and a.field_a = #{fieldA,jdbcType=INTEGER}
+	</if>
 	<if test="dataCategory != null and dataCategory != ''">
 		and data_category = #{dataCategory,jdbcType=INTEGER}
 	</if>
@@ -1484,7 +1487,10 @@
 	on 
 		a.field_a = b.id 
 	where 
-		a.boutique = 1  and a.audit_status = 3 and a.field_a = #{fieldA,jdbcType=INTEGER}
+		a.boutique = 1  and a.audit_status = 3 
+	<if test="dataCategory != null and dataCategory != ''">
+		and a.field_a = #{fieldA,jdbcType=INTEGER}
+	</if>
 	<if test="dataCategory != null and dataCategory != ''">
 		and data_category = #{dataCategory,jdbcType=INTEGER}
 	</if>

+ 60 - 52
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -13,6 +13,7 @@
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
     <result column="mid" jdbcType="VARCHAR" property="mid" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
   </resultMap>
   
   <resultMap type="com.goafanti.user.bo.UserPageHomeBo" id="UserPageHomeBo">
@@ -755,57 +756,46 @@
     </if>
   </select>  
   
-  <select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
-  	SELECT
-  		u.number,
-        ui.username,
-        ui.province,
-        ui.city,
-        ui.area,
-        uc.engaged_field AS engagedField,
-        info.personal_profile AS personalProfile,
-        u.lvl AS LEVEL,
-        ua.ability_label AS abilityLabel,
-        info.person_portrait_url AS personPortraitUrl,
-        info.life_photo_url AS lifePhotoUrl,
-        interest.id as interestId
-    FROM
-    `user` u
-    LEFT JOIN user_identity ui ON ui.uid = u.id
-    LEFT JOIN user_career uc ON uc.uid = u.id
-    LEFT JOIN user_ability ua ON ua.uid = u.id
-    LEFT JOIN user_info info ON info.uid = u.id
-    LEFT JOIN user_interest interest on interest.to_uid = u.id and interest.from_uid = #{tokenId,jdbcType=VARCHAR}
-    WHERE
-        u.type = 0
-    and u.id = #{uid,jdbcType=VARCHAR}
-  </select>
-  
-  <select id="findOrgPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgPartnerDetailBo">
-  	SELECT
-  		u.number,
-        oi.unit_name AS unitName,
-        oi.licence_province AS province,
-        oi.licence_city AS city,
-        oi.licence_area AS area,
-        u.lvl AS LEVEL,
-        ua.ability_label AS abilityLabel,
-        info.logo_url AS logoUrl,
-        info.company_introduction AS companyIntroduction,
-        info.publicity_picture_url AS publicityPictureUrl,
-        ot.search_area_category as field, 
-        interest.id as interestId
-    FROM
-    `user` u
-    LEFT JOIN organization_identity oi ON oi.uid = u.id
-    LEFT JOIN organization_info info ON info.uid = u.id
-    LEFT JOIN organization_tech ot ON ot.uid = u.id
-    LEFT JOIN user_ability ua ON ua.uid = u.id
-    LEFT JOIN user_interest interest on interest.to_uid = u.id and interest.from_uid = #{tokenId,jdbcType=VARCHAR}
-    WHERE
-        u.type = 1
-    and u.id = #{uid,jdbcType=VARCHAR} 
-  </select>
+ 	<select id="findUserPartnerDetail" parameterType="java.lang.String"
+		resultType="com.goafanti.user.bo.UserPartnerDetailBo">
+		select
+		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
+		info.person_portrait_url as personPortraitUrl,
+		i.province,
+		info.personal_profile as personalProfile,
+		ua.ability_label as abilityLabel
+		from `user` u
+		left join user_identity i on u.id=i.uid
+		left join
+		user_career c on u.id=c.uid
+		left join user_info info on u.id=info.uid
+		left join user_ability ua on u.id=ua.uid
+		WHERE
+		u.type = 0
+		<if test="_parameter!= null">
+			and u.id= #{_parameter,jdbcType=VARCHAR}
+		</if>
+	</select>
+  
+  <select id="findOrgPartnerDetail" parameterType="java.lang.String"
+		resultType="com.goafanti.user.bo.OrgPartnerDetailBo">
+		select
+		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
+		info.person_portrait_url as personPortraitUrl,
+		i.province,info.personal_profile as personalProfile,
+		ua.ability_label as abilityLabel
+		from `user` u
+		left join user_identity i on u.id=i.uid
+		left join
+		user_career c on u.id=c.uid
+		left join user_info info on u.id=info.uid
+		left join user_ability ua on u.id=ua.uid
+		WHERE
+		u.type = 1
+		<if test="_parameter!= null">
+			and u.id= #{_parameter,jdbcType=VARCHAR}
+		</if>
+	</select>
   
   <select id="findStarListByPage" parameterType="String" resultType="com.goafanti.user.bo.StarListBo">
   	select 
@@ -935,5 +925,23 @@
   	select number
   	from user
   	where id = #{id,jdbcType=VARCHAR}
-  </select>
+  </select>
+  
+  <select id="findUserPartner" parameterType="String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
+		select
+		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
+		info.person_portrait_url as personPortraitUrl,
+		i.province,
+		info.personal_profile as personalProfile,
+		ua.ability_label as abilityLabel
+		from `user` u
+		left join user_identity i on u.id=i.uid
+		left join
+		user_career c on u.id=c.uid
+		left join user_info info on u.id=info.uid
+		left join user_ability ua on u.id=ua.uid
+		WHERE
+		u.type = 0
+		limit 0,50
+	</select>
 </mapper>

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

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 package com.goafanti.news.controller;
 
 import java.text.SimpleDateFormat;
@@ -137,4 +138,150 @@ public class NewsController extends BaseController {
 		}
 	}
 
+=======
+package com.goafanti.news.controller;
+
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.goafanti.banners.enums.BannersType;
+import com.goafanti.banners.service.BannersService;
+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;
+
+@Controller
+public class NewsController extends BaseController {
+	@Resource
+	NewsService newsService;
+	@Resource
+	private BannersService bannersService;
+
+	/**
+	 * 策源地
+	 * 
+	 * @param request
+	 * @param modelview
+	 * @return
+	 */
+	@RequestMapping(value = "/portal/news/newsIndex", method = RequestMethod.GET)
+	public ModelAndView portalNewsNewsIndex(HttpServletRequest request, ModelAndView modelview, String noCache) {
+		modelview.setViewName("/portal/news/newsIndex");
+		if (StringUtils.equals(noCache, "clear")) {
+			newsService.cleanList();
+		}
+		String domainName = request.getServerName();
+		modelview.addObject("kjkx", newsService.findNewsList(0, NewsType.KJZX.getCode(), 2, domainName, false));
+		modelview.addObject("jtdt", newsService.findNewsList(0, NewsType.JTDT.getCode(), 2, domainName, false));
+		modelview.addObject("zfwl", newsService.findNewsList(0, NewsType.ZFWL.getCode(), 3, domainName, false));
+		modelview.addObject("gjzc", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3, domainName, false));
+		modelview.addObject("dfzc", newsService.findNewsList(0, NewsType.DFZC.getCode(), 3, domainName, false));
+		handleBanners(modelview, BannersType.CE_YUAN_DI);
+		return modelview;
+	}
+
+	/**
+	 * 新闻详情
+	 */
+	@RequestMapping(value = "/portal/news/newsDetails", method = RequestMethod.GET)
+	public ModelAndView portalNewsNewsDetails(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/news/newsDetails");
+		return modelview;
+	}
+
+	/**
+	 * 新闻详情APP
+	 */
+	@RequestMapping(value = "/portal/news/newsDetailApp", method = RequestMethod.GET)
+	public ModelAndView portalNewsNewsDetailApp(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/news/newsDetailApp");
+		return modelview;
+	}
+
+	/**
+	 * 新闻详情列表
+	 */
+	@RequestMapping(value = "/portal/news/list", method = RequestMethod.GET)
+	@ResponseBody
+	public Result portalNewsList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
+			String keyword) {
+		Result res = new Result();
+		Integer pNo = 1, pSize = 4;
+		if (StringUtils.isNumeric(pageNo)) {
+			pNo = Integer.parseInt(pageNo);
+		}
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize = Integer.parseInt(pageSize);
+		}
+		res.setData(newsService.portalNewsList(pSize, pNo, type, hot, provinceId, keyword));
+		return res;
+	}
+
+	/**
+	 * 新闻详情
+	 */
+	@RequestMapping(value = "/portal/news/detailInfo", method = RequestMethod.GET)
+	@ResponseBody
+	public Result portalNewsDetail(Long id) {
+		Result res = new Result();
+		if (null == id) {
+			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, 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();
+		if(null!= newsDetail) {
+			if(null != newsDetail.getCreateTime()) {
+				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) {
+		List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
+		if (!banners.isEmpty()) {
+			modelview.addObject("banners", banners);
+		}
+	}
+
+>>>>>>> branch 'dev' of https://git.coding.net/aft/AFT.git
 }

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

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 <!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:th="http://www.thymeleaf.org"
@@ -66,4 +67,81 @@
 </body>
 
 
+=======
+<!DOCTYPE html>
+<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 + '/thinkTank/policyDetail.css'}" rel="stylesheet">
+</head>
+
+<body>
+	<header>
+		<div th:replace="common::nav('news','newsDetail')"></div>
+	</header>
+	<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="content_img">
+					<div th:if="${newsDetail.titleImg} == null " >
+						<img th:src="${avatarUploadHost+ '/default/neswimg_null.png'}" alt=""/>
+					</div>
+					<div th:if="${newsDetail.titleImg} != null " >
+						<img th:src= "${avatarUploadHost+newsDetail.titleImg}"alt="" />
+					</div>
+				</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 ><a th:href="@{/portal/news/newsDetail(id=${news.id})}"  th:text="${news.title}?${news.title}:'暂无更多内容'"></a></span>
+				</div>
+			</div>
+			<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>
+	<footer>
+		<div th:replace="common::copyright"></div>
+	</footer>
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
+		<script type="text/javascript"
+			th:src="${portalHost + '/thinkTank/policyDetail.js'}"></script>
+	</div>
+</body>
+
+
+>>>>>>> branch 'dev' of https://git.coding.net/aft/AFT.git
 </html>

+ 9 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievement.html

@@ -32,6 +32,14 @@
   		<div class="achievement_top"><img th:src="${portalHost + '/img/achievement_01.png'}" alt=""/></div>  		
   	</div>
   	<div class="container">
+  		
+  		<div th:if="${keyWord} != null "  id="keyword1">
+			<p th:text="${keyWord}"></p>
+		</div>
+		<div th:if="${keyWord} == null " id="keyword2">
+			<p></p>
+		</div>
+  		
   		<div class="achievement_header">
   			<p>全部结果: </p>
   			<ul>
@@ -119,7 +127,7 @@
 							<div class="inp_select">
 								<input type="number" name="" id="minprice" placeholder="最小价格" maxlength="6" min="0"/>
 								<span>-</span>
-								<input type="number" id="maxprice" placeholder="最大价格" maxlength="6" min="0"/>
+								<input type="number" id="maxprice" placeholder="最大价格" maxlength="6" min="0"/>
 								<button>确定</button>
 							</div>
 						</li>

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

@@ -24,7 +24,7 @@
 						alt="" /></a>
 				</div>-->				
 				<div class="detail_toptitle">
-					<a href="#">技术交易&nbsp;&nbsp;></a> <a href="#">技术专利&nbsp;&nbsp;></a> <a href="#"
+					<a href="/portal/technologyTrading/index.html">技术交易&nbsp;&nbsp;></a> <a href="/portal/technologyTrading/achievement.html">技术专利&nbsp;&nbsp;></a> <a href="#"
 						class="a_detail">专利详情</a>
 				</div>
 			</div>
@@ -40,9 +40,14 @@
 							<ul th:if="#{detail.pictureList.empty}">
 							</ul>
 						</div> -->
-						<div class="big_img" th:each="achievementdetail:${achievementdetail}">
+						<div th:if="${achievementdetail.technicalPictureUrl} == null " >
+							<img th:src="${avatarUploadHost+ '/default/bigimg_null.png'}" alt=""/>
+						</div>
+						<div th:if="${achievementdetail.technicalPictureUrl} != null " >
 							<img th:src= "${avatarUploadHost+achievementdetail.technicalPictureUrl}"alt="" />
 						</div>
+						
+						
 					</div>
 					<div class="basic"  th:each="achievementdetail:${achievementdetail}">
 						<div class="basic_left">

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/demand.html

@@ -101,7 +101,7 @@
 							<div class="inp_select">
 								<input type="number" name="" id="minprice" placeholder="最小价格" maxlength="6" min="0"/>
 								<span>-</span>
-								<input type="number" id="maxprice" placeholder="最大价格" maxlength="6" min="0"/>
+								<input type="number" id="maxprice" placeholder="最大价格" maxlength="6" min="0"/>
 								<button>确定</button>
 							</div>
 						</li>

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

@@ -22,7 +22,7 @@
 					<a href="#"> <img th:src="${portalHost + '/img/detail_weibo.jpg'}" alt="" /></a>
 				</div> -->
 				<div class="detail_toptitle" th:each="demand:${demand}">
-					<a href="#">技术交易&nbsp;&nbsp;></a>  <a href="#">技术需求&nbsp;&nbsp;></a>  <a href="#"class="a_detail" th:text="${demand.name}">关于超细颗粒金属碳化物的制造技术</a>
+					<a href="/portal/technologyTrading/index.html">技术交易&nbsp;&nbsp;></a>  <a href="/portal/technologyTrading/demand.html">技术需求&nbsp;&nbsp;></a>  <a href="#"class="a_detail" th:text="${demand.name}">关于超细颗粒金属碳化物的制造技术</a>
 				</div>
 			</div>
 			<div class="detail_center">
@@ -31,7 +31,12 @@
 						<h3 th:text="${demand.name}"></h3>
 					</div>
 					<div class="big_img">
-						<img th:src= "${avatarUploadHost+demand.pictureUrl}?${avatarUploadHost+demand.pictureUrl}:${avatarUploadHost+ 'default/xuqiuimg_null.png'}"alt="" />
+						<div th:if="${demand.pictureUrl} == null " >
+							<img th:src="${avatarUploadHost+ '/default/bigimg_null.png'}" alt=""/>
+						</div>
+						<div th:if="${demand.pictureUrl} != null " >
+							<img th:src= "${avatarUploadHost+demand.pictureUrl}"alt="" />
+						</div>
 					</div>
 					<div class="basic">
 						<div>