浏览代码

服务业增加跳转,智者搜索修改

liliang4869 7 年之前
父节点
当前提交
7751a0da57

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

@@ -1,145 +1,145 @@
-package com.goafanti.common.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-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 org.springframework.web.servlet.view.RedirectView;
-
-import com.goafanti.achievement.bo.AchievementPartnerListBo;
-import com.goafanti.achievement.service.AchievementService;
-import com.goafanti.business.service.BusinessProjectService;
-import com.goafanti.common.bo.Result;
-import com.goafanti.common.enums.AchievementMaturity;
-import com.goafanti.common.enums.UserType;
-import com.goafanti.common.service.DistrictGlossoryService;
-import com.goafanti.common.service.FieldGlossoryService;
-import com.goafanti.demand.service.DemandInterestService;
-import com.goafanti.demand.service.DemandService;
-import com.goafanti.order.service.OrderService;
-import com.goafanti.user.bo.UserPartnerDetailBo;
-import com.goafanti.user.service.UserIdentityService;
-import com.goafanti.user.service.UserService;
-
-@Controller
-public class PortalController extends BaseController {
-	@Resource
-	private FieldGlossoryService glossoryService;
-	@Resource
-	private AchievementService achievementService;
-	@Resource
-	private DemandService demandService;
-	@Resource
-	UserIdentityService	userIdentityService;
-	@Resource
-	private FieldGlossoryService fieldGlossoryService;
-	@Resource
-	private DemandInterestService  demandInterestService;
-	@Resource
-	private UserService userService;
-	@Resource
-	private DistrictGlossoryService districtglossoryservice;
-	@Resource
-	BusinessProjectService	businessProjectService;
-	@Resource
-	OrderService	orderService;
-
-	@RequestMapping(value = "/index", method = RequestMethod.GET)
-	public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
-		return home(request, modelview);
-	}
-
-	@RequestMapping(value = "/", method = RequestMethod.GET)
-	public ModelAndView home(HttpServletRequest request, ModelAndView modelview) {
-		RedirectView rv = new RedirectView();
-		rv.setUrl(request.getContextPath() + "/portal/index");
-		rv.setExposeModelAttributes(false);
-		modelview.setView(rv);
-		return modelview;
-	}
-	
-	@RequestMapping(value = "/portal/subscriberDetail", method = RequestMethod.GET)
-	public ModelAndView subscriberDetail(HttpServletRequest request, ModelAndView modelview, String uid, Integer type) {
-		ModelAndView mv = new ModelAndView();
-		UserPartnerDetailBo rePartnerDetail = new UserPartnerDetailBo();
-		/* 查询智者详细信息 */
-
-		if (UserType.PERSONAL.getCode().equals(type)) {
-			rePartnerDetail = userService.findUserPartnerDetail(uid);
-			if (null != rePartnerDetail) {
-				Integer province = rePartnerDetail.getProvince();
-				if (null != province) {
-					rePartnerDetail.setProvinceS(districtglossoryservice.selectNameById(province));
-				}
-			}
-		} else {
-//			rePartnerDetail = (UserPartnerDetailBo) userService.findOrgPartnerDetail(uid);
-//			if (null != rePartnerDetail) {
-//				Integer province = rePartnerDetail.getProvince();
-//				if (null != province) {
-//					rePartnerDetail.setProvinceS(districtglossoryservice.selectNameById(province));
-//				}
-//			}
-		}
-
-		/* 查询该智者的相关成果信息 */
-		List<AchievementPartnerListBo> partnerAchievementList = achievementService.findPartnerAchievementList(uid);
-		for (int i = 0; i < partnerAchievementList.size(); i++) {
-			Integer maturity = partnerAchievementList.get(i).getMaturity();
-			if (null != maturity) {
-				if (AchievementMaturity.RESEARCH.getCode().equals(maturity)) {
-					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.RESEARCH.getDesc());
-				} else if (AchievementMaturity.SAMPLE.getCode().equals(maturity)) {
-					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.SAMPLE.getDesc());
-				} else if (AchievementMaturity.PRIMARYTEST.getCode().equals(maturity)) {
-					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.PRIMARYTEST.getDesc());
-				} else if (AchievementMaturity.INTERMEDIATETEST.getCode().equals(maturity)) {
-					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.INTERMEDIATETEST.getDesc());
-				} else if (AchievementMaturity.MASSPRODUCTION.getCode().equals(maturity)) {
-					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.MASSPRODUCTION.getDesc());
-				}
-			}
-		}
-
-		/* 查询相关智者信息 */
-		List<UserPartnerDetailBo> userPartner = userService.findUserPartner();
-		List<UserPartnerDetailBo> reuserPartner = new ArrayList<UserPartnerDetailBo>();
-		if (userPartner != null && userPartner.size() >= 6) {
-			int index = new Random().nextInt(userPartner.size() - 5);
-			reuserPartner.add(userPartner.get(index));
-			reuserPartner.add(userPartner.get(index + 1));
-			reuserPartner.add(userPartner.get(index + 2));
-			reuserPartner.add(userPartner.get(index + 3));
-			reuserPartner.add(userPartner.get(index + 4));
-		} else {
-			reuserPartner.addAll(userPartner);
-		}
-		for (int i = 0; i < reuserPartner.size(); i++) {
-			String personalProfile = reuserPartner.get(i).getPersonalProfile();
-			if (null != personalProfile && "" != personalProfile && personalProfile.length() > 40) {
-				personalProfile = personalProfile.substring(0, 40) + "... ...";
-				reuserPartner.get(i).setPersonalProfile(personalProfile);
-			}
-		}
-		rePartnerDetail.setUid(uid);
-		mv.setViewName("/user/subscriberDetail");
-		mv.addObject("rePartnerDetail", rePartnerDetail);
-		mv.addObject("reuserPartner", reuserPartner);
-		partnerAchievementList.size();
-		if (partnerAchievementList.size()<=0) {
-			mv.addObject("showflg", 0);
-		}else{
-			mv.addObject("showflg", 1);
-		};
-		mv.addObject("uid", uid);
-		return mv;
-
-	}
-	}
+package com.goafanti.common.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+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 org.springframework.web.servlet.view.RedirectView;
+
+import com.goafanti.achievement.bo.AchievementPartnerListBo;
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.business.service.BusinessProjectService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.enums.AchievementMaturity;
+import com.goafanti.common.enums.UserType;
+import com.goafanti.common.service.DistrictGlossoryService;
+import com.goafanti.common.service.FieldGlossoryService;
+import com.goafanti.demand.service.DemandInterestService;
+import com.goafanti.demand.service.DemandService;
+import com.goafanti.order.service.OrderService;
+import com.goafanti.user.bo.UserPartnerDetailBo;
+import com.goafanti.user.service.UserIdentityService;
+import com.goafanti.user.service.UserService;
+
+@Controller
+public class PortalController extends BaseController {
+	@Resource
+	private FieldGlossoryService glossoryService;
+	@Resource
+	private AchievementService achievementService;
+	@Resource
+	private DemandService demandService;
+	@Resource
+	UserIdentityService	userIdentityService;
+	@Resource
+	private FieldGlossoryService fieldGlossoryService;
+	@Resource
+	private DemandInterestService  demandInterestService;
+	@Resource
+	private UserService userService;
+	@Resource
+	private DistrictGlossoryService districtglossoryservice;
+	@Resource
+	BusinessProjectService	businessProjectService;
+	@Resource
+	OrderService	orderService;
+
+	@RequestMapping(value = "/index", method = RequestMethod.GET)
+	public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
+		return home(request, modelview);
+	}
+
+	@RequestMapping(value = "/", method = RequestMethod.GET)
+	public ModelAndView home(HttpServletRequest request, ModelAndView modelview) {
+		RedirectView rv = new RedirectView();
+		rv.setUrl(request.getContextPath() + "/portal/index");
+		rv.setExposeModelAttributes(false);
+		modelview.setView(rv);
+		return modelview;
+	}
+	
+	@RequestMapping(value = "/portal/subscriberDetail", method = RequestMethod.GET)
+	public ModelAndView subscriberDetail(HttpServletRequest request, ModelAndView modelview, String uid, Integer type) {
+		ModelAndView mv = new ModelAndView();
+		UserPartnerDetailBo rePartnerDetail = new UserPartnerDetailBo();
+		/* 查询智者详细信息 */
+
+//		if (UserType.PERSONAL.getCode().equals(type)) {
+			rePartnerDetail = userService.findUserPartnerDetail(uid);
+			if (null != rePartnerDetail) {
+				Integer province = rePartnerDetail.getProvince();
+				if (null != province) {
+					rePartnerDetail.setProvinceS(districtglossoryservice.selectNameById(province));
+				}
+			}
+//		} else {
+//			rePartnerDetail = (UserPartnerDetailBo) userService.findOrgPartnerDetail(uid);
+//			if (null != rePartnerDetail) {
+//				Integer province = rePartnerDetail.getProvince();
+//				if (null != province) {
+//					rePartnerDetail.setProvinceS(districtglossoryservice.selectNameById(province));
+//				}
+//			}
+//		}
+
+		/* 查询该智者的相关成果信息 */
+		List<AchievementPartnerListBo> partnerAchievementList = achievementService.findPartnerAchievementList(uid);
+		for (int i = 0; i < partnerAchievementList.size(); i++) {
+			Integer maturity = partnerAchievementList.get(i).getMaturity();
+			if (null != maturity) {
+				if (AchievementMaturity.RESEARCH.getCode().equals(maturity)) {
+					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.RESEARCH.getDesc());
+				} else if (AchievementMaturity.SAMPLE.getCode().equals(maturity)) {
+					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.SAMPLE.getDesc());
+				} else if (AchievementMaturity.PRIMARYTEST.getCode().equals(maturity)) {
+					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.PRIMARYTEST.getDesc());
+				} else if (AchievementMaturity.INTERMEDIATETEST.getCode().equals(maturity)) {
+					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.INTERMEDIATETEST.getDesc());
+				} else if (AchievementMaturity.MASSPRODUCTION.getCode().equals(maturity)) {
+					partnerAchievementList.get(i).setMaturityS(AchievementMaturity.MASSPRODUCTION.getDesc());
+				}
+			}
+		}
+
+		/* 查询相关智者信息 */
+		List<UserPartnerDetailBo> userPartner = userService.findUserPartner();
+		List<UserPartnerDetailBo> reuserPartner = new ArrayList<UserPartnerDetailBo>();
+		if (userPartner != null && userPartner.size() >= 6) {
+			int index = new Random().nextInt(userPartner.size() - 5);
+			reuserPartner.add(userPartner.get(index));
+			reuserPartner.add(userPartner.get(index + 1));
+			reuserPartner.add(userPartner.get(index + 2));
+			reuserPartner.add(userPartner.get(index + 3));
+			reuserPartner.add(userPartner.get(index + 4));
+		} else {
+			reuserPartner.addAll(userPartner);
+		}
+		for (int i = 0; i < reuserPartner.size(); i++) {
+			String personalProfile = reuserPartner.get(i).getPersonalProfile();
+			if (null != personalProfile && "" != personalProfile && personalProfile.length() > 40) {
+				personalProfile = personalProfile.substring(0, 40) + "... ...";
+				reuserPartner.get(i).setPersonalProfile(personalProfile);
+			}
+		}
+		rePartnerDetail.setUid(uid);
+		mv.setViewName("/user/subscriberDetail");
+		mv.addObject("rePartnerDetail", rePartnerDetail);
+		mv.addObject("reuserPartner", reuserPartner);
+		partnerAchievementList.size();
+		if (partnerAchievementList.size()<=0) {
+			mv.addObject("showflg", 0);
+		}else{
+			mv.addObject("showflg", 1);
+		};
+		mv.addObject("uid", uid);
+		return mv;
+
+	}
+	}

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

@@ -323,7 +323,8 @@ public class WebpageController extends BaseController {
 				modelview.addObject("scienceProjectList",scienceProjects);
 				modelview.addObject("spc1",scienceProject);}
 		//咨询师
-			List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
+				List<UserIdentityBo> userIdentityBos=userIdentityService.getExperts(8);
+//			List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
 			modelview.addObject("consultants",userIdentityBos);
 		return modelview;  
 	}

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

@@ -972,7 +972,7 @@
 			AND ui.industry= #{field,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null">
-			AND ui.username like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
+			AND ui.identify_name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
 		</if>
 	order by u.number asc
 	<if test="page_sql!=null">
@@ -1050,7 +1050,7 @@
 	 </select>
 	 <select id="getExperts" resultType="com.goafanti.user.bo.UserIdentityBo">
 	 	select 	t.id ,t.uid,u.identify_name as username,t.work_unit as workUnit,t.province,t.area,t.professional_title as professionalTitle,t.industry,t.city,
-			u.introduction,u.head_portrait_url as headPortraitUrl,ifnull(o.x,0) as reservationCount
+			u.type,u.introduction,u.head_portrait_url as headPortraitUrl,ifnull(o.x,0) as reservationCount
 	from user_identity t left JOIN user u on t.uid = u.id
 	left join (select count(0) as x,seller_id from t_order
 				where order_status != 4

文件差异内容过多而无法显示
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html