Browse Source

新增需求列表页面、行业列表接口

liliang4869 7 years ago
parent
commit
ed6e597f94

+ 49 - 0
src/main/java/com/goafanti/common/bo/ReletivelyIndustry.java

@@ -0,0 +1,49 @@
+package com.goafanti.common.bo;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import com.goafanti.common.model.IndustryCategory;
+
+public class ReletivelyIndustry {
+	   private Integer id; 
+
+	    private String name;
+
+	    private Integer pid;
+
+	    private BigDecimal value;
+	    List<IndustryCategory>children;
+		public Integer getId() {
+			return id;
+		}
+		public void setId(Integer id) {
+			this.id = id;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public Integer getPid() {
+			return pid;
+		}
+		public void setPid(Integer pid) {
+			this.pid = pid;
+		}
+		public BigDecimal getValue() {
+			return value;
+		}
+		public void setValue(BigDecimal value) {
+			this.value = value;
+		}
+		public List<IndustryCategory> getChildren() {
+			return children;
+		}
+		public void setChildren(List<IndustryCategory> children) {
+			this.children = children;
+		}
+	    
+
+}

+ 12 - 0
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -5,10 +5,12 @@ 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 org.springframework.web.servlet.view.RedirectView;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.business.service.BusinessProjectService;
+import com.goafanti.common.bo.Result;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.demand.service.DemandInterestService;
@@ -54,4 +56,14 @@ public class PortalController extends BaseController {
 		return modelview;
 	}
 	
+
+	@RequestMapping(value="/portal/technologyTrading/industryList", method = RequestMethod.GET)
+	@ResponseBody
+	public Result getIndustryList() {
+		Result result=new Result();
+		result.setData(userIdentityService.selectIndustryReletively());
+		return result;
+		
+	}
+	
 }

+ 14 - 0
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -35,6 +35,7 @@ import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
 
 @Controller
@@ -73,6 +74,9 @@ public class PublicController extends BaseController {
 
 	@Autowired
 	private DistrictGlossoryService	districtGlossoryService;
+	
+	@Autowired
+	private UserIdentityService userIdentityService;
 
 	@Value(value = "${patentTemplate}")
 	private String					patentTemplate		= null;
@@ -515,4 +519,14 @@ public class PublicController extends BaseController {
 		return res;
 	}
 	
+	@RequestMapping(value="/industryList", method = RequestMethod.GET)
+	@ResponseBody
+	public Result getIndustryList() {
+		Result result=new Result();
+		result.setData(userIdentityService.selectIndustryReletively());
+		return result;
+		
+	}
+	
+	
 }

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

@@ -330,7 +330,13 @@ public class WebpageController extends BaseController {
 		modelview.setViewName("/portal/service/serviceList");
 		return modelview;
 	}
-
+	
+	@RequestMapping(value="/portal/technologyTrading/demandList",method=RequestMethod.GET)
+	public ModelAndView demandList(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/service/serviceList");
+		return modelview;
+	}
+	
 	/**
 	 * 知识产权
 	 * 

+ 3 - 0
src/main/java/com/goafanti/common/dao/IndustryCategoryMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import java.util.List;
 
+import com.goafanti.common.bo.ReletivelyIndustry;
 import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.model.IndustryCategory;
 
@@ -23,5 +24,7 @@ public interface IndustryCategoryMapper {
 	List<fieldGlossoryBo> selectindustryList();
 
 	List<fieldGlossoryBo> selectDomainList();
+	
+	List<ReletivelyIndustry>selectIndustryReletively();
     
 }

+ 15 - 0
src/main/java/com/goafanti/common/mapper/IndustryCategoryMapper.xml

@@ -97,4 +97,19 @@
 	FROM aft.industry_category
 	WHERE pid=0
   </select>
+  <select id="selectIndustryReletively"  resultMap="reletivelyIndustry">
+  select id,pid,name,value from industry_category where pid=0;
+  </select>
+    <resultMap type="com.goafanti.common.bo.ReletivelyIndustry" id="reletivelyIndustry">  
+        <id column="name" property="name"/>  
+        <id column="id"   property="id"/>
+        <id column="pid" property="pid"/>
+        <id column="value" property="value"/>
+        <collection property="children" select="getIndustryByPid" column="id" ofType="com.goafanti.common.model.IndustryCategory">
+        </collection>  
+    </resultMap>  
+  
+  <select id="getIndustryByPid" resultType="com.goafanti.common.model.IndustryCategory">
+  select id,name,pid,value from industry_category where pid=#{0};
+  </select>
 </mapper>

+ 3 - 0
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -2,6 +2,7 @@ package com.goafanti.user.service;
 
 import java.util.List;
 import com.goafanti.app.bo.consultantListBo;
+import com.goafanti.common.bo.ReletivelyIndustry;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.model.UserIdentity;
@@ -62,4 +63,6 @@ public interface UserIdentityService {
 	
 	List<consultantListBo> getConsultantList(int size);
 	
+	List<ReletivelyIndustry>selectIndustryReletively();
+	
 }

+ 7 - 0
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 
 
 import com.goafanti.app.bo.consultantListBo;
+import com.goafanti.common.bo.ReletivelyIndustry;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -467,6 +468,12 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 		// TODO Auto-generated method stub
 		return userIdentityMapper.getExperts( size);
 	}
+
+	@Override
+	public List<ReletivelyIndustry> selectIndustryReletively() {
+		// TODO Auto-generated method stub
+		return industryCategoryMapper.selectIndustryReletively();
+	}
 	
 	
 

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

@@ -34,11 +34,9 @@
 		<div id="indexSeach">
 			<div class="indexSeach_one">
 				<ul>
-					<li class="indexActive">成果</li>
-					<li>需求</li>
-					
-					<li>政策</li>
-				
+					<li class="indexActive" data-val="0">成果</li>
+					<li data-val="1">需求</li>
+					<li data-val="2">政策</li>
 				</ul>
 				<div>
 					<div>

File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandList.html


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

@@ -1,7 +1,7 @@
 <!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})">
+<head >
 	<title>智政--我的技术和科技服务交易平台</title>
 	<link th:href="${portalHost + '/vendors.css'}" rel="stylesheet">
 	<link th:href="${portalHost + '/thinkTank/policyList.css'}" rel="stylesheet">