Przeglądaj źródła

新闻政策修改,首页html修改

liliang4869 7 lat temu
rodzic
commit
f3ab33f01b

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

@@ -25,6 +25,7 @@ import com.goafanti.common.model.IndustryCategory;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.News;
+import com.goafanti.common.model.Policy;
 import com.goafanti.common.utils.LimitLengthUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -39,6 +40,7 @@ import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.news.bo.NewsPortalList;
 import com.goafanti.news.enums.NewsType;
 import com.goafanti.news.service.NewsService;
+import com.goafanti.news.service.PolicyService;
 import com.goafanti.portal.bo.AchievementObject;
 
 @Controller
@@ -62,6 +64,9 @@ public class WebpageController extends BaseController {
 	@Resource
 	private NewsService newsService; 
 	
+	@Resource
+	private PolicyService policyService;
+	
 	@Resource 
 	private JtBusinessService jtBusinessService; 
 
@@ -264,14 +269,16 @@ public class WebpageController extends BaseController {
 	/** 
 	 * 服务汇
 	 */
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
 	public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/portal/service/serviceIndex");
 		//政策
-		List<PolicyEntity>policyEntities=achievementService.getIntellectualProperty(8);
-		modelview.addObject("policyList",policyEntities); 
+//		List<PolicyEntity>policyEntities=achievementService.getIntellectualProperty(8);
+		List<Policy>policies=(List<Policy>) policyService.searchPolicy(null, null, null, null, "web_tech_service_index", 1, 8).getList();
+		modelview.addObject("policyList",policies); 
 		//新闻
-		List<News>news=newsService.getNewsList(5);
+		List<News>news=(List<News>) newsService.portalNewsList(5, 1, null, null, null, null).getList();
 		modelview.addObject("newsList",news);
 		//高企服务
 		JtBusinessCategory gaoqi=jtBusinessService.getBusinessCategoryByLayerAndName(1, "高企服务");
@@ -509,8 +516,10 @@ public class WebpageController extends BaseController {
 		modelview.addObject("projects",jtBusinessProjects);
 		List<AchievementObject> achievementObjects=achievementService.getHotAchievements(9, url, "web_index");
 		modelview.addObject("achievements",achievementObjects);
-		List<PolicyEntity> policyEntities=achievementService.getIntellectualProperty(4);
-		modelview.addObject("policys",policyEntities);
+//		List<PolicyEntity> policyEntities=achievementService.getIntellectualProperty(4);
+		@SuppressWarnings("unchecked")
+		List<Policy>policies=(List<Policy>) policyService.searchPolicy("", null, null, null, "web_index", 1, 4).getList();
+		modelview.addObject("policys",policies);
 		List<DemandListBo> demandListBos=demandService.getHotDemand(9, url, "web_index");
 		for(DemandListBo demandListBo:demandListBos) {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
@@ -642,6 +651,7 @@ public class WebpageController extends BaseController {
 	
 	
 	//成果首页
+	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/portal/technologyTrading/achievement", method = RequestMethod.GET)
 	public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
 		String showLocation="web_achievement_main";
@@ -665,8 +675,9 @@ public class WebpageController extends BaseController {
 		List<AchievementObject>practicalTechnology=achievementService.getPracticalTechnologys(8,url,showLocation);
 		modelview.addObject("practicalTechnology",practicalTechnology); 
 		
-		List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
-		modelview.addObject("policyList",intellectualPropertyPolicyList);
+//		List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
+		List<Policy> policies=(List<Policy>) policyService.searchPolicy("", null, null, null, "web_index", 1, 5);
+		modelview.addObject("policyList",policies);
 		return modelview;
 	}
 	

+ 1 - 1
src/main/java/com/goafanti/common/mapper/PolicyMapper.xml

@@ -105,7 +105,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Jun 28 16:23:43 CST 2018.
     -->
-    id, create_time as createTime, edit_time as editTime, title, title_img as titileImg, author, type, source, source_url as sourceUrl, summary, 
+    id, create_time as createTime, edit_time as editTime, title, title_img as titleImg, author, type, source, source_url as sourceUrl, summary, 
     audit_status as auditStatus, hot, province, city, release_date as releaseDate
   </sql>
   <sql id="Blob_Column_List">

+ 4 - 0
src/main/java/com/goafanti/common/model/Policy.java

@@ -2,12 +2,16 @@ package com.goafanti.common.model;
 
 import java.util.Date;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
 public class Policy {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column policy.id
 	 * @mbg.generated  Thu Jun 28 16:23:43 CST 2018
 	 */
+	@JsonFormat(shape=Shape.STRING)
 	private Long id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column policy.create_time

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

@@ -28,7 +28,7 @@ import com.goafanti.news.service.PolicyService;
 
 
 @RestController
-@RequestMapping(value = "/open/api/admin/policy")
+@RequestMapping(value = "/api/admin/policy")
 public class AdminPolicyApiController extends BaseApiController {
 	
 	@Autowired

+ 2 - 1
src/main/java/com/goafanti/news/service/PolicyService.java

@@ -75,6 +75,7 @@ public int deletePolicyById(Long id) {
 public PolicyResult getPolicyDetail(Long id) {
 	PolicyResult policyResult=policyMapper.selectByPrimaryKey(id);
 	List<String> publishPages=policyPublishMapper.getPagesByPolicyId(id); 
+	if(policyResult!=null)
 	policyResult.setPublishPages(publishPages);
 	return policyResult;
 }
@@ -134,7 +135,7 @@ public Pagination<Policy>searchPolicy(String title,Integer auditStatus,String st
 		params.put("startDate", startReleaseDate);  
 	}
 	if(endReleaseDate!=null)params.put("endDate", endReleaseDate); 
-	if(publishPage!=null)params.put("publishPages", publishPage);
+	if(publishPage!=null)params.put("publishPage", publishPage);
 	return (Pagination<Policy>) findPage("findPolicyByPageAndPublishPages","findPolicyCountByPageAndPublishPages",params, pageNo, pageSize); 
 }
 }

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

@@ -194,22 +194,22 @@
 			</div>
 			<div class="indexServe_cont">
 				
-				<div th:each="project,projectStatus:${projects}" th:if="${projectStatus.index<3}">
+				<div th:each="pj,projectStatus:${projects}" th:if="${projectStatus.index<3}">
 				<div >
 				<a></a>
-					<h2 th:text="${project.name}"></h2>
+					<h2 th:text="${pj.name}"></h2>
 					<div class="indexServe_bots">
 					<div class="wrapper">
-						<h3 th:text="${'什么是'+project.name+'?'}"></h3>
-						<p th:text="${project.introduce}"></p>
+						<h3 th:text="${'什么是'+pj.name+'?'}"></h3>
+						<p th:text="${pj.introduce}"></p>
 						</div>
-						<img th:src="${project.maxImgUrl}==null?${portalHost+'/img/indexNew8.jpg'}:${avatarUploadHost+project.maxImgUrl}" alt="" />
+						<img th:src="${pj.maxImgUrl}==null?${portalHost+'/img/indexNew8.jpg'}:${avatarUploadHost+pj.maxImgUrl}" alt="" />
 					</div>
 					<div class="indexServe_bot">
 						<div>认定好处</div>
-						<p th:text="${project.value}"></p>
+						<p th:text="${pj.value}"></p>
 					</div>
-					<a th:href="@{/portal/service/serviceDetail(id=${project.id})}">
+					<a th:href="@{/portal/service/serviceDetail(id=${pj.id})}">
 					<div class="indexServe_img">
 					<p>了解更多<span>></span></p>
 					</div>