WebpageController.java 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. package com.goafanti.common.controller;
  2. import java.util.ArrayList;
  3. import java.util.Arrays;
  4. import java.util.Date;
  5. import java.util.List;
  6. import javax.annotation.Resource;
  7. import javax.servlet.http.HttpServletRequest;
  8. import org.apache.commons.lang3.time.DateFormatUtils;
  9. import org.springframework.stereotype.Controller;
  10. import org.springframework.ui.Model;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RequestMethod;
  13. import org.springframework.web.bind.annotation.ResponseBody;
  14. import org.springframework.web.servlet.ModelAndView;
  15. import com.goafanti.achievement.service.AchievementInterestService;
  16. import com.goafanti.achievement.service.AchievementService;
  17. import com.goafanti.app.bo.consultantListBo;
  18. import com.goafanti.banners.enums.BannersType;
  19. import com.goafanti.banners.service.BannersService;
  20. import com.goafanti.business.bo.JtBusinessCategoryBo;
  21. import com.goafanti.business.bo.JtBusinessCategoryTree;
  22. import com.goafanti.business.bo.JtBusinessProjectResult;
  23. import com.goafanti.business.service.JtBusinessService;
  24. import com.goafanti.common.bo.PolicyEntity;
  25. import com.goafanti.common.bo.Result;
  26. import com.goafanti.common.bo.fieldGlossoryBo;
  27. import com.goafanti.common.constant.AFTConstants;
  28. import com.goafanti.common.constant.PageConstants;
  29. import com.goafanti.common.dao.ProjectInterestMapper;
  30. import com.goafanti.common.model.Achievement;
  31. import com.goafanti.common.model.AchievementInterest;
  32. import com.goafanti.common.model.Banners;
  33. import com.goafanti.common.model.Demand;
  34. import com.goafanti.common.model.DemandInterest;
  35. import com.goafanti.common.model.IndustryCategory;
  36. import com.goafanti.common.model.JtBusinessCategory;
  37. import com.goafanti.common.model.JtBusinessProject;
  38. import com.goafanti.common.model.News;
  39. import com.goafanti.common.model.Policy;
  40. import com.goafanti.common.model.ProjectInterest;
  41. import com.goafanti.common.model.User;
  42. import com.goafanti.common.utils.LimitLengthUtil;
  43. import com.goafanti.common.utils.StringUtils;
  44. import com.goafanti.core.mybatis.page.Pagination;
  45. import com.goafanti.core.shiro.token.TokenManager;
  46. import com.goafanti.demand.bo.DemandListBo;
  47. import com.goafanti.demand.service.DemandInterestService;
  48. import com.goafanti.demand.service.DemandService;
  49. import com.goafanti.user.bo.OrgIdentityBo;
  50. import com.goafanti.user.bo.UserIdentityBo;
  51. import com.goafanti.user.service.OrganizationIdentityService;
  52. import com.goafanti.user.service.UserIdentityService;
  53. import com.goafanti.user.service.UserService;
  54. import com.mysql.fabric.xmlrpc.base.Array;
  55. import com.goafanti.news.bo.NewsPortalList;
  56. import com.goafanti.news.bo.PolicyResult;
  57. import com.goafanti.news.enums.NewsType;
  58. import com.goafanti.news.service.NewsService;
  59. import com.goafanti.news.service.PolicyService;
  60. import com.goafanti.portal.bo.AchievementObject;
  61. @Controller
  62. public class WebpageController extends BaseController {
  63. @Resource
  64. private DemandService demandService;
  65. @Resource
  66. private AchievementService achievementService;
  67. @Resource
  68. private BannersService bannersService;
  69. @Resource
  70. private UserIdentityService userIdentityService;
  71. @Resource
  72. private OrganizationIdentityService organizationIdentityService;
  73. @Resource
  74. private NewsService newsService;
  75. @Resource
  76. private PolicyService policyService;
  77. @Resource
  78. private JtBusinessService jtBusinessService;
  79. @Resource
  80. private UserService userService;
  81. @Resource
  82. private AchievementInterestService achievementInterestService;
  83. @Resource
  84. private DemandInterestService demandInterestService;
  85. @Resource
  86. private ProjectInterestMapper projectInterestMapper;
  87. @RequestMapping(value = "/user/account/index", method = RequestMethod.GET)
  88. public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
  89. modelview.setViewName("/user/account/index");
  90. return modelview;
  91. }
  92. @RequestMapping(value = "/user/account/evaluateInfo", method = RequestMethod.GET)
  93. public ModelAndView evaluateInfo(HttpServletRequest request, ModelAndView modelview) {
  94. modelview.setViewName("/user/account/evaluateInfo");
  95. return modelview;
  96. }
  97. @RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
  98. public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
  99. modelview.setViewName("/user/account/set");
  100. return modelview;
  101. }
  102. @RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
  103. public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
  104. modelview.setViewName("/user/account/achievement");
  105. return modelview;
  106. }
  107. @RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
  108. public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
  109. modelview.setViewName("/user/account/demand");
  110. return modelview;
  111. }
  112. @RequestMapping(value = "/user/login", method = RequestMethod.GET)
  113. public String userLogin(HttpServletRequest request, ModelAndView modelview) {
  114. return "/user/login";
  115. }
  116. @RequestMapping(value = "/user/logout", method = RequestMethod.GET)
  117. public String userLogout(HttpServletRequest request, ModelAndView modelview) {
  118. TokenManager.logout();
  119. // return userLogin(request, modelview);
  120. return "redirect:/portal/index";
  121. }
  122. @RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
  123. public String userSignin(HttpServletRequest request, ModelAndView modelview) {
  124. return "/user/signIn";
  125. }
  126. @RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
  127. public String mSignin(HttpServletRequest request, ModelAndView modelview) {
  128. return "/user/msignIn";
  129. }
  130. @RequestMapping(value = "/user/certify", method = RequestMethod.GET)
  131. public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
  132. modelview.setViewName("/user/certify");
  133. return modelview;
  134. }
  135. @RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
  136. public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
  137. modelview.setViewName("/user/groupCertify");
  138. return modelview;
  139. }
  140. @RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
  141. public ModelAndView userServices(HttpServletRequest request, ModelAndView modelview) {
  142. modelview.setViewName("/user/account/services");
  143. return modelview;
  144. }
  145. @RequestMapping(value = "/admin/login", method = RequestMethod.GET)
  146. public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
  147. return "/admin/login";
  148. }
  149. @RequestMapping(value = "/admin/demand", method = RequestMethod.GET)
  150. public String adminDemand(HttpServletRequest request, ModelAndView modelview) {
  151. return "/admin/demand";
  152. }
  153. @RequestMapping(value = "/admin/achievement", method = RequestMethod.GET)
  154. public String adminAchievement(HttpServletRequest request, ModelAndView modelview) {
  155. return "/admin/achievement";
  156. }
  157. @RequestMapping(value = "/admin/set", method = RequestMethod.GET)
  158. public String adminSet(HttpServletRequest request, ModelAndView modelview) {
  159. return "/admin/set";
  160. }
  161. @RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
  162. public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
  163. modelview.setViewName("/admin/userManage");
  164. return modelview;
  165. }
  166. @RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
  167. public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
  168. modelview.setViewName("/admin/customer");
  169. return modelview;
  170. }
  171. @RequestMapping(value = "/admin/servicesManage/technology", method = RequestMethod.GET)
  172. public ModelAndView adminServicesManageTechnology(HttpServletRequest request, ModelAndView modelview) {
  173. modelview.setViewName("/admin/servicesManage/technology");
  174. return modelview;
  175. }
  176. @RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
  177. public ModelAndView adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
  178. modelview.setViewName("/admin/servicesManage/patent");
  179. return modelview;
  180. }
  181. @RequestMapping(value = "/admin/servicesManage/contract", method = RequestMethod.GET)
  182. public ModelAndView adminServicesManageContract(HttpServletRequest request, ModelAndView modelview) {
  183. modelview.setViewName("/admin/servicesManage/contract");
  184. return modelview;
  185. }
  186. @RequestMapping(value = "/admin/servicesManage/highTech", method = RequestMethod.GET)
  187. public ModelAndView adminServicesManageHighTech(HttpServletRequest request, ModelAndView modelview) {
  188. modelview.setViewName("/admin/servicesManage/highTech");
  189. return modelview;
  190. }
  191. @RequestMapping(value = "/admin/servicesManage/copyright", method = RequestMethod.GET)
  192. public ModelAndView adminServicesManageCopyright(HttpServletRequest request, ModelAndView modelview) {
  193. modelview.setViewName("/admin/servicesManage/copyright");
  194. return modelview;
  195. }
  196. @RequestMapping(value = "/admin/servicesManage/projectOrder", method = RequestMethod.GET)
  197. public ModelAndView adminServiceManageProjectOrder(HttpServletRequest request, ModelAndView modelview) {
  198. modelview.setViewName("/admin/servicesManage/projectOrder");
  199. return modelview;
  200. }
  201. @RequestMapping(value = "/admin/index", method = RequestMethod.GET)
  202. public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
  203. modelview.setViewName("/admin/index");
  204. return modelview;
  205. }
  206. @RequestMapping(value = "/admin/idea", method = RequestMethod.GET)
  207. public ModelAndView adminIdea(HttpServletRequest request, ModelAndView modelview) {
  208. modelview.setViewName("/admin/idea");
  209. return modelview;
  210. }
  211. @RequestMapping(value = "/admin/userOrder", method = RequestMethod.GET)
  212. public ModelAndView adminUserOrder(HttpServletRequest request, ModelAndView modelview) {
  213. modelview.setViewName("/admin/userOrder");
  214. return modelview;
  215. }
  216. @RequestMapping(value = "/portal/continueHigh", method = RequestMethod.GET)
  217. public ModelAndView portalContinueHigh(HttpServletRequest request, ModelAndView modelview) {
  218. modelview.setViewName("/portal/continueHigh");
  219. return modelview;
  220. }
  221. @RequestMapping(value = "/portal/militaryProject", method = RequestMethod.GET)
  222. public ModelAndView portalMilitaryProject(HttpServletRequest request, ModelAndView modelview) {
  223. modelview.setViewName("/portal/militaryProject");
  224. return modelview;
  225. }
  226. @RequestMapping(value = "/portal/practicalPatent", method = RequestMethod.GET)
  227. public ModelAndView portalPracticalPatent(HttpServletRequest request, ModelAndView modelview) {
  228. modelview.setViewName("/portal/practicalPatent");
  229. return modelview;
  230. }
  231. @RequestMapping(value = "/admin/order", method = RequestMethod.GET)
  232. public ModelAndView adminOrder(HttpServletRequest request, ModelAndView modelview) {
  233. modelview.setViewName("/admin/order");
  234. return modelview;
  235. }
  236. @RequestMapping(value = "/admin/operate", method = RequestMethod.GET)
  237. public ModelAndView adminOperate(HttpServletRequest request, ModelAndView modelview) {
  238. modelview.setViewName("/admin/operate");
  239. return modelview;
  240. }
  241. @RequestMapping(value = "/portal/membership", method = RequestMethod.GET)
  242. public ModelAndView membership(HttpServletRequest request, ModelAndView modelview) {
  243. modelview.setViewName("/portal/membership");
  244. return modelview;
  245. }
  246. @RequestMapping(value = "/portal/search/subscriberUser", method = RequestMethod.GET)
  247. public ModelAndView portalSearchSubscriberUser(HttpServletRequest request, ModelAndView modelview) {
  248. modelview.setViewName("/portal/search/subscriberUser");
  249. return modelview;
  250. }
  251. @RequestMapping(value = "/portal/search/subscriberOrg", method = RequestMethod.GET)
  252. public ModelAndView portalSearchSubscriberOrg(HttpServletRequest request, ModelAndView modelview) {
  253. modelview.setViewName("/portal/search/subscriberOrg");
  254. return modelview;
  255. }
  256. /**
  257. * 评估页
  258. */
  259. @RequestMapping(value = "/portal/evaluation/index", method = RequestMethod.GET)
  260. public ModelAndView evaluation(HttpServletRequest request, ModelAndView modelview) {
  261. modelview.setViewName("/portal/evaluation/index");
  262. handleBanners(modelview, BannersType.JI_SHU_PING_GU);
  263. return modelview;
  264. }
  265. /**
  266. * 服务汇
  267. */
  268. @SuppressWarnings("unchecked")
  269. @RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
  270. public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
  271. modelview.setViewName("/portal/service/serviceIndex");
  272. //政策
  273. // List<PolicyEntity>policyEntities=achievementService.getIntellectualProperty(8);
  274. List<PolicyResult>policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_tech_service_index", 1, 8).getList();
  275. modelview.addObject("policyList",policies);
  276. //新闻
  277. List<News>news=(List<News>) newsService.portalNewsList(5, 1, null, null, null, null,2).getList();
  278. modelview.addObject("newsList",news);
  279. //高企服务
  280. JtBusinessCategory gaoqi=jtBusinessService.getBusinessCategoryByLayerAndName(1, "高企服务");
  281. JtBusinessCategory gaoqi2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "高企服务");
  282. if(gaoqi2!=null)
  283. {
  284. List<JtBusinessProject>gaoqiList=jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(),6,null);
  285. for(JtBusinessProject project:gaoqiList) {
  286. if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
  287. }
  288. modelview.addObject("gaoqiList",gaoqiList);
  289. modelview.addObject("gqc1",gaoqi);}
  290. //知识产权贯标
  291. JtBusinessCategory zscqgb=jtBusinessService.getBusinessCategoryByLayerAndName(1, "知识产权");
  292. if(zscqgb!=null) {
  293. List<JtBusinessCategory> zscqgbCategories=jtBusinessService.getBusinessCategoryBySuperId(zscqgb.getId(), 4);
  294. int[]zscqsizes= {1,2,4,10};
  295. businessHelper(modelview, "zscqgb", zscqgbCategories, zscqsizes);
  296. modelview.addObject("zscqc1",zscqgb);}
  297. //企业认证
  298. JtBusinessCategory qiyerenzheng=jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业认证");
  299. if(qiyerenzheng!=null) {
  300. List<JtBusinessCategory>qyrzCategories=jtBusinessService.getBusinessCategoryBySuperId(qiyerenzheng.getId(), 2);
  301. int []qyrzsizes= {8,8};
  302. businessHelper(modelview, "qyrz", qyrzCategories, qyrzsizes);
  303. modelview.addObject("qyrzc1",qiyerenzheng);}
  304. //管理体系
  305. JtBusinessCategory manageSys=jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系");
  306. JtBusinessCategory manageSys2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系");
  307. if(manageSys2!=null) {
  308. List<JtBusinessProject>manageSysPro=jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(), 18,null);
  309. modelview.addObject("manageSystemList",manageSysPro);
  310. modelview.addObject("managerSysc1",manageSys);}
  311. //科技项目
  312. JtBusinessCategory scienceProject=jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
  313. JtBusinessCategory scienceProject2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "科技项目");
  314. if(scienceProject2!=null) {
  315. List<JtBusinessProject>scienceProjects=jtBusinessService.getBusinessProjectByCategoryId(scienceProject2.getId(), 12,AFTConstants.YES);
  316. modelview.addObject("scienceProjectList",scienceProjects);
  317. modelview.addObject("spc1",scienceProject);}
  318. //咨询师
  319. List<UserIdentityBo> userIdentityBos=userIdentityService.getExperts(8);
  320. // List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
  321. modelview.addObject("consultants",userIdentityBos);
  322. return modelview;
  323. }
  324. /*
  325. * 服务详情
  326. *
  327. * @param id String
  328. * */
  329. @RequestMapping(value = "/portal/service/serviceDetail", method = RequestMethod.GET)
  330. public ModelAndView portalServiceServiceDetail(HttpServletRequest request, ModelAndView modelview,String id) {
  331. modelview.setViewName("/portal/service/serviceDetails");
  332. JtBusinessProject jtBusinessProject=jtBusinessService.getBusinessProjectDetail(id);
  333. if(jtBusinessProject!=null) {
  334. if(jtBusinessProject.getMaxImgUrl()!=null && jtBusinessProject.getMaxImgUrl().length()<=0)jtBusinessProject.setMaxImgUrl(null);
  335. }
  336. if(jtBusinessProject.getCreateTime()!=null && 7>=differentDaysByMillisecond(jtBusinessProject.getCreateTime(),new Date())) {
  337. modelview.addObject("newly",true);
  338. }
  339. else modelview.addObject("newly",false);
  340. String owner="平台管理员";
  341. if(jtBusinessProject.getOwnerId()!=null) {
  342. User user=userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
  343. if(user!=null && user.getIdentifyName()!=null) {
  344. owner=user.getIdentifyName();
  345. }
  346. }
  347. modelview.addObject("owner",owner);
  348. modelview.addObject("pj",jtBusinessProject);
  349. System.out.println(jtBusinessProject.toString());
  350. if(jtBusinessProject!=null) {
  351. JtBusinessCategoryTree tree=jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
  352. modelview.addObject("tree",tree);}
  353. JtBusinessCategory jtBusinessCategory=jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
  354. if(jtBusinessCategory!=null && jtBusinessCategory.getModule()!=null)modelview.addObject("module",jtBusinessCategory.getModule());
  355. else modelview.addObject("module",0);
  356. //是否关注
  357. if(StringUtils.isNotBlank(TokenManager.getUserId())) {
  358. int projectInterest=projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
  359. if(projectInterest>0)modelview.addObject("interested",true);
  360. }
  361. return modelview;
  362. }
  363. /*
  364. * 服务详情2
  365. *
  366. * @param id String
  367. * */
  368. @RequestMapping(value = "/portal/service/patentDetail", method = RequestMethod.GET)
  369. public ModelAndView portalServicePatentDetail(HttpServletRequest request, ModelAndView modelview,String id) {
  370. modelview.setViewName("/portal/service/patenteDetails");
  371. JtBusinessProject jtBusinessProject=jtBusinessService.getBusinessProjectDetail(id);
  372. if(jtBusinessProject!=null) {
  373. if(jtBusinessProject.getMaxImgUrl()!=null && jtBusinessProject.getMaxImgUrl().length()<=0)jtBusinessProject.setMaxImgUrl(null);
  374. }
  375. if(jtBusinessProject.getCreateTime()!=null && 7>=differentDaysByMillisecond(jtBusinessProject.getCreateTime(),new Date())) {
  376. modelview.addObject("newly",true);
  377. }
  378. else modelview.addObject("newly",false);
  379. String owner="平台管理员";
  380. if(jtBusinessProject.getOwnerId()!=null) {
  381. User user=userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
  382. if(user!=null && user.getIdentifyName()!=null) {
  383. owner=user.getIdentifyName();
  384. }
  385. }
  386. modelview.addObject("owner",owner);
  387. modelview.addObject("pj",jtBusinessProject);
  388. System.out.println(jtBusinessProject.toString());
  389. if(jtBusinessProject!=null) {
  390. JtBusinessCategoryTree tree=jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
  391. modelview.addObject("tree",tree);}
  392. JtBusinessCategory jtBusinessCategory=jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
  393. if(jtBusinessCategory!=null && jtBusinessCategory.getModule()!=null)modelview.addObject("module",jtBusinessCategory.getModule());
  394. else modelview.addObject("module",0);
  395. //是否关注
  396. if(StringUtils.isNotBlank(TokenManager.getUserId())) {
  397. int projectInterest=projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
  398. if(projectInterest>0)modelview.addObject("interested",true);
  399. }
  400. return modelview;
  401. }
  402. @RequestMapping(value="/portal/service/serviceList",method=RequestMethod.GET)
  403. public ModelAndView serviceList(HttpServletRequest request, ModelAndView modelview) {
  404. modelview.setViewName("/portal/service/serviceList");
  405. return modelview;
  406. }
  407. @RequestMapping(value="/portal/technologyTrading/demandList",method=RequestMethod.GET)
  408. public ModelAndView demandList(HttpServletRequest request, ModelAndView modelview) {
  409. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  410. modelview.setViewName("/portal/technologyTrading/demandList");
  411. List<DemandListBo> boutiques=demandService.getHotDemand(3, url, "web_demand_list");
  412. modelview.addObject("boutiques",boutiques);
  413. return modelview;
  414. }
  415. @RequestMapping(value="/portal/technologyTrading/achievementList",method=RequestMethod.GET)
  416. public ModelAndView achievementList(HttpServletRequest request, ModelAndView modelview) {
  417. modelview.setViewName("/portal/technologyTrading/achievementList");
  418. List<AchievementObject>boutiques=achievementService.getBoutiquePatent(3);
  419. modelview.addObject("boutiques",boutiques);
  420. return modelview;
  421. }
  422. /**
  423. * 知识产权
  424. *
  425. * @param request
  426. * @param modelview
  427. * @return
  428. */
  429. @RequestMapping(value = "/portal/service/propertyRight", method = RequestMethod.GET)
  430. public ModelAndView propertyRight(HttpServletRequest request, ModelAndView modelview) {
  431. modelview.setViewName("/portal/service/propertyRight");
  432. return modelview;
  433. }
  434. /**
  435. * 高企认定
  436. *
  437. * @param request
  438. * @param modelview
  439. * @return
  440. */
  441. @RequestMapping(value = "/portal/service/highTechCognizance", method = RequestMethod.GET)
  442. public ModelAndView highTechCognizance(HttpServletRequest request, ModelAndView modelview) {
  443. modelview.setViewName("/portal/service/highTechCognizance");
  444. return modelview;
  445. }
  446. /**
  447. * 技术交易
  448. */
  449. @RequestMapping(value = "/portal/technologyTrading/index", method = RequestMethod.GET)
  450. public ModelAndView portalTechnologyTradingIndex(HttpServletRequest request, ModelAndView modelview) {
  451. modelview.setViewName("/portal/technologyTrading/index");
  452. handleBanners(modelview, BannersType.JI_SHU_JIAO_YI);
  453. List<NewsPortalList> newsPortalList = newsService.portalNewsPolicy();
  454. modelview.addObject("newsPortalList", newsPortalList);
  455. List<NewsPortalList> portalNewsQuestion = newsService.portalNewsQuestion();
  456. modelview.addObject("portalNewsQuestion", portalNewsQuestion);
  457. return modelview;
  458. }
  459. /**
  460. *
  461. * 智库咨询
  462. *
  463. * @param request
  464. * @param modelview
  465. * @return
  466. */
  467. @RequestMapping(value = "/portal/thinkTank/index", method = RequestMethod.GET)
  468. public ModelAndView thinkTank(HttpServletRequest request, ModelAndView modelview) {
  469. modelview.setViewName("/portal/thinkTank/index");
  470. return modelview;
  471. }
  472. /**
  473. * 政策列表
  474. *
  475. * @return
  476. */
  477. @SuppressWarnings("unchecked")
  478. @RequestMapping(value = "/portal/thinkTank/policyList", method = RequestMethod.GET)
  479. public ModelAndView policyList(ModelAndView modelview) {
  480. modelview.setViewName("/portal/thinkTank/policyList");
  481. List<NewsPortalList> newsList = (List<NewsPortalList>) newsService.portalNewsList(5, 1, null, null, null, null,2)
  482. .getList();
  483. modelview.addObject("newsList", newsList);
  484. return modelview;
  485. }
  486. /**
  487. * 会员介绍
  488. *
  489. * @param request
  490. * @param modelview
  491. * @return
  492. */
  493. @RequestMapping(value = "/portal/member")
  494. public ModelAndView member(HttpServletRequest request, ModelAndView modelview) {
  495. modelview.setViewName("/portal/member");
  496. return modelview;
  497. }
  498. /**
  499. * 技术评估
  500. *
  501. * @param request
  502. * @param modelview
  503. * @return
  504. */
  505. @RequestMapping(value = "/portal/technologyTrading/assessMent")
  506. public ModelAndView assessMent(HttpServletRequest request, ModelAndView modelview) {
  507. modelview.setViewName("/portal/technologyTrading/assessMent");
  508. modelview.addObject("zcfg", newsService.findIndexNewsList(0, NewsType.KJZX.getCode(), 4));
  509. return modelview;
  510. }
  511. /**
  512. * 关于我们
  513. *
  514. * @param request
  515. * @param modelview
  516. * @return
  517. */
  518. @RequestMapping(value = "/portal/aboutUs", method = RequestMethod.GET)
  519. public ModelAndView aboutUs(HttpServletRequest request, ModelAndView modelview) {
  520. modelview.setViewName("/portal/aboutUs");
  521. return modelview;
  522. }
  523. /**
  524. * 联系我们
  525. *
  526. * @param request
  527. * @param modelview
  528. * @return
  529. */
  530. @RequestMapping(value = "/portal/contactUs", method = RequestMethod.GET)
  531. public ModelAndView contactUs(HttpServletRequest request, ModelAndView modelview) {
  532. modelview.setViewName("/portal/contactUs");
  533. return modelview;
  534. }
  535. private void handleBanners(ModelAndView modelview, BannersType bannersType) {
  536. List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
  537. if (!banners.isEmpty()) {
  538. modelview.addObject("banners", banners);
  539. }
  540. }
  541. /**
  542. * 服务-推荐
  543. *
  544. * @param request
  545. * @param modelview
  546. * @return
  547. */
  548. @RequestMapping(value = "/portal/service/recommended")
  549. public ModelAndView recommended(HttpServletRequest request, ModelAndView modelview) {
  550. modelview.setViewName("/portal/service/recommended");
  551. return modelview;
  552. }
  553. /*
  554. * 首页
  555. *
  556. * */
  557. @SuppressWarnings("unchecked")
  558. @RequestMapping(value = "/portal/index")
  559. public ModelAndView mainIndex(HttpServletRequest request, ModelAndView modelview) {
  560. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  561. modelview.setViewName("/portal/index");
  562. List<JtBusinessCategoryBo> patentCategory=jtBusinessService.getCategoryBoList(1);
  563. patentCategory=patentCategory.subList(0, Math.min(3, patentCategory.size()));
  564. modelview.addObject("patentCategory",patentCategory);
  565. List<JtBusinessProject> jtBusinessProjects=(List<JtBusinessProject>) jtBusinessService.getProjects(null, null, null, 5, 1, 1, 2, 0, 1,0,0,null).getList();
  566. for(JtBusinessProject project:jtBusinessProjects) {
  567. if(project.getMaxImgUrl()!=null && project.getMaxImgUrl().length()<=0)project.setMaxImgUrl(null);
  568. if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
  569. }
  570. modelview.addObject("projects",jtBusinessProjects);
  571. List<PolicyResult>policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_index", 1, 2).getList();
  572. modelview.addObject("policys",policies);
  573. List<News>newsList=(List<News>) newsService.listNews(0, null, null, null, null, null, 1, 1, 3, "2", null, "web_index").getList();
  574. modelview.addObject("news",newsList);
  575. //
  576. List<News> subscriptions=(List<News>) newsService.listNews(0, null, null, null, null, null, null, 1, 4, "2", null, "web_index").getList();
  577. modelview.addObject("subscription",subscriptions);
  578. if(subscriptions!=null && subscriptions.size()>0 && subscriptions.get(0).getSourceUrl()!=null && subscriptions.get(0).getSourceUrl().contains(".")) {
  579. modelview.addObject("videoUrl",subscriptions.get(0).getSourceUrl());
  580. }
  581. // List<AchievementObject> achievementObjects=achievementService.getHotAchievements(9, url, "web_index");
  582. // modelview.addObject("achievements",achievementObjects);
  583. //
  584. //
  585. //
  586. //
  587. // List<DemandListBo> demandListBos=demandService.getHotDemand(9, url, "web_index");
  588. // for(DemandListBo demandListBo:demandListBos) {
  589. // if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  590. // else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  591. // }
  592. // //专家
  593. // List<UserIdentityBo>aExperts=userIdentityService.getExperts(8);
  594. // for(UserIdentityBo u:aExperts) {
  595. // if(u.getHeadPortraitUrl()!=null && u.getHeadPortraitUrl().length()<=0) {
  596. // u.setHeadPortraitUrl(null);
  597. // }
  598. // }
  599. // modelview.addObject("experts",aExperts);
  600. // modelview.addObject("demands",demandListBos);
  601. return modelview;
  602. }
  603. /*
  604. * 技淘3.0-科技需求页
  605. * @param request
  606. * @param modelview
  607. * @return
  608. *
  609. * */
  610. //需求首页
  611. @RequestMapping(value = "/portal/technologyTrading/demand")
  612. public ModelAndView demand(HttpServletRequest request, ModelAndView modelview) {
  613. String showLocation="web_demand_main";
  614. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  615. modelview.setViewName("/portal/technologyTrading/demand");
  616. //行业
  617. List<fieldGlossoryBo> industryList = userIdentityService.domainList();
  618. modelview.addObject("industryList", industryList);
  619. //最新需求
  620. List<DemandListBo> recentDemandList=demandService.recentDemand(5,url,showLocation);
  621. LimitLengthUtil.limiteDemandCompanyAndName(recentDemandList, 18, 18);
  622. modelview.addObject("recentDemandList",recentDemandList);
  623. //
  624. // //加急需求
  625. List<DemandListBo> urgentDemand=demandService.getUrgentDemand(5,url,showLocation);
  626. List<DemandListBo> urgentDemand2=urgentDemand.subList(0, Math.min(2, urgentDemand.size()));
  627. List<DemandListBo> urgentDemand3=urgentDemand.subList( Math.min(2, urgentDemand.size()), Math.min(5, urgentDemand.size()));
  628. System.out.print("u2:"+urgentDemand2.size()+" u3:"+urgentDemand3.size());
  629. LimitLengthUtil.limiteDemandLength(urgentDemand2,13,30);
  630. LimitLengthUtil.limiteDemandLength(urgentDemand3,13,33);
  631. modelview.addObject("urgentDemand2",urgentDemand2);
  632. modelview.addObject("urgentDemand3",urgentDemand3);
  633. //热点需求
  634. List<DemandListBo> hotDemand=demandService.getHotDemand(5,url,showLocation);
  635. List<DemandListBo> hotDemand2=hotDemand.subList(0, Math.min(2, hotDemand.size()));
  636. List<DemandListBo> hotDemand3=hotDemand.subList( Math.min(2, hotDemand.size()), Math.min(5, hotDemand.size()));
  637. System.out.print("u2:"+hotDemand2.size()+" u3:"+hotDemand3.size());
  638. LimitLengthUtil.limiteDemandLength(hotDemand2,13,30);
  639. LimitLengthUtil.limiteDemandLength(hotDemand3,13,33);
  640. modelview.addObject("hotDemand2",hotDemand2);
  641. modelview.addObject("hotDemand3",hotDemand3);
  642. //企业技术需求
  643. List<DemandListBo> eightMaxCompanyDemand=demandService.companyDemand(8,url,showLocation);
  644. for(DemandListBo demandListBo:eightMaxCompanyDemand) {
  645. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  646. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  647. }
  648. modelview.addObject("companyDemandList",eightMaxCompanyDemand);
  649. //地区产业需求 最多4个
  650. List<DemandListBo> fourMaxareaDemand=demandService.areaDemand(4,url,showLocation);
  651. for(DemandListBo demandListBo:fourMaxareaDemand) {
  652. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  653. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  654. }
  655. LimitLengthUtil.limiteDemandLength(fourMaxareaDemand,10,208);
  656. modelview.addObject("areaDemandList",fourMaxareaDemand);
  657. //产学研需求 最多9个
  658. List<DemandListBo> nightMaxProLearnStudyDemand=demandService.proLearnStudyDemand(9,url,showLocation);
  659. for(DemandListBo demandListBo:nightMaxProLearnStudyDemand) {
  660. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  661. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  662. }
  663. LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand,10,18);
  664. LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 18);
  665. modelview.addObject("proLearnStudyDemandList",nightMaxProLearnStudyDemand);
  666. //研产资金需求 最多4个
  667. List<DemandListBo> fourMaxFundDemand=demandService.getFundCrowdDemand(4,url,showLocation);
  668. for(DemandListBo demandListBo:fourMaxFundDemand) {
  669. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  670. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  671. }
  672. LimitLengthUtil.limiteDemandLength(fourMaxFundDemand,9,30);
  673. modelview.addObject("fundDemandList",fourMaxFundDemand);
  674. //技术人才需求
  675. List<DemandListBo> sixMaxPersonnelDemand=demandService.getPersonnelDemand(6,url,showLocation);
  676. // List <DemandListBo>fourMaxPersonnelDemand=personnelDemand.subList(0,Math.min(6, personnelDemand.size()));
  677. for(DemandListBo demandListBo:sixMaxPersonnelDemand) {
  678. if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  679. else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  680. }
  681. LimitLengthUtil.limiteDemandLength(sixMaxPersonnelDemand,7,30);
  682. modelview.addObject("personnelDemandList",sixMaxPersonnelDemand);
  683. return modelview;
  684. }
  685. //需求详情
  686. @RequestMapping(value = "/portal/technologyTrading/demandDetail")
  687. public ModelAndView DemandDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  688. String url=StringUtils.getDomainByHttpRequest(request);
  689. //详情
  690. DemandListBo demand=demandService.getDemandDetail(id, type);
  691. int countInterest=demandService.getInterestCount(id);
  692. demand.setCountInterest(countInterest+"");
  693. modelAndView.addObject("demand",demand);
  694. //精品需求
  695. List<DemandListBo>boutiqueDemandList=LimitLengthUtil.LimitListLengthRandomly(demandService.getHotDemand(10,url,"web_demand_list"),3,10);
  696. modelAndView.addObject("reboutiquedemand",boutiqueDemandList);
  697. //猜你喜欢
  698. List<DemandListBo>guessYouLikeList=LimitLengthUtil.LimitListLengthRandomly(demandService.recentDemand(10, url,"web_demand_list"), 4, 10);
  699. modelAndView.addObject("redemandlist",guessYouLikeList);
  700. //view
  701. modelAndView.setViewName("/portal/technologyTrading/demandDetail");
  702. //是否关注
  703. if(StringUtils.isNotBlank(TokenManager.getUserId())) {
  704. DemandInterest demandInterest=demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
  705. if(demandInterest!=null)modelAndView.addObject("interested",true);
  706. }
  707. return modelAndView;
  708. }
  709. //成果首页
  710. @SuppressWarnings("unchecked")
  711. @RequestMapping(value = "/portal/technologyTrading/achievement", method = RequestMethod.GET)
  712. public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
  713. String showLocation="web_achievement_main";
  714. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  715. modelview.setViewName("/portal/technologyTrading/achievement");
  716. //行业
  717. List<fieldGlossoryBo> industryList = userIdentityService.domainList();//行业类型 1级
  718. modelview.addObject("industryList", industryList);
  719. //最新成果
  720. List<AchievementObject>recentAchievements=achievementService.recentAchievements(5,url,showLocation);
  721. modelview.addObject("recentAchievements",recentAchievements);
  722. //热门关注
  723. List<AchievementObject> hotAchievements=achievementService.getHotAchievements(6,url,showLocation);
  724. modelview.addObject("hotAchievements",hotAchievements);
  725. //专利
  726. List<AchievementObject>patentAchievements=achievementService.getPatentList(9,url,showLocation);
  727. modelview.addObject("patents",patentAchievements);
  728. //实用技术
  729. List<AchievementObject>practicalTechnology=achievementService.getPracticalTechnologys(8,url,showLocation);
  730. modelview.addObject("practicalTechnology",practicalTechnology);
  731. // List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
  732. List<PolicyResult> policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_index", 1, 5).getList();
  733. modelview.addObject("policyList",policies);
  734. return modelview;
  735. }
  736. @RequestMapping(value = "/portal/technologyTrading/achievementDetail")
  737. public ModelAndView achievementDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  738. if(type==null) {type =1;}
  739. //详情
  740. AchievementObject achievementObject=achievementService.getAchievementDetail(id,type);
  741. modelAndView.addObject("achievementdetail",achievementObject);
  742. //精品
  743. List<AchievementObject>boutiques=LimitLengthUtil.LimitListLengthRandomly(achievementService.getBoutiquePatent(10),3,10);
  744. modelAndView.addObject("reboutiqueachievement",boutiques);
  745. //猜你喜欢
  746. List<AchievementObject> guess =LimitLengthUtil.LimitListLengthRandomly(achievementService.guessYouLike(10), 4, 10);
  747. modelAndView.addObject("guess",guess);
  748. //view
  749. modelAndView.setViewName("/portal/technologyTrading/achievementDetail");
  750. //是否关注
  751. if(StringUtils.isNotBlank(TokenManager.getUserId())){
  752. AchievementInterest achievementInterest=achievementInterestService.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
  753. if(achievementInterest!=null)modelAndView.addObject("isInterested",true);
  754. }
  755. return modelAndView;
  756. }
  757. @RequestMapping(value = "/portal/service/patentList")
  758. public ModelAndView patentList(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  759. modelAndView.setViewName("/portal/service/patentList");
  760. return modelAndView;
  761. }
  762. @SuppressWarnings("unchecked")
  763. @RequestMapping(value = "/portal/service/patent")
  764. public ModelAndView patentIndex(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  765. List<JtBusinessCategoryBo> categoryBos=jtBusinessService.getCategoryBoList(1);
  766. modelAndView.addObject("categories",categoryBos);
  767. modelAndView.setViewName("/portal/service/patent");
  768. //最新发布
  769. List<JtBusinessProjectResult>recents=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(null, null, null, 4, 1,
  770. 1, 2, 1, null, 0, 0,null).getList();
  771. modelAndView.addObject("recent",recents);
  772. //专利服务-商标服务-版权服务
  773. for(JtBusinessCategoryBo c:categoryBos) {
  774. if("专利服务".equals(c.getTopLevel())){
  775. List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
  776. null, 3, 1, 1, 2, 1, null, 0, 0,null).getList();
  777. modelAndView.addObject("patentService",res);
  778. modelAndView.addObject("patentTopId",c.getTopLevelId());
  779. }
  780. else if("商标服务".equals(c.getTopLevel())){
  781. List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
  782. null, 4, 1, 1, 2, 1, null, 0, 0,null).getList();
  783. modelAndView.addObject("branchService",res);
  784. modelAndView.addObject("branchTopId",c.getTopLevelId());
  785. }
  786. else if("版权服务".equals(c.getTopLevel())){
  787. List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
  788. null, 3, 1, 1, 2, 1, null, 0, 0,null).getList();
  789. modelAndView.addObject("copyrightService",res);
  790. modelAndView.addObject("copyrightTopId",c.getTopLevelId());
  791. }
  792. }
  793. //知产百科
  794. List<News> news=(List<News>) newsService.listNews(98, null, null, null, null, null, null, 1, 4, 2+"", null, "web_tech_service_index").getList();
  795. modelAndView.addObject("jtNews",news);
  796. return modelAndView;
  797. }
  798. /*
  799. * 交易
  800. * */
  801. @SuppressWarnings("unchecked")
  802. @RequestMapping(value = "/portal/technologyTrading/tradingIndex")
  803. public ModelAndView patentTrading(HttpServletRequest request, ModelAndView modelAndView) {
  804. String showLocation="web_demand_trading_index";
  805. String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  806. modelAndView.setViewName("/portal/technologyTrading/tradingIndex");
  807. //成果
  808. List<AchievementObject>achievementObjects=achievementService.getHotAchievements(4, url, showLocation);
  809. modelAndView.addObject("achievement",achievementObjects);
  810. //需求
  811. List<DemandListBo>demandListBos=demandService.getHotDemand(2, url,showLocation);
  812. modelAndView.addObject("demand",demandListBos);
  813. //政策
  814. List<Policy> policies=(List<Policy>) policyService.searchPolicy(null, 2, null, null, "web_index", 1, 5).getList();
  815. modelAndView.addObject("policy",policies);
  816. //专家
  817. List<UserIdentityBo> userIdentityBos=userIdentityService.getExperts(3);
  818. modelAndView.addObject("expert",userIdentityBos);
  819. return modelAndView;
  820. }
  821. @SuppressWarnings("unchecked")
  822. @RequestMapping(value = "/portal/companyProfile")
  823. public ModelAndView companyProfile(HttpServletRequest request, ModelAndView modelAndView,String uid) {
  824. modelAndView.setViewName("/portal/companyProfile");
  825. OrgIdentityBo org=organizationIdentityService.selectOrgIdentityBoByUserId(uid);
  826. modelAndView.addObject("org",org);
  827. List<JtBusinessProjectResult>projectResults=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(null, null, null, 4, 1, 0, 2, null, null, 0, 1,uid).getList();
  828. modelAndView.addObject("jtProjects",projectResults);
  829. String honor=org.getHonorPicture();
  830. if(honor!=null && honor.contains(".")) {
  831. List<String>honorPictures=Arrays.asList(honor.split(","));
  832. if(honorPictures.size()>0)modelAndView.addObject("honors",honorPictures);
  833. }
  834. return modelAndView;
  835. }
  836. private void businessHelper(ModelAndView modelAndView,String categoryName,List<JtBusinessCategory> jtBusinessCategories,int[] sizes) {
  837. for(int i=0;i<jtBusinessCategories.size();i++) {
  838. List<JtBusinessProject>projects=jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategories.get(i).getId(), sizes[i],null);
  839. modelAndView.addObject(categoryName+i,jtBusinessCategories.get(i));
  840. modelAndView.addObject(categoryName+"List"+i,projects);
  841. }
  842. }
  843. public static int differentDaysByMillisecond(Date date1,Date date2)
  844. {
  845. int days = (int) ((date2.getTime() - date1.getTime()) / (1000*3600*24));
  846. return days;
  847. }
  848. @RequestMapping(value = "/portal/technologyTrading/shopList")
  849. public ModelAndView shopList(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
  850. modelAndView.setViewName("/portal/technologyTrading/shopList");
  851. return modelAndView;
  852. }
  853. /*
  854. - *
  855. - * type 0-政策 1-新闻
  856. - * */
  857. @RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
  858. public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview, Long id,Integer type) {
  859. modelview.setViewName("/portal/news/newsDetail");
  860. modelview.addObject("type",type);
  861. if(type ==null )type=1;
  862. if(type ==1) {
  863. Pagination<NewsPortalList> newsList = newsService.portalNewsList(6, 1, 5, null, null, null,2);
  864. News newsDetail = newsService.findNewsDetail(id);
  865. Object news =null;
  866. if(newsList!=null && newsList.getList().size()>0)news= newsList.getList().get(0);
  867. if (null != newsDetail) {
  868. newsDetail.setCreateTimeS(newsDetail.getCreateTime() != null
  869. ? DateFormatUtils.format(newsDetail.getCreateTime(), AFTConstants.MMDDYYYY) : "");
  870. String summary = newsDetail.getSummary();
  871. modelview.addObject("hasHighTech",
  872. summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
  873. modelview.addObject("hasPatent",
  874. summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
  875. modelview.addObject("hasCopyright",
  876. summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
  877. modelview.addObject("hasTechProj",
  878. summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
  879. }
  880. @SuppressWarnings("unchecked")
  881. List<NewsPortalList> la = (List<NewsPortalList>) newsList.getList();
  882. for (NewsPortalList n : la) {
  883. String createTimeFormattedDate = n.getCreateTimeFormattedDate();
  884. n.setDataS(createTimeFormattedDate);
  885. }
  886. if(newsDetail.getTitleImg()!=null) {
  887. String[] imgs=newsDetail.getTitleImg().split(",");
  888. if(imgs[0]==null || imgs[0].length()<1)modelview.addObject("imgs",null);
  889. else
  890. modelview.addObject("imgs",imgs[0]);
  891. }
  892. modelview.addObject("newsDetail", newsDetail);
  893. modelview.addObject("newsList", newsList.getList());
  894. if(news!=null)
  895. modelview.addObject("news", news);
  896. }
  897. else {
  898. List<PolicyEntity> newsList = achievementService.getIntellectualProperty(6);
  899. PolicyEntity newsDetail = newsService.getPolicyDetail(id+"");
  900. if (null != newsDetail) {
  901. String summary = newsDetail.getSummary();
  902. modelview.addObject("hasHighTech",
  903. summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
  904. modelview.addObject("hasPatent",
  905. summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
  906. modelview.addObject("hasCopyright",
  907. summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
  908. modelview.addObject("hasTechProj",
  909. summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
  910. }
  911. @SuppressWarnings("unchecked")
  912. List<PolicyEntity> la = (List<PolicyEntity>) newsList;
  913. if(newsDetail.getTitleImg()!=null) {
  914. String[] imgs=newsDetail.getTitleImg().split(",");
  915. if(imgs[0]==null || imgs[0].length()<1)modelview.addObject("imgs",null);
  916. else
  917. modelview.addObject("imgs",imgs[0]);
  918. }
  919. modelview.addObject("newsDetail", newsDetail);
  920. modelview.addObject("newsList", newsList);
  921. if(newsList!=null && newsList.size()>0)
  922. modelview.addObject("news", newsList.get(0));
  923. }
  924. return modelview;
  925. }
  926. /**
  927. * 新闻详情列表
  928. */
  929. @RequestMapping(value = "/portal/news/list", method = RequestMethod.GET)
  930. @ResponseBody
  931. public Result portalNewsList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
  932. String keyword) {
  933. Result res = new Result();
  934. Integer pNo = 1, pSize = 4;
  935. if (StringUtils.isNumeric(pageNo)) {
  936. pNo = Integer.parseInt(pageNo);
  937. }
  938. if (StringUtils.isNumeric(pageSize)) {
  939. pSize = Integer.parseInt(pageSize);
  940. }
  941. res.setData(newsService.portalNewsList(pSize, pNo, type, hot, provinceId, keyword,2));
  942. return res;
  943. }
  944. /**
  945. * 政策列表
  946. */
  947. @RequestMapping(value = "/portal/policy/list", method = RequestMethod.GET)
  948. @ResponseBody
  949. public Result policyList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
  950. String keyword) {
  951. Result res = new Result();
  952. Integer pNo = 1, pSize = 4;
  953. if (StringUtils.isNumeric(pageNo)) {
  954. pNo = Integer.parseInt(pageNo);
  955. }
  956. if (StringUtils.isNumeric(pageSize)) {
  957. pSize = Integer.parseInt(pageSize);
  958. }
  959. res.setData(policyService.searchPolicy( keyword,2, null, null, "web_index", pNo, pSize));
  960. return res;
  961. }
  962. }