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

需求详情,增加平台判断

liliang4869 лет назад: 7
Родитель
Сommit
3a5b206635

+ 37 - 9
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -17,12 +17,17 @@ import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.model.Demand;
 import com.goafanti.common.utils.LimitLengthUtil;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.user.service.OrganizationIdentityService;
 import com.goafanti.user.service.UserIdentityService;
+
+
+
 import com.goafanti.news.bo.NewsPortalList;
 import com.goafanti.news.enums.NewsType;
 import com.goafanti.news.service.NewsService;
@@ -417,18 +422,19 @@ public class WebpageController extends BaseController {
 	 * */
 	@RequestMapping(value = "/portal/demand")
 	public ModelAndView demand(HttpServletRequest request, ModelAndView modelview) {
+		String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
 		modelview.setViewName("/portal/technologyTrading/demand");
 		//行业
 		List<fieldGlossoryBo> industryList = userIdentityService.industryList();
 		modelview.addObject("industryList", industryList);
 		
 		//最新需求
-		List<DemandListBo> recentDemandList=demandService.recentDemand(5);
+		List<DemandListBo> recentDemandList=demandService.recentDemand(5,url);
 		LimitLengthUtil.limiteDemandCompanyAndName(recentDemandList, 18, 18);
 		modelview.addObject("recentDemandList",recentDemandList);
 //		 
 //		//加急需求
-		List<DemandListBo> urgentDemand=demandService.getUrgentDemand(5);
+		List<DemandListBo> urgentDemand=demandService.getUrgentDemand(5,url);
 		List<DemandListBo> urgentDemand2=urgentDemand.subList(0, Math.min(2, urgentDemand.size()));
 		List<DemandListBo> urgentDemand3=urgentDemand.subList( Math.min(2, urgentDemand.size()),  Math.min(5, urgentDemand.size()));
 		System.out.print("u2:"+urgentDemand2.size()+" u3:"+urgentDemand3.size());
@@ -438,7 +444,7 @@ public class WebpageController extends BaseController {
 		modelview.addObject("urgentDemand3",urgentDemand3);
 		
 		//热点需求
-		List<DemandListBo> hotDemand=demandService.getHotDemand(5);
+		List<DemandListBo> hotDemand=demandService.getHotDemand(5,url);
 		List<DemandListBo> hotDemand2=hotDemand.subList(0, Math.min(2, hotDemand.size()));
 		List<DemandListBo> hotDemand3=hotDemand.subList( Math.min(2, hotDemand.size()),  Math.min(5, hotDemand.size()));
 		System.out.print("u2:"+hotDemand2.size()+" u3:"+hotDemand3.size());
@@ -449,7 +455,7 @@ public class WebpageController extends BaseController {
 		
 		
 		//企业技术需求
-		List<DemandListBo> eightMaxCompanyDemand=demandService.companyDemand(8);
+		List<DemandListBo> eightMaxCompanyDemand=demandService.companyDemand(8,url);
 		for(DemandListBo demandListBo:eightMaxCompanyDemand) {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
 			else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
@@ -457,7 +463,7 @@ public class WebpageController extends BaseController {
 		modelview.addObject("companyDemandList",eightMaxCompanyDemand);
 		
 		//地区产业需求  最多4个
-		List<DemandListBo> fourMaxareaDemand=demandService.areaDemand(4);
+		List<DemandListBo> fourMaxareaDemand=demandService.areaDemand(4,url);
 		for(DemandListBo demandListBo:fourMaxareaDemand) {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
 			else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
@@ -466,7 +472,7 @@ public class WebpageController extends BaseController {
 		modelview.addObject("areaDemandList",fourMaxareaDemand);
 		
 		//产学研需求 最多9个
-		List<DemandListBo> nightMaxProLearnStudyDemand=demandService.proLearnStudyDemand(9);
+		List<DemandListBo> nightMaxProLearnStudyDemand=demandService.proLearnStudyDemand(9,url);
 		for(DemandListBo demandListBo:nightMaxProLearnStudyDemand) {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
 			else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
@@ -476,8 +482,8 @@ public class WebpageController extends BaseController {
 		modelview.addObject("proLearnStudyDemandList",nightMaxProLearnStudyDemand);
 		
 		//研产资金需求 最多4个
-		List<DemandListBo> fourMaxFundDemand=demandService.getFundCrowdDemand(4);
-		for(DemandListBo demandListBo:fourMaxFundDemand) {
+		List<DemandListBo> fourMaxFundDemand=demandService.getFundCrowdDemand(4,url);
+		for(DemandListBo demandListBo:fourMaxFundDemand) { 
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
 			else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
 		}
@@ -485,7 +491,7 @@ public class WebpageController extends BaseController {
 		modelview.addObject("fundDemandList",fourMaxFundDemand);
 		
 		//技术人才需求
-		List<DemandListBo> sixMaxPersonnelDemand=demandService.getPersonnelDemand(6);
+		List<DemandListBo> sixMaxPersonnelDemand=demandService.getPersonnelDemand(6,url);
 //		List <DemandListBo>fourMaxPersonnelDemand=personnelDemand.subList(0,Math.min(6, personnelDemand.size()));
 		for(DemandListBo demandListBo:sixMaxPersonnelDemand) {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
@@ -496,6 +502,28 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 	
+	@RequestMapping(value = "/portal/technologyTrading/demandDetail")
+	public ModelAndView  DemandDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
+		String url=StringUtils.getDomainByHttpRequest(request);
+		//详情
+		DemandListBo demand=demandService.getDemandDetail(id, type);
+		int countInterest=demandService.getInterestCount(id);
+		demand.setCountInterest(countInterest+"");
+		modelAndView.addObject("demand",demand);
+		
+		//精品需求
+		List<DemandListBo>boutiqueDemandList=LimitLengthUtil.LimitListLengthRandomly(demandService.getBoutiqueDemandList(10,url),3,10); 
+		modelAndView.addObject("reboutiquedemand",boutiqueDemandList); 
+		
+		//猜你喜欢
+		List<DemandListBo>guessYouLikeList=LimitLengthUtil.LimitListLengthRandomly(demandService.recentDemand(10, url), 4, 10);
+		modelAndView.addObject("redemandlist",guessYouLikeList);
+	
+		//view
+		modelAndView.setViewName("/portal/technologyTrading/demandDetail");
+		return modelAndView;
+	}
+	
 
 
 }

+ 12 - 8
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -61,20 +61,24 @@ public interface DemandMapper {
 
 	Demand selectDemandFollow(String id);
 	
-	List<DemandListBo> selectRecentDemand(int size);
+	List<DemandListBo> selectRecentDemand(int size,String pattern);
 	
-	List<DemandListBo> selectCompanyDemand(int size);
+	List<DemandListBo> selectCompanyDemand(int size,String pattern);
 	
-	List<DemandListBo> getUrgentDemand(int size);
+	List<DemandListBo> getUrgentDemand(int size,String pattern);
 	
-	List<DemandListBo> getHotDemand(int size);
+	List<DemandListBo> getHotDemand(int size,String pattern);
 	
-	List<DemandListBo> getAreaDemand(int size);
+	List<DemandListBo> getAreaDemand(int size,String pattern);
 	
-	List<DemandListBo> 	getProLearnStudyDemand(int size);
+	List<DemandListBo> 	getProLearnStudyDemand(int size,String pattern);
 	
-	List<DemandListBo> getFundCrowdDemand(int size);
+	List<DemandListBo> getFundCrowdDemand(int size,String pattern);
 	
-	List<DemandListBo> getPersonnelDemand(int size);
+	List<DemandListBo> getPersonnelDemand(int size,String pattern);
+	
+	DemandListBo getDemandDetail(String id,Integer type);
+	
+	List<DemandListBo>getBoutiqueDemandList(int i,String pattern);
 
 }

+ 43 - 0
src/main/java/com/goafanti/common/enums/DemandTypeEnum.java

@@ -0,0 +1,43 @@
+package com.goafanti.common.enums;
+
+public enum DemandTypeEnum {
+	COMPANY_DEMAND(0,"企业技术需求"),
+	DEVICE_DEMAND(1,"技术设备需求"),
+	PRO_LEARN_RESEARCH_DEMAND(2,"产学研合作需求"),
+	RESEARCH_PRO_FUND_DEMAND(3,"研产资金需求"),
+	AREA_INDUSTRY_DEMAND(4,"地区产业需求"),
+	EXPERT_DEMAND(5,"技术人才需求");
+	
+	private int i;
+	private String name;
+	
+	
+public int getI() {
+		return i;
+	}
+
+	public void setI(int i) {
+		this.i = i;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+DemandTypeEnum(int i,String name){
+	this.i=i;
+	this.name=name();
+}
+
+public static String find(int i)
+{
+for(DemandTypeEnum demandTypeEnum:values()) {
+	if(demandTypeEnum.getI() == i)return demandTypeEnum.getName();
+}	
+return "未知类型";
+}
+}

+ 60 - 11
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -1013,41 +1013,90 @@
   
   </select>
   <select id="selectRecentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select name,employer_name as employerName,id ,release_date as releaseDate,demand_type as demandType from demand where audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+ select name,employer_name as employerName,d.id ,data_category as dataCategory,release_date as releaseDate,demand_type as demandType,budget_cost as budgetCost from demand d 
+  left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
+ where audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+ order by  release_date  desc limit #{0}
   </select>
   
     <select id="selectCompanyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select name,picture_url as pictureUrl,id from demand d  where d.data_category=1 and info_sources=1 and d.audit_status=2  order by  release_date  desc limit #{size}
+ select d.name,picture_url as pictureUrl,d.id from demand d  
+   left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
+ where d.data_category=1 and info_sources=1 and d.audit_status=2  and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  order by  release_date  desc limit #{0}
   </select>
+  
+  
    <select id="getUrgentDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select name,release_date as releaseDate,id,problem_des as problemDes,research_type as researchType,budget_cost as fundForPersonnel,crowd_cost as fundForCrowd,demand_type as demandType,
+ select name,release_date as releaseDate,d.id,problem_des as problemDes,research_type as researchType,budget_cost as fundForPersonnel,crowd_cost as fundForCrowd,demand_type as demandType,
  validity_period as validityPeriod
-  from demand d  where d.is_urgent=1 and d.audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+  from demand d  
+    left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
+  where d.is_urgent=1 and d.audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+   order by  release_date  desc limit #{0}
   </select>
   
   <select id="getHotDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select name,release_date as releaseDate,id,problem_des as problemDes,research_type as researchType,budget_cost as fundForPersonnel,crowd_cost as fundForCrowd,demand_type as demandType,
+ select name,release_date as releaseDate,d.id,problem_des as problemDes,research_type as researchType,budget_cost as fundForPersonnel,crowd_cost as fundForCrowd,demand_type as demandType,
  validity_period as validityPeriod
-  from demand d  where d.is_hot=1 and d.audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+  from demand d 
+      left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
+   where d.is_hot=1 and d.audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+    order by  release_date  desc limit #{0}
   </select>
   
    <select id="getAreaDemand" resultType="com.goafanti.demand.bo.DemandListBo">
- select name,picture_url as pictureUrl ,problem_des as problemDes ,id from demand d  where d.demand_type=4 and d.audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+ select name,picture_url as pictureUrl ,problem_des as problemDes ,d.id from demand d 
+       left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id
+  where d.demand_type=4 and d.audit_status=2 and info_sources=1  and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  order by  release_date  desc limit #{0}
   </select>
   
      <select id="getProLearnStudyDemand" resultType="com.goafanti.demand.bo.DemandListBo">
     select d.name as name,picture_url as pictureUrl ,problem_des as problemDes,employer_name as employerName,d.id,fg.name as industryCategory1,fgg.name as industryCategory2 from demand d  
     left join aft.field_glossory  fg  on fg.id=d.industry_category_a
     left join aft.field_glossory fgg  on fgg.id=d.industry_category_b
- where d.demand_type=2 and d.audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+           left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+ where d.demand_type=2 and d.audit_status=2 and info_sources=1  and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+ order by  release_date  desc limit #{0}
   </select>
    <select id="getFundCrowdDemand" resultType="com.goafanti.demand.bo.DemandListBo">
-  select name,picture_url as pictureUrl ,problem_des as problemDes ,id,crowd_cost as fundForCrowd,research_type as researchType from demand d  where d.demand_type=3 and d.audit_status=2 and info_sources=1 order by  release_date 
-   desc limit #{size}
+  select d.name,picture_url as pictureUrl ,problem_des as problemDes ,d.id,crowd_cost as fundForCrowd,research_type as researchType from demand d  
+             left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  where d.demand_type=3 and d.audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  order by  release_date 
+   desc limit #{0}
   </select>
   
    <select id="getPersonnelDemand" resultType="com.goafanti.demand.bo.DemandListBo">
-  select name,picture_url as pictureUrl ,problem_des as problemDes ,id,budget_cost as fundForPersonnel from demand d  where d.demand_type=5 and d.audit_status=2 and info_sources=1 order by  release_date  desc limit #{size}
+  select d.name,picture_url as pictureUrl ,problem_des as problemDes ,d.id,budget_cost as fundForPersonnel from demand d  
+ left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  where d.demand_type=5 and d.audit_status=2 and info_sources=1 and dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+  order by  release_date  desc limit #{0}
   </select>
   
+  <select id="getDemandDetail" resultType="com.goafanti.demand.bo.DemandListBo">
+  select d.name,d.budget_cost as budgetCost,d.validity_period as validityPeriod,d.picture_url as pictureUrl,problem_des as problemDes,
+  fg.name as industryCategory1,fgg.name as industryCategory2
+   from demand d
+  left join aft.field_glossory  fg  on fg.id=d.industry_category_a
+    left join aft.field_glossory fgg  on fgg.id=d.industry_category_b
+    where d.id=#{0} and d.data_category=#{1}
+  </select>
+  <select id="getBoutiqueDemandList" resultType="com.goafanti.demand.bo.DemandListBo">
+ select d.id,d.name,picture_url as picture_url,data_category as dataCategory
+ from demand d
+ left join branch_information branchInfo on INSTR(branchInfo.domain_name,#{1})>0
+left join demand_publish dp on dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+where d.boutique=1 and  dp.demand_id=d.id and dp.publish_platform=branchInfo.id 
+order by release_date desc limit #{0}
+  </select>
 </mapper>

+ 24 - 0
src/main/java/com/goafanti/common/utils/LimitLengthUtil.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.utils;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.goafanti.demand.bo.DemandListBo;
@@ -84,5 +85,28 @@ public class LimitLengthUtil {
         return stringBuilder.toString();
 
     }
+    
+    /*
+     * 随机列表
+     * list-原始列表
+     * count 返回长度
+     * queryLength 查询长度
+     * return list
+     * 
+     * */
+ public static  <T>List<T>  LimitListLengthRandomly(List<T> list,int count,int queryLength)
+ {
+	 int truelyQueryLength=Math.min(list.size(), queryLength);
+	 int[] randomInts=RandomUtil.generateRandomList(truelyQueryLength, count);
+	 if(list==null || list.size()<=count)return list;
+	 else {
+		 List<T>res=new ArrayList<>();
+		 for(int i=0;i<count;i++) {
+			 res.add(list.get(randomInts[i]));
+		 }
+		 return res;
+	 }
+	 
+ }
 
 }

+ 22 - 0
src/main/java/com/goafanti/common/utils/RandomUtil.java

@@ -0,0 +1,22 @@
+package com.goafanti.common.utils;
+
+import java.util.Random;
+
+public class RandomUtil {
+	public static int[]generateRandomList(int maxNum,int count){
+		int[] res=new int[count];
+        Random rand = new Random();//新建一个随机类
+        boolean[]  bool = new boolean[maxNum];
+        int randInt = 0;
+        for(int i = 0; i < count ; i++) {
+             do {
+                 randInt  = rand.nextInt(maxNum);//产生一个随机数
+             }while(bool[randInt]);
+            bool[randInt] = true;
+            System.out.println(randInt);
+            res[i]=randInt;
+       }
+        return res;
+	}
+
+}

+ 11 - 0
src/main/java/com/goafanti/common/utils/StringUtils.java

@@ -2,10 +2,21 @@ package com.goafanti.common.utils;
 
 import java.util.regex.Pattern;
 
+import javax.servlet.http.HttpServletRequest;
+
 public class StringUtils extends org.apache.commons.lang3.StringUtils {
 	private static Pattern FRACTIONAL_NUMERIC = Pattern.compile("^[\\-+]?\\d+(\\.\\d+)?$");
 
 	public static boolean isFractionalNumeric(String val) {
 		return FRACTIONAL_NUMERIC.matcher(val).matches();
 	}
+	
+	public static String getDomainByHttpRequest(HttpServletRequest request)
+	{
+		StringBuffer url = request.getRequestURL();  
+		String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getServletContext().getContextPath()).append("/").toString();  
+		System.out.println("\n"+tempContextUrl+"\n");
+		if(tempContextUrl.contains("192")|| tempContextUrl.contains("localhost"))tempContextUrl="jishutao.com";
+		return tempContextUrl;
+	}
 }

+ 60 - 416
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -11,141 +11,39 @@ import org.apache.commons.lang3.time.DateFormatUtils;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.enums.DemandTypeEnum;
 import com.goafanti.common.utils.StringUtils;
 
-public class DemandListBo {
-
-	private String	id;
-
-	/**
-	 * 编号
-	 */
-	private Integer	serialNumber;
-
-	/**
-	 * 数据类别(0-个人需求,1-单位需求)
-	 */
-	private Integer	dataCategory;
-
-	/**
-	 * 名称
-	 */
-	private String	name;
-
-	/**
-	 * 关键词
-	 */
-	private String	keyword;
-
-	/**
-	 * 发布时间
-	 */
-	private Date	releaseDate;
-
-	/**
-	 * 需求类型 
-	 */
-	private Integer	demandType;
-	private String	demandTypeS;
-	
-	private BigDecimal budgetCost;
-
-	private Date	validityPeriod;
-
-	private Integer	status;
-	
-	private Integer fixedbudget;
-	
-	private Integer		industryCategoryA;
-
-	private Integer		industryCategoryB;
-	
-	private Integer		industryCategoryC;
-	
-	private String      problemDes;
-
-	private String		pictureUrl;
+public class DemandListBo extends InputDemand{
+	//industryCategoryA String 映射
 	private String		industryCategory1;
-	
+	//industryCategoryB String 映射
 	private String		industryCategory2;
-	
+	//industryCategoryC String 映射
+	private String		industryCategory3;
+//是否精品 0-false 1-true
 	private Integer 	boutique;
 	
-
-	private String		industryCategory3;
+	//demandType String 映射
+	private String	demandTypeS;
+	//有效期
+	private Date	validityPeriod;
 	
+	//是否关注
 	private String 	interest;
-	
-	/**
-	 * 是否发布(0-未发布,1-发布)
-	 */
-	private Integer	releaseStatus;
-
-	private String	employerId;
-	
-	private String  employerAddress;
-
-	/**
-	 * 审核状态
-	 */
-	private Integer	auditStatus;
-
-	/**
-	 * 关注数量
-	 */
+	//关注数量
 	private String countInterest;
-	/**
-	 *  
-	 */
-	private Integer  urgentDays;
-	private BigDecimal urgentMoney;
-
-	
-	private Date createTime;
-	
-	private String remark;
-	/**
-	 * 环信ID
-	 */
-	private String easemobName;
-	/**
-	 * 接单数
-	 */
-	private String orderCount;
-	
-	private String orderIntentionCount; 
-	
-	private String		industryCategoryAS;
-	
-	private String contacts;
-	private String contactMobile;
+	//企业名称
 	private String employerName;
-	private Integer researchType;
 	private BigDecimal fundForPersonnel;
 	private BigDecimal fundForCrowd;
 	
-	public Integer getResearchType() {
-		return researchType;
-	}
-
-	public void setResearchType(Integer researchType) {
-		this.researchType = researchType;
-	}
-
-	public BigDecimal getFundForPersonnel() {
-		return fundForPersonnel;
-	}
-
-	public void setFundForPersonnel(BigDecimal fundForpersonnel) {
-		this.fundForPersonnel = fundForpersonnel;
-	}
-
-	public BigDecimal getFundForCrowd() {
-		return fundForCrowd;
+	public String getDemandTypeS() {
+		return demandTypeS;
 	}
 
-	public void setFundForCrowd(BigDecimal fundForCrowd) {
-		this.fundForCrowd = fundForCrowd;
+	public void setDemandTypeS(String demandTypeS) {
+		this.demandTypeS = demandTypeS;
 	}
 
 	public String getEmployerName() {
@@ -156,277 +54,36 @@ public class DemandListBo {
 		this.employerName = employerName;
 	}
 
-	@JsonFormat(shape = Shape.STRING)
-	public String getIndustryCategory1() {
-		return industryCategory1;
-	}
-	
-	public void setIndustryCategory1(String industryCategory1) {
-		this.industryCategory1 = industryCategory1;
-	}
-	
-	public String getIndustryCategory2() {
-		return industryCategory2;
-	}
-	
-	public void setIndustryCategory2(String industryCategory2) {
-		this.industryCategory2 = industryCategory2;
-	}
-	
-	public String getIndustryCategory3() {
-		return industryCategory3;
-	}
-	
-	public void setIndustryCategory3(String industryCategory3) {
-		this.industryCategory3 = industryCategory3;
-	}
-	public Integer getAuditStatus() {
-		return auditStatus;
-	}
-
-	public void setAuditStatus(Integer auditStatus) {
-		this.auditStatus = auditStatus;
-	}
-
-	public String getEmployerId() {
-		return employerId;
-	}
-
-	public void setEmployerId(String employerId) {
-		this.employerId = employerId;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public Integer getSerialNumber() {
-		return serialNumber;
-	}
-
-	public void setSerialNumber(Integer serialNumber) {
-		this.serialNumber = serialNumber;
-	}
-
-	public Integer getDataCategory() {
-		return dataCategory;
-	}
-
-	public void setDataCategory(Integer dataCategory) {
-		this.dataCategory = dataCategory;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getKeyword() {
-		return keyword;
-	}
-
-	public void setKeyword(String keyword) {
-		this.keyword = keyword;
-	}
-
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getDemandType() {
-		return demandType;
-	}
-
-	public void setDemandType(Integer demandType) {
-		this.demandType = demandType;
-	}
-
-	public Date getValidityPeriod() {
-		return validityPeriod;
-	}
-
-	public void setValidityPeriod(Date validityPeriod) {
-		this.validityPeriod = validityPeriod;
-	}
-
-	@JsonFormat(shape = Shape.STRING)
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public Integer getReleaseStatus() {
-		return releaseStatus;
-	}
-
-	public void setReleaseStatus(Integer releaseStatus) {
-		this.releaseStatus = releaseStatus;
-	}
-
-	public Date getReleaseDate() {
-		return releaseDate;
-	}
-
-	public void setReleaseDate(Date releaseDate) {
-		this.releaseDate = releaseDate;
-	}
-
-	public String getValidityPeriodFormattedDate() {
-		if (this.validityPeriod == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.getValidityPeriod(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setValidityPeriodFormattedDate(String validityPeriodFormattedDate) {
-
-	}
-
-	public String getReleaseDateFormattedDate() {
-		if (this.releaseDate == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
-
-	}
-
-	public Integer getFixedbudget() {
-		return fixedbudget;
-	}
-
-	public void setFixedbudget(Integer fixedbudget) {
-		this.fixedbudget = fixedbudget;
-	}
-
-	public Integer getIndustryCategoryA() {
-		return industryCategoryA;
-	}
-
-	public void setIndustryCategoryA(Integer industryCategoryA) {
-		this.industryCategoryA = industryCategoryA;
-	}
-
-	public Integer getIndustryCategoryB() {
-		return industryCategoryB;
-	}
-
-	public void setIndustryCategoryB(Integer industryCategoryB) {
-		this.industryCategoryB = industryCategoryB;
-	}
-
-	public String getPictureUrl() {
-		return pictureUrl;
+	public BigDecimal getFundForPersonnel() {
+		return fundForPersonnel;
 	}
 
-	public void setPictureUrl(String pictureUrl) {
-		this.pictureUrl = pictureUrl;
-	}
-	
-	public List<String> getPictureUrls() {
-		List<String> list=new ArrayList<String>();
-		if (this.pictureUrl == null) {
-			return list;
-		} else {
-			String []s=pictureUrl.split(",");
-			 list = Arrays.asList(s);  
-			return list;
-		}
+	public void setFundForPersonnel(BigDecimal fundForPersonnel) {
+		this.fundForPersonnel = fundForPersonnel;
 	}
 
-	public String getDemandTypeS() {
-		return demandTypeS;
+	public BigDecimal getFundForCrowd() {
+		return fundForCrowd;
 	}
 
-	public void setDemandTypeS(String demandTypeS) {
-		this.demandTypeS = demandTypeS;
+	public void setFundForCrowd(BigDecimal fundForCrowd) {
+		this.fundForCrowd = fundForCrowd;
 	}
 
-
 	public String getCountInterest() {
-		if (StringUtils.isBlank(countInterest)) countInterest = "0";
-		return String.valueOf(Integer.valueOf(countInterest)+20);
+		return countInterest;
 	}
 
 	public void setCountInterest(String countInterest) {
 		this.countInterest = countInterest;
 	}
 
-	public Integer getUrgentDays() {
-		return urgentDays;
-	}
-
-	public void setUrgentDays(Integer urgentDays) {
-		this.urgentDays = urgentDays;
-	}
-
-	public BigDecimal getUrgentMoney() {
-		return urgentMoney;
-	}
-
-	public void setUrgentMoney(BigDecimal urgentMoney) {
-		this.urgentMoney = urgentMoney;
-	}
-
-	public String getEmployerAddress() {
-		if (StringUtils.isEmpty(employerAddress)) {
-			return "湖南长沙";
-		}
-		return employerAddress;
-	}
-
-	public void setEmployerAddress(String employerAddress) {
-		this.employerAddress = employerAddress;
-	}
-
-	public String getProblemDes() {
-		return problemDes;
-	}
-
-	public void setProblemDes(String problemDes) {
-		this.problemDes = problemDes;
-	}
-
-	public Integer getIndustryCategoryC() {
-		return industryCategoryC;
-	}
-
-	public void setIndustryCategoryC(Integer industryCategoryC) {
-		this.industryCategoryC = industryCategoryC;
-	}
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-	public String getCreateTimeFormattedDate() {
-		if (this.createTime == null) {
-			return null;
-		} else {
-			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
-		}
-	}
-
-	public String getRemark() {
-		return remark;
+	public String getInterest() {
+		return interest;
 	}
 
-	public void setRemark(String remark) {
-		this.remark = remark;
-
+	public void setInterest(String interest) {
+		this.interest = interest;
 	}
 
 	public Integer getBoutique() {
@@ -437,68 +94,55 @@ public class DemandListBo {
 		this.boutique = boutique;
 	}
 
-	public BigDecimal getBudgetCost() {
-		return budgetCost;
-	}
-
-	public void setBudgetCost(BigDecimal budgetCost) {
-		this.budgetCost = budgetCost;
-	}
-
-	public String getInterest() {
-		return interest;
-	}
-
-	public void setInterest(String interest) {
-		this.interest = interest;
-	}
-
-	public String getEasemobName() {
-		return easemobName;
+	public String getDemandTypeString() {
+		return demandTypeS;
 	}
 
-	public void setEasemobName(String easemobName) {
-		this.easemobName = easemobName;
+	public void setDemandTypeString(String demandTypeString) {
+		this.demandTypeS = demandTypeString;
 	}
 
-	public String getOrderCount() {
-		return orderCount;
+	public Date getValidityPeriod() {
+		return validityPeriod;
 	}
 
-	public void setOrderCount(String orderCount) {
-		this.orderCount = orderCount;
+	public void setValidityPeriod(Date validityPeriod) {
+		this.validityPeriod = validityPeriod;
 	}
 
-	public String getOrderIntentionCount() {
-		return orderIntentionCount;
+	public String getIndustryCategory1() {
+		return industryCategory1;
 	}
 
-	public void setOrderIntentionCount(String orderIntentionCount) {
-		this.orderIntentionCount = orderIntentionCount;
+	public void setIndustryCategory1(String industryCategory1) {
+		this.industryCategory1 = industryCategory1;
 	}
 
-	public String getIndustryCategoryAS() {
-		return industryCategoryAS;
+	public String getIndustryCategory2() {
+		return industryCategory2;
 	}
 
-	public void setIndustryCategoryAS(String industryCategoryAS) {
-		this.industryCategoryAS = industryCategoryAS;
+	public void setIndustryCategory2(String industryCategory2) {
+		this.industryCategory2 = industryCategory2;
 	}
 
-	public String getContacts() {
-		return contacts;
+	public String getIndustryCategory3() {
+		return industryCategory3;
 	}
 
-	public void setContacts(String contacts) {
-		this.contacts = contacts;
+	public void setIndustryCategory3(String industryCategory3) {
+		this.industryCategory3 = industryCategory3;
 	}
-
-	public String getContactMobile() {
-		return contactMobile;
+	@Override
+	public void setDemandType(Integer demandType) {
+		// TODO Auto-generated method stub
+		super.setDemandType(demandType);
+		setDemandTypeS(DemandTypeEnum.find(demandType.intValue()));
+		
 	}
+	
 
-	public void setContactMobile(String contactMobile) {
-		this.contactMobile = contactMobile;
-	}
+	
+	
 
 }

+ 14 - 8
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -68,20 +68,26 @@ public interface DemandService {
 	Demand DemandFollowDetails(String id);
 	
 	//科技需求首页列表
-	List<DemandListBo> recentDemand(int size);
+	List<DemandListBo> recentDemand(int size,String pattern);
 	
-	List<DemandListBo> companyDemand(int size);
+	List<DemandListBo> companyDemand(int size,String pattern);
 	
-	List<DemandListBo> getUrgentDemand(int size);
+	List<DemandListBo> getUrgentDemand(int size,String pattern);
 	
-	List<DemandListBo> getHotDemand(int size);
+	List<DemandListBo> getHotDemand(int size,String pattern);
 	
-	List<DemandListBo> areaDemand(int size);
+	List<DemandListBo> areaDemand(int size,String pattern); 
 	
-	List<DemandListBo> proLearnStudyDemand(int size);
+	List<DemandListBo> proLearnStudyDemand(int size,String pattern);
 	
-	List<DemandListBo> getFundCrowdDemand(int size);
+	List<DemandListBo> getFundCrowdDemand(int size,String pattern);
 	
-	List<DemandListBo> getPersonnelDemand(int size);
+	List<DemandListBo> getPersonnelDemand(int size,String pattern);
+	
+	DemandListBo getDemandDetail(String id,Integer type);
+	
+	int getInterestCount(String id);
+	
+	List<DemandListBo>getBoutiqueDemandList(int i,String pattern);
 	
 }

+ 37 - 16
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -834,52 +834,52 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	}
 		
 	@Override
-	public List<DemandListBo> recentDemand(int size) {
+	public List<DemandListBo> recentDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.selectRecentDemand(size);
+		return demandMapper.selectRecentDemand(size,pattern);
 	}
 	
 
 	@Override
-	public List<DemandListBo> companyDemand(int size) {
+	public List<DemandListBo> companyDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.selectCompanyDemand(size);
+		return demandMapper.selectCompanyDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> getUrgentDemand(int size) {
+	public List<DemandListBo> getUrgentDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getUrgentDemand(size);
+		return demandMapper.getUrgentDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> getHotDemand(int size) {
+	public List<DemandListBo> getHotDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getHotDemand(size);
+		return demandMapper.getHotDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> areaDemand(int size) {
+	public List<DemandListBo> areaDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getAreaDemand(size);
+		return demandMapper.getAreaDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> proLearnStudyDemand(int size) {
+	public List<DemandListBo> proLearnStudyDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getProLearnStudyDemand(size);
+		return demandMapper.getProLearnStudyDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> getFundCrowdDemand(int size) {
+	public List<DemandListBo> getFundCrowdDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getFundCrowdDemand(size);
+		return demandMapper.getFundCrowdDemand(size,pattern);
 	}
 
 	@Override
-	public List<DemandListBo> getPersonnelDemand(int size) {
+	public List<DemandListBo> getPersonnelDemand(int size,String pattern) {
 		// TODO Auto-generated method stub
-		return demandMapper.getPersonnelDemand(size);
+		return demandMapper.getPersonnelDemand(size,pattern);
 	}
 	
 	@SuppressWarnings("unchecked")
@@ -908,4 +908,25 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		Pagination<DemandSearchListBo> p=(Pagination<DemandSearchListBo>) findPage("findAppDemandListByPage", "findAppDemandCount", params, pNo, pSize);
 		return p;
 	}
+
+	@Override
+	public DemandListBo getDemandDetail(String id, Integer type) {
+		// TODO Auto-generated method stub
+		return demandMapper.getDemandDetail(id, type);
+	}
+
+	@Override
+	public int getInterestCount(String id) {
+		// TODO Auto-generated method stub
+		return demandMapper.countInterest(id);
+	}
+
+	@Override
+	public List<DemandListBo> getBoutiqueDemandList(int i,String pattern) {
+		// TODO Auto-generated method stub
+		return demandMapper.getBoutiqueDemandList(i,pattern);
+	}
+	
+	
+	
 }

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

@@ -179,6 +179,7 @@
 			<ul>
 
 				<li th:each="recentDemandList:${recentDemandList}">
+				<a th:href="@{/portal/technologyTrading/demandDetail(id=${recentDemandList.id},type=${recentDemandList.dataCategory})}">
 					<div th:switch="${recentDemandList.demandType}">
 					
 						<p>
@@ -198,6 +199,7 @@
 			
 						</p>
 					</div>
+					</a>
 				</li>
 
 			</ul>
@@ -238,6 +240,7 @@
 							
 							<div>
 								 <span class="problemDes" th:text="${u2.problemDes}"></span>	
+								 <span class="colorTime" th:if="${u2.validityPeriod}==null" th:text="无期限"></span>
 								 <span class="colorTime" th:if="${u2.validityPeriod}!=null" th:text="${#dates.format(u2.validityPeriod,'yyyy-MM-dd')+'到期'}"></span>
 								 <span class="colorOrange" th:if="${u2.demandType}==5" th:text="${u2.fundForPersonnel}==null?'人才:¥0元/月':${'人才:¥'+u2.fundForPersonnel+'元/月'}"></span>
 								 <span class="colorOrange" th:if="${u2.demandType}==3" th:text="${'期望资金:¥'+u2.fundForCrowd}+'万'"></span>

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

@@ -44,16 +44,16 @@
 							<p th:text="${demand.name}?${demand.name}:暂无名称"></p>
 						</div>
 						<div class="inline_span">
-							<span>行业:</span>  <span th:text="${demand.industryCategoryAS}?${demand.industryCategoryAS}:暂无行业分类"></span>
+							<span>行业:</span>  <span th:text="${demand.industryCategory1}?${demand.industryCategory1}:暂无行业分类"></span>
 						</div>
 						<div class="inline_span" >
-							<span>需求预算:</span> <span th:text="${demand.fixedbudget}?${demand.fixedbudget}:价格面议"></span>
+							<span>需求预算:</span> <span th:text="${demand.budgetCost}?${demand.budgetCost}:价格面议"></span>
 						</div>
 						<div class="inline_span">
-							<span>有效日期:</span> <span th:text="${demand.validityPeriodS}?${demand.validityPeriodS}:永久"></span>
+							<span>有效日期:</span> <span th:text="${demand.validityPeriod}?${#dates.format(demand.validityPeriod,'YYYY-MM-DD')}:永久"></span>
 						</div>
 						<div class="loves">  
-                       		<span class="box_love"></span><span class="dem_number" th:text="${demand.countDemandInterest}"></span><span>我感兴趣</span>
+                       		<span class="box_love"></span><span class="dem_number" th:text="${demand.countInterest}"></span><span>我感兴趣</span>
 							<input type="hidden" th:val="${demand.id}" id="demand_id">                     
 							<input type="hidden" th:isInterester="${isInterester}" id="isInterester">                     
                     	</div>
@@ -102,7 +102,7 @@
 						 
 							<div class="list_text">
 								<p>
-									行业:<span th:text="${redemandlist.industryCategoryAS}?${redemandlist.industryCategoryAS}:暂无行业分类"></span>
+									行业:<span th:text="${redemandlist.industryCategory1}?${redemandlist.industryCategory1}:暂无行业分类"></span>
 								</p>
 								<p >
 									名称:<span th:text="${redemandlist.name}?${redemandlist.name}:暂无名称"></span>
@@ -111,7 +111,7 @@
 									类型:<span th:text="${redemandlist.demandTypeS}?${redemandlist.demandTypeS}:暂无分类"></span>
 								</p>
 								<p class="money">
-									预算:<span th:text="${redemandlist.fixedbudget}?${redemandlist.fixedbudget}:价格面议"></span>
+									预算:<span th:text="${redemandlist.budgetCost}?${redemandlist.budgetCost}:价格面议"></span>
 								</p>
 								<p th:text="${redemandlist.id}" class="demandId"></p>
 								<p th:text="${redemandlist.dataCategory}" class="demandTyp"></p>