WebpageController.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. package com.goafanti.common.controller;
  2. import java.util.List;
  3. import javax.annotation.Resource;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.validation.constraints.Min;
  6. import org.apache.commons.fileupload.util.LimitedInputStream;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RequestMethod;
  10. import org.springframework.web.servlet.ModelAndView;
  11. import com.goafanti.achievement.bo.AchievementListBo;
  12. import com.goafanti.achievement.service.AchievementService;
  13. import com.goafanti.banners.enums.BannersType;
  14. import com.goafanti.banners.service.BannersService;
  15. import com.goafanti.common.bo.PolicyEntity;
  16. import com.goafanti.common.bo.fieldGlossoryBo;
  17. import com.goafanti.common.constant.PageConstants;
  18. import com.goafanti.common.model.Banners;
  19. import com.goafanti.common.model.Demand;
  20. import com.goafanti.common.utils.LimitLengthUtil;
  21. import com.goafanti.common.utils.StringUtils;
  22. import com.goafanti.core.shiro.token.TokenManager;
  23. import com.goafanti.demand.bo.DemandListBo;
  24. import com.goafanti.demand.service.DemandService;
  25. import com.goafanti.user.service.OrganizationIdentityService;
  26. import com.goafanti.user.service.UserIdentityService;
  27. import com.goafanti.news.bo.NewsPortalList;
  28. import com.goafanti.news.enums.NewsType;
  29. import com.goafanti.news.service.NewsService;
  30. import com.goafanti.portal.bo.AchievementObject;
  31. @Controller
  32. public class WebpageController extends BaseController {
  33. @Resource
  34. private DemandService demandService;
  35. @Resource
  36. private AchievementService achievementService;
  37. @Resource
  38. private BannersService bannersService;
  39. @Resource
  40. private UserIdentityService userIdentityService;
  41. @Resource
  42. private OrganizationIdentityService organizationIdentityService;
  43. @Resource
  44. private NewsService newsService;
  45. @RequestMapping(value = "/user/account/index", method = RequestMethod.GET)
  46. public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
  47. modelview.setViewName("/user/account/index");
  48. return modelview;
  49. }
  50. @RequestMapping(value = "/user/account/evaluateInfo", method = RequestMethod.GET)
  51. public ModelAndView evaluateInfo(HttpServletRequest request, ModelAndView modelview) {
  52. modelview.setViewName("/user/account/evaluateInfo");
  53. return modelview;
  54. }
  55. @RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
  56. public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
  57. modelview.setViewName("/user/account/set");
  58. return modelview;
  59. }
  60. @RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
  61. public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
  62. modelview.setViewName("/user/account/achievement");
  63. return modelview;
  64. }
  65. @RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
  66. public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
  67. modelview.setViewName("/user/account/demand");
  68. return modelview;
  69. }
  70. @RequestMapping(value = "/user/login", method = RequestMethod.GET)
  71. public String userLogin(HttpServletRequest request, ModelAndView modelview) {
  72. return "/user/login";
  73. }
  74. @RequestMapping(value = "/user/logout", method = RequestMethod.GET)
  75. public String userLogout(HttpServletRequest request, ModelAndView modelview) {
  76. TokenManager.logout();
  77. // return userLogin(request, modelview);
  78. return "redirect:/portal/index";
  79. }
  80. @RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
  81. public String userSignin(HttpServletRequest request, ModelAndView modelview) {
  82. return "/user/signIn";
  83. }
  84. @RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
  85. public String mSignin(HttpServletRequest request, ModelAndView modelview) {
  86. return "/user/msignIn";
  87. }
  88. @RequestMapping(value = "/user/certify", method = RequestMethod.GET)
  89. public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
  90. modelview.setViewName("/user/certify");
  91. return modelview;
  92. }
  93. @RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
  94. public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
  95. modelview.setViewName("/user/groupCertify");
  96. return modelview;
  97. }
  98. @RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
  99. public ModelAndView userServices(HttpServletRequest request, ModelAndView modelview) {
  100. modelview.setViewName("/user/account/services");
  101. return modelview;
  102. }
  103. @RequestMapping(value = "/admin/login", method = RequestMethod.GET)
  104. public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
  105. return "/admin/login";
  106. }
  107. @RequestMapping(value = "/admin/demand", method = RequestMethod.GET)
  108. public String adminDemand(HttpServletRequest request, ModelAndView modelview) {
  109. return "/admin/demand";
  110. }
  111. @RequestMapping(value = "/admin/achievement", method = RequestMethod.GET)
  112. public String adminAchievement(HttpServletRequest request, ModelAndView modelview) {
  113. return "/admin/achievement";
  114. }
  115. @RequestMapping(value = "/admin/set", method = RequestMethod.GET)
  116. public String adminSet(HttpServletRequest request, ModelAndView modelview) {
  117. return "/admin/set";
  118. }
  119. @RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
  120. public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
  121. modelview.setViewName("/admin/userManage");
  122. return modelview;
  123. }
  124. @RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
  125. public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
  126. modelview.setViewName("/admin/customer");
  127. return modelview;
  128. }
  129. @RequestMapping(value = "/admin/servicesManage/technology", method = RequestMethod.GET)
  130. public ModelAndView adminServicesManageTechnology(HttpServletRequest request, ModelAndView modelview) {
  131. modelview.setViewName("/admin/servicesManage/technology");
  132. return modelview;
  133. }
  134. @RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
  135. public ModelAndView adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
  136. modelview.setViewName("/admin/servicesManage/patent");
  137. return modelview;
  138. }
  139. @RequestMapping(value = "/admin/servicesManage/contract", method = RequestMethod.GET)
  140. public ModelAndView adminServicesManageContract(HttpServletRequest request, ModelAndView modelview) {
  141. modelview.setViewName("/admin/servicesManage/contract");
  142. return modelview;
  143. }
  144. @RequestMapping(value = "/admin/servicesManage/highTech", method = RequestMethod.GET)
  145. public ModelAndView adminServicesManageHighTech(HttpServletRequest request, ModelAndView modelview) {
  146. modelview.setViewName("/admin/servicesManage/highTech");
  147. return modelview;
  148. }
  149. @RequestMapping(value = "/admin/servicesManage/copyright", method = RequestMethod.GET)
  150. public ModelAndView adminServicesManageCopyright(HttpServletRequest request, ModelAndView modelview) {
  151. modelview.setViewName("/admin/servicesManage/copyright");
  152. return modelview;
  153. }
  154. @RequestMapping(value = "/admin/servicesManage/projectOrder", method = RequestMethod.GET)
  155. public ModelAndView adminServiceManageProjectOrder(HttpServletRequest request, ModelAndView modelview) {
  156. modelview.setViewName("/admin/servicesManage/projectOrder");
  157. return modelview;
  158. }
  159. @RequestMapping(value = "/admin/index", method = RequestMethod.GET)
  160. public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
  161. modelview.setViewName("/admin/index");
  162. return modelview;
  163. }
  164. @RequestMapping(value = "/admin/idea", method = RequestMethod.GET)
  165. public ModelAndView adminIdea(HttpServletRequest request, ModelAndView modelview) {
  166. modelview.setViewName("/admin/idea");
  167. return modelview;
  168. }
  169. @RequestMapping(value = "/admin/userOrder", method = RequestMethod.GET)
  170. public ModelAndView adminUserOrder(HttpServletRequest request, ModelAndView modelview) {
  171. modelview.setViewName("/admin/userOrder");
  172. return modelview;
  173. }
  174. @RequestMapping(value = "/admin/order", method = RequestMethod.GET)
  175. public ModelAndView adminOrder(HttpServletRequest request, ModelAndView modelview) {
  176. modelview.setViewName("/admin/order");
  177. return modelview;
  178. }
  179. @RequestMapping(value = "/admin/operate", method = RequestMethod.GET)
  180. public ModelAndView adminOperate(HttpServletRequest request, ModelAndView modelview) {
  181. modelview.setViewName("/admin/operate");
  182. return modelview;
  183. }
  184. @RequestMapping(value = "/portal/membership", method = RequestMethod.GET)
  185. public ModelAndView membership(HttpServletRequest request, ModelAndView modelview) {
  186. modelview.setViewName("/portal/membership");
  187. return modelview;
  188. }
  189. @RequestMapping(value = "/portal/search/subscriberUser", method = RequestMethod.GET)
  190. public ModelAndView portalSearchSubscriberUser(HttpServletRequest request, ModelAndView modelview) {
  191. modelview.setViewName("/portal/search/subscriberUser");
  192. return modelview;
  193. }
  194. @RequestMapping(value = "/portal/search/subscriberOrg", method = RequestMethod.GET)
  195. public ModelAndView portalSearchSubscriberOrg(HttpServletRequest request, ModelAndView modelview) {
  196. modelview.setViewName("/portal/search/subscriberOrg");
  197. return modelview;
  198. }
  199. /**
  200. * 评估页
  201. */
  202. @RequestMapping(value = "/portal/evaluation/index", method = RequestMethod.GET)
  203. public ModelAndView evaluation(HttpServletRequest request, ModelAndView modelview) {
  204. modelview.setViewName("/portal/evaluation/index");
  205. handleBanners(modelview, BannersType.JI_SHU_PING_GU);
  206. return modelview;
  207. }
  208. /**
  209. * 服务汇
  210. */
  211. @RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
  212. public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
  213. modelview.setViewName("/portal/service/serviceIndex");
  214. handleBanners(modelview, BannersType.FU_WU_HUI);
  215. return modelview;
  216. }
  217. /**
  218. * 知识产权
  219. *
  220. * @param request
  221. * @param modelview
  222. * @return
  223. */
  224. @RequestMapping(value = "/portal/service/propertyRight", method = RequestMethod.GET)
  225. public ModelAndView propertyRight(HttpServletRequest request, ModelAndView modelview) {
  226. modelview.setViewName("/portal/service/propertyRight");
  227. return modelview;
  228. }
  229. /**
  230. * 高企认定
  231. *
  232. * @param request
  233. * @param modelview
  234. * @return
  235. */
  236. @RequestMapping(value = "/portal/service/highTechCognizance", method = RequestMethod.GET)
  237. public ModelAndView highTechCognizance(HttpServletRequest request, ModelAndView modelview) {
  238. modelview.setViewName("/portal/service/highTechCognizance");
  239. return modelview;
  240. }
  241. /**
  242. * 技术交易
  243. */
  244. @RequestMapping(value = "/portal/technologyTrading/index", method = RequestMethod.GET)
  245. public ModelAndView portalTechnologyTradingIndex(HttpServletRequest request, ModelAndView modelview) {
  246. modelview.setViewName("/portal/technologyTrading/index");
  247. handleBanners(modelview, BannersType.JI_SHU_JIAO_YI);
  248. List<NewsPortalList> newsPortalList = newsService.portalNewsPolicy();
  249. modelview.addObject("newsPortalList", newsPortalList);
  250. List<NewsPortalList> portalNewsQuestion = newsService.portalNewsQuestion();
  251. modelview.addObject("portalNewsQuestion", portalNewsQuestion);
  252. return modelview;
  253. }
  254. /**
  255. *
  256. * 智库咨询
  257. *
  258. * @param request
  259. * @param modelview
  260. * @return
  261. */
  262. @RequestMapping(value = "/portal/thinkTank/index", method = RequestMethod.GET)
  263. public ModelAndView thinkTank(HttpServletRequest request, ModelAndView modelview) {
  264. modelview.setViewName("/portal/thinkTank/index");
  265. return modelview;
  266. }
  267. /**
  268. * 政策列表
  269. *
  270. * @return
  271. */
  272. @SuppressWarnings("unchecked")
  273. @RequestMapping(value = "/portal/thinkTank/policyList", method = RequestMethod.GET)
  274. public ModelAndView policyList(ModelAndView modelview) {
  275. modelview.setViewName("/portal/thinkTank/policyList");
  276. List<NewsPortalList> newsList = (List<NewsPortalList>) newsService.portalNewsList(5, 1, null, null, null, null)
  277. .getList();
  278. modelview.addObject("newsList", newsList);
  279. return modelview;
  280. }
  281. /**
  282. * 会员介绍
  283. *
  284. * @param request
  285. * @param modelview
  286. * @return
  287. */
  288. @RequestMapping(value = "/portal/member")
  289. public ModelAndView member(HttpServletRequest request, ModelAndView modelview) {
  290. modelview.setViewName("/portal/member");
  291. return modelview;
  292. }
  293. /**
  294. * 技术评估
  295. *
  296. * @param request
  297. * @param modelview
  298. * @return
  299. */
  300. @RequestMapping(value = "/portal/technologyTrading/assessMent")
  301. public ModelAndView assessMent(HttpServletRequest request, ModelAndView modelview) {
  302. modelview.setViewName("/portal/technologyTrading/assessMent");
  303. modelview.addObject("zcfg", newsService.findIndexNewsList(0, NewsType.KJZX.getCode(), 4));
  304. return modelview;
  305. }
  306. /**
  307. * 关于我们
  308. *
  309. * @param request
  310. * @param modelview
  311. * @return
  312. */
  313. @RequestMapping(value = "/portal/aboutUs", method = RequestMethod.GET)
  314. public ModelAndView aboutUs(HttpServletRequest request, ModelAndView modelview) {
  315. modelview.setViewName("/portal/aboutUs");
  316. return modelview;
  317. }
  318. /**
  319. * 联系我们
  320. *
  321. * @param request
  322. * @param modelview
  323. * @return
  324. */
  325. @RequestMapping(value = "/portal/contactUs", method = RequestMethod.GET)
  326. public ModelAndView contactUs(HttpServletRequest request, ModelAndView modelview) {
  327. modelview.setViewName("/portal/contactUs");
  328. return modelview;
  329. }
  330. private void handleBanners(ModelAndView modelview, BannersType bannersType) {
  331. List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
  332. if (!banners.isEmpty()) {
  333. modelview.addObject("banners", banners);
  334. }
  335. }
  336. /**
  337. * 服务-推荐
  338. *
  339. * @param request
  340. * @param modelview
  341. * @return
  342. */
  343. @RequestMapping(value = "/portal/service/recommended")
  344. public ModelAndView recommended(HttpServletRequest request, ModelAndView modelview) {
  345. modelview.setViewName("/portal/service/recommended");
  346. return modelview;
  347. }
  348. /*
  349. * 技淘3.0-科技需求页
  350. * @param request
  351. * @param modelview
  352. * @return
  353. *
  354. * */
  355. //需求首页
  356. @RequestMapping(value = "/portal/technologyTrading/demand")
  357. public ModelAndView demand(HttpServletRequest request, ModelAndView modelview) {
  358. String showLocation="web_demand_main";
  359. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  360. modelview.setViewName("/portal/technologyTrading/demand");
  361. //行业
  362. List<fieldGlossoryBo> industryList = userIdentityService.industryList();
  363. modelview.addObject("industryList", industryList);
  364. //最新需求
  365. List<DemandListBo> recentDemandList=demandService.recentDemand(5,url,showLocation);
  366. LimitLengthUtil.limiteDemandCompanyAndName(recentDemandList, 18, 18);
  367. modelview.addObject("recentDemandList",recentDemandList);
  368. //
  369. // //加急需求
  370. List<DemandListBo> urgentDemand=demandService.getUrgentDemand(5,url,showLocation);
  371. List<DemandListBo> urgentDemand2=urgentDemand.subList(0, Math.min(2, urgentDemand.size()));
  372. List<DemandListBo> urgentDemand3=urgentDemand.subList( Math.min(2, urgentDemand.size()), Math.min(5, urgentDemand.size()));
  373. System.out.print("u2:"+urgentDemand2.size()+" u3:"+urgentDemand3.size());
  374. LimitLengthUtil.limiteDemandLength(urgentDemand2,13,30);
  375. LimitLengthUtil.limiteDemandLength(urgentDemand3,13,33);
  376. modelview.addObject("urgentDemand2",urgentDemand2);
  377. modelview.addObject("urgentDemand3",urgentDemand3);
  378. //热点需求
  379. List<DemandListBo> hotDemand=demandService.getHotDemand(5,url,showLocation);
  380. List<DemandListBo> hotDemand2=hotDemand.subList(0, Math.min(2, hotDemand.size()));
  381. List<DemandListBo> hotDemand3=hotDemand.subList( Math.min(2, hotDemand.size()), Math.min(5, hotDemand.size()));
  382. System.out.print("u2:"+hotDemand2.size()+" u3:"+hotDemand3.size());
  383. LimitLengthUtil.limiteDemandLength(hotDemand2,13,30);
  384. LimitLengthUtil.limiteDemandLength(hotDemand3,13,33);
  385. modelview.addObject("hotDemand2",hotDemand2);
  386. modelview.addObject("hotDemand3",hotDemand3);
  387. //企业技术需求
  388. List<DemandListBo> eightMaxCompanyDemand=demandService.companyDemand(8,url,showLocation);
  389. for(DemandListBo demandListBo:eightMaxCompanyDemand) {
  390. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  391. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  392. }
  393. modelview.addObject("companyDemandList",eightMaxCompanyDemand);
  394. //地区产业需求 最多4个
  395. List<DemandListBo> fourMaxareaDemand=demandService.areaDemand(4,url,showLocation);
  396. for(DemandListBo demandListBo:fourMaxareaDemand) {
  397. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  398. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  399. }
  400. LimitLengthUtil.limiteDemandLength(fourMaxareaDemand,10,208);
  401. modelview.addObject("areaDemandList",fourMaxareaDemand);
  402. //产学研需求 最多9个
  403. List<DemandListBo> nightMaxProLearnStudyDemand=demandService.proLearnStudyDemand(9,url,showLocation);
  404. for(DemandListBo demandListBo:nightMaxProLearnStudyDemand) {
  405. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  406. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  407. }
  408. LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand,10,208);
  409. LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 208);
  410. modelview.addObject("proLearnStudyDemandList",nightMaxProLearnStudyDemand);
  411. //研产资金需求 最多4个
  412. List<DemandListBo> fourMaxFundDemand=demandService.getFundCrowdDemand(4,url,showLocation);
  413. for(DemandListBo demandListBo:fourMaxFundDemand) {
  414. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  415. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  416. }
  417. LimitLengthUtil.limiteDemandLength(fourMaxFundDemand,9,30);
  418. modelview.addObject("fundDemandList",fourMaxFundDemand);
  419. //技术人才需求
  420. List<DemandListBo> sixMaxPersonnelDemand=demandService.getPersonnelDemand(6,url,showLocation);
  421. // List <DemandListBo>fourMaxPersonnelDemand=personnelDemand.subList(0,Math.min(6, personnelDemand.size()));
  422. for(DemandListBo demandListBo:sixMaxPersonnelDemand) {
  423. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  424. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  425. }
  426. LimitLengthUtil.limiteDemandLength(sixMaxPersonnelDemand,7,30);
  427. modelview.addObject("personnelDemandList",sixMaxPersonnelDemand);
  428. return modelview;
  429. }
  430. //需求详情
  431. @RequestMapping(value = "/portal/technologyTrading/demandDetail")
  432. public ModelAndView DemandDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  433. String url=StringUtils.getDomainByHttpRequest(request);
  434. //详情
  435. DemandListBo demand=demandService.getDemandDetail(id, type);
  436. int countInterest=demandService.getInterestCount(id);
  437. demand.setCountInterest(countInterest+"");
  438. modelAndView.addObject("demand",demand);
  439. //精品需求
  440. List<DemandListBo>boutiqueDemandList=LimitLengthUtil.LimitListLengthRandomly(demandService.getBoutiqueDemandList(10,url,""),3,10);
  441. modelAndView.addObject("reboutiquedemand",boutiqueDemandList);
  442. //猜你喜欢
  443. List<DemandListBo>guessYouLikeList=LimitLengthUtil.LimitListLengthRandomly(demandService.recentDemand(10, url,""), 4, 10);
  444. modelAndView.addObject("redemandlist",guessYouLikeList);
  445. //view
  446. modelAndView.setViewName("/portal/technologyTrading/demandDetail");
  447. return modelAndView;
  448. }
  449. //成果首页
  450. @RequestMapping(value = "/portal/technologyTrading/achievement", method = RequestMethod.GET)
  451. public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
  452. String showLocation="web_achievement_main";
  453. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  454. modelview.setViewName("/portal/technologyTrading/achievement");
  455. //行业
  456. List<fieldGlossoryBo> industryList = userIdentityService.industryList();
  457. modelview.addObject("industryList", industryList);
  458. //最新成果
  459. List<AchievementObject>recentAchievements=achievementService.recentAchievements(5,url,showLocation);
  460. modelview.addObject("recentAchievements",recentAchievements);
  461. //热门关注
  462. List<AchievementObject> hotAchievements=achievementService.getHotAchievements(6,url,showLocation);
  463. modelview.addObject("hotAchievements",hotAchievements);
  464. //专利
  465. List<AchievementObject>patentAchievements=achievementService.getPatentList(9,url,showLocation);
  466. modelview.addObject("patents",patentAchievements);
  467. //实用技术
  468. List<AchievementObject>practicalTechnology=achievementService.getPracticalTechnologys(8,url,showLocation);
  469. modelview.addObject("practicalTechnology",practicalTechnology);
  470. List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
  471. modelview.addObject("policyList",intellectualPropertyPolicyList);
  472. return modelview;
  473. }
  474. @RequestMapping(value = "/portal/technologyTrading/achievementDetail")
  475. public ModelAndView achievementDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  476. //详情
  477. AchievementObject achievementObject=achievementService.getAchievementDetail(id,type);
  478. modelAndView.addObject("achievementdetail",achievementObject);
  479. //精品
  480. List<AchievementObject>boutiques=LimitLengthUtil.LimitListLengthRandomly(achievementService.getBoutiquePatent(10),3,10);
  481. modelAndView.addObject("reboutiqueachievement",boutiques);
  482. //猜你喜欢
  483. List<AchievementObject> guess =LimitLengthUtil.LimitListLengthRandomly(achievementService.guessYouLike(10), 4, 10);
  484. modelAndView.addObject("guess",guess);
  485. //view
  486. modelAndView.setViewName("/portal/technologyTrading/achievementDetail");
  487. return modelAndView;
  488. }
  489. }