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

Merge remote-tracking branch 'origin/test'

anderx лет назад: 8
Родитель
Сommit
a1b8e36e35

+ 34 - 32
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -7,6 +7,8 @@ public class AFTConstants {
 
 	public static final String	YYYY								= "yyyy";
 
+	public static final String	MMDDYYYY							= "MM/dd/yyyy";
+
 	public static final String	MMDD								= "MM-dd";
 
 	public static final String	INITIALPASSWORD						= "123456";				// 初始密码
@@ -60,39 +62,39 @@ public class AFTConstants {
 	public static final Integer	INTERNATIONAL_ORG_CACHE_KEY			= 672;
 
 	public static final Integer	YES									= 1;
-	
-	public static final Integer  NO									= 0;
-	
-	public static final String USER_TYPE_PERSONAL					= "0";
-	
-	public static final String USER_TYPE_ORGANIZATION				= "1";
-	
-	public static final Integer USER_SOURCE_REGISTER				= 0;
-	
-	public static final Integer USER_SOURCE_CREATE					= 1;
-	
-	public static final Integer USER_SHARE_PRIVATE					= 0;
-	
-	public static final Integer USER_SHARE_PUBLIC					= 1;
-	
-	public static final Integer USER_STATUS_NORMAL					= 0;
-	
-	public static final Integer USER_STATUS_CANCEL					= 1;
-	
-	public static final Integer USER_STATUS_LOCKING					= 2;
-	
-	public static final String USER_TRANSFER_TO_PUBLIC				= "转为公共客户";
-	
-	public static final String USER_DELETE							= "删除客户";
-	
-	public static final String USER_RECEIVE							= "领取";
-	
-	public static final String USER_TRANSFER_TO_OTHER				= "转交客户给制定人";
-	
+
+	public static final Integer	NO									= 0;
+
+	public static final String	USER_TYPE_PERSONAL					= "0";
+
+	public static final String	USER_TYPE_ORGANIZATION				= "1";
+
+	public static final Integer	USER_SOURCE_REGISTER				= 0;
+
+	public static final Integer	USER_SOURCE_CREATE					= 1;
+
+	public static final Integer	USER_SHARE_PRIVATE					= 0;
+
+	public static final Integer	USER_SHARE_PUBLIC					= 1;
+
+	public static final Integer	USER_STATUS_NORMAL					= 0;
+
+	public static final Integer	USER_STATUS_CANCEL					= 1;
+
+	public static final Integer	USER_STATUS_LOCKING					= 2;
+
+	public static final String	USER_TRANSFER_TO_PUBLIC				= "转为公共客户";
+
+	public static final String	USER_DELETE							= "删除客户";
+
+	public static final String	USER_RECEIVE						= "领取";
+
+	public static final String	USER_TRANSFER_TO_OTHER				= "转交客户给制定人";
+
 	/**组织类型-公司*/
-	public static final String ORGANIZATION_TYPE_COMPANY			= "0";
+	public static final String	ORGANIZATION_TYPE_COMPANY			= "0";
 	/**组织类型-部门*/
-	public static final String ORGANIZATION_TYPE_DEPARTMENT			= "1";
+	public static final String	ORGANIZATION_TYPE_DEPARTMENT		= "1";
 	/**组织类型-团队*/
-	public static final String ORGANIZATION_TYPE_TEAM				= "2";
+	public static final String	ORGANIZATION_TYPE_TEAM				= "2";
 }

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

@@ -150,12 +150,6 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 
-	@RequestMapping(value = "/user/index", method = RequestMethod.GET)
-	public ModelAndView userIndex(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/index");
-		return modelview;
-	}
-
 	@RequestMapping(value = "/user/subscriberDetail", method = RequestMethod.GET)
 	public ModelAndView subscriberDetail(HttpServletRequest request, ModelAndView modelview, String uid, Integer type) {
 		ModelAndView mv = new ModelAndView();

+ 18 - 6
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -1,11 +1,11 @@
 package com.goafanti.news.controller;
 
-import java.text.SimpleDateFormat;
 import java.util.List;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -15,6 +15,7 @@ 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.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.Banners;
@@ -28,9 +29,9 @@ import com.goafanti.news.service.NewsService;
 @Controller
 public class NewsController extends BaseController {
 	@Resource
-	NewsService newsService;
+	NewsService				newsService;
 	@Resource
-	private BannersService bannersService;
+	private BannersService	bannersService;
 
 	/**
 	 * 策源地
@@ -116,9 +117,19 @@ public class NewsController extends BaseController {
 		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)
-		newsDetail.setCreateTimeS(fmt.format(newsDetail.getCreateTime()));
+		if (null != newsDetail) {
+			newsDetail.setCreateTimeS(newsDetail.getCreateTime() != null
+					? DateFormatUtils.format(newsDetail.getCreateTime(), AFTConstants.MMDDYYYY) : "");
+			String summary = newsDetail.getSummary();
+			modelview.addObject("hasHighTech",
+					summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
+			modelview.addObject("hasPatent",
+					summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
+			modelview.addObject("hasCopyright",
+					summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
+			modelview.addObject("hasTechProj",
+					summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
+		}
 		@SuppressWarnings("unchecked")
 		List<NewsPortalList> la = (List<NewsPortalList>) newsList.getList();
 		for (NewsPortalList n : la) {
@@ -137,6 +148,7 @@ public class NewsController extends BaseController {
 			modelview.addObject("banners", banners);
 		}
 	}
+
 	/**
 	 * 高新认定APP
 	 */

+ 13 - 0
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -14,6 +14,7 @@ import org.apache.shiro.crypto.hash.SimpleHash;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
+import org.springframework.util.Assert;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -527,6 +528,18 @@ public class UserApiController extends BaseApiController {
 	}
 
 	/**
+	 * 获取昵称
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/nickname", method = RequestMethod.GET)
+	public Result nickname() {
+		User u = userService.selectByPrimaryKey(TokenManager.getUserId());
+		Assert.notNull(u, "用户不存在");
+		return res().data(u.getNickname());
+	}
+
+	/**
 	 * 团体人力资源情况入口
 	 * 
 	 * @return

+ 1 - 1
src/main/webapp/WEB-INF/views/common.html

@@ -11,7 +11,7 @@
 <meta name="viewport"
 	content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1,user-scalable=no">
 <meta http-equiv="x-ua-compatible" content="ie=edge">
-<title th:replace="${title}"></title>
+<title>技淘--我的技术和科技服务交易平台</title>
 <th:block th:replace="${link}" />
 <!-- [if lt IE 9]>
 			<script src="//cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>

+ 1 - 1
src/main/webapp/WEB-INF/views/error.html

@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:th="http://www.thymeleaf.org">
 <head th:replace="common::header(~{::title},~{})">
-    <title>出错啦</title>
+    <title>技淘--我的技术和科技服务交易平台</title>
 </head>
 <body>
 <p>错误信息:</p>

+ 5 - 2
src/main/webapp/WEB-INF/views/portal/news/newsDetail.html

@@ -27,8 +27,11 @@
 				<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>
+				<h5 th:if="${hasHighTech || hasPatent || hasCopyright || hasTechProj}">关联业务:</h5>
+				<span th:if="${hasHighTech}"><a th:href="${basePath + '/user/account/services.html#contract'}" target="_blank">高企认证</a></span>
+				<span th:if="${hasPatent}"><a th:href="${basePath + '/user/account/services.html#contract'}" target="_blank">专利申请</a></span>
+				<span th:if="${hasCopyright}"><a th:href="${basePath + '/user/account/services.html#contract'}" target="_blank">软著申请</a></span>
+				<span th:if="${hasTechProj}"><a th:href="${basePath + '/user/account/services.html#contract'}" target="_blank">科技项目申请</a></span>
 				<hr />
 				<!-- <div class="next_div">
 					<span class="rf">