|
|
@@ -1,8 +1,6 @@
|
|
|
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;
|
|
|
@@ -12,34 +10,23 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import com.goafanti.achievement.bo.AchievementPartnerListBo;
|
|
|
import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.banners.enums.BannersType;
|
|
|
import com.goafanti.banners.service.BannersService;
|
|
|
-import com.goafanti.common.enums.AchievementMaturity;
|
|
|
import com.goafanti.common.enums.MarketingPage;
|
|
|
-import com.goafanti.common.enums.UserType;
|
|
|
import com.goafanti.common.model.Banners;
|
|
|
-import com.goafanti.common.service.DistrictGlossoryService;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
import com.goafanti.marketing.bo.MarketingManagementBo;
|
|
|
import com.goafanti.marketing.service.MarketingManagementService;
|
|
|
-import com.goafanti.user.bo.UserPartnerDetailBo;
|
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
|
import com.goafanti.user.service.UserIdentityService;
|
|
|
-import com.goafanti.user.service.UserService;
|
|
|
import com.goafanti.news.bo.NewsPortalList;
|
|
|
import com.goafanti.news.enums.NewsType;
|
|
|
import com.goafanti.news.service.NewsService;
|
|
|
|
|
|
@Controller
|
|
|
public class WebpageController extends BaseController {
|
|
|
- @Resource
|
|
|
- private UserService userService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private DistrictGlossoryService districtglossoryservice;
|
|
|
|
|
|
@Resource
|
|
|
private DemandService demandService;
|
|
|
@@ -126,84 +113,6 @@ public class WebpageController extends BaseController {
|
|
|
return modelview;
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/user/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;
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
@RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
|
|
|
public ModelAndView userServices(HttpServletRequest request, ModelAndView modelview) {
|
|
|
modelview.setViewName("/user/account/services");
|