WebpageController.java 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443
  1. package com.goafanti.common.controller;
  2. import java.util.Arrays;
  3. import java.util.Date;
  4. import java.util.Iterator;
  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.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestMethod;
  12. import org.springframework.web.bind.annotation.ResponseBody;
  13. import org.springframework.web.servlet.ModelAndView;
  14. import com.goafanti.achievement.service.AchievementInterestService;
  15. import com.goafanti.achievement.service.AchievementService;
  16. import com.goafanti.app.bo.ExpertsListBo;
  17. import com.goafanti.banners.service.BannersService;
  18. import com.goafanti.business.bo.JtBusinessCategoryBo;
  19. import com.goafanti.business.bo.JtBusinessCategoryTree;
  20. import com.goafanti.business.bo.JtBusinessProjectResult;
  21. import com.goafanti.business.service.JtBusinessService;
  22. import com.goafanti.common.bo.PolicyEntity;
  23. import com.goafanti.common.bo.Result;
  24. import com.goafanti.common.bo.fieldGlossoryBo;
  25. import com.goafanti.common.constant.AFTConstants;
  26. import com.goafanti.common.dao.JtBusinessCategoryMapper;
  27. import com.goafanti.common.dao.ProjectInterestMapper;
  28. import com.goafanti.common.enums.ConsultantType;
  29. import com.goafanti.common.model.AchievementInterest;
  30. import com.goafanti.common.model.Banners;
  31. import com.goafanti.common.model.DemandInterest;
  32. import com.goafanti.common.model.JtBusinessCategory;
  33. import com.goafanti.common.model.JtBusinessProject;
  34. import com.goafanti.common.model.News;
  35. import com.goafanti.common.model.Policy;
  36. import com.goafanti.common.model.User;
  37. import com.goafanti.common.service.GlobalSearchService;
  38. import com.goafanti.common.utils.LimitLengthUtil;
  39. import com.goafanti.common.utils.StringUtils;
  40. import com.goafanti.core.mybatis.page.Pagination;
  41. import com.goafanti.core.shiro.token.TokenManager;
  42. import com.goafanti.demand.bo.DemandListBo;
  43. import com.goafanti.demand.service.DemandInterestService;
  44. import com.goafanti.demand.service.DemandService;
  45. import com.goafanti.news.bo.NewsPortalList;
  46. import com.goafanti.news.bo.PolicyResult;
  47. import com.goafanti.news.enums.NewsType;
  48. import com.goafanti.news.service.NewsService;
  49. import com.goafanti.news.service.PolicyService;
  50. import com.goafanti.portal.bo.AchievementObject;
  51. import com.goafanti.user.bo.OrgIdentityBo;
  52. import com.goafanti.user.bo.UserIdentityBo;
  53. import com.goafanti.user.service.OrganizationIdentityService;
  54. import com.goafanti.user.service.UserIdentityService;
  55. import com.goafanti.user.service.UserService;
  56. @Controller
  57. public class WebpageController extends BaseController {
  58. @Resource
  59. private DemandService demandService;
  60. @Resource
  61. private AchievementService achievementService;
  62. @Resource
  63. private BannersService bannersService;
  64. @Resource
  65. private UserIdentityService userIdentityService;
  66. @Resource
  67. private OrganizationIdentityService organizationIdentityService;
  68. @Resource
  69. private NewsService newsService;
  70. @Resource
  71. private PolicyService policyService;
  72. @Resource
  73. private JtBusinessService jtBusinessService;
  74. @Resource
  75. private UserService userService;
  76. @Resource
  77. private AchievementInterestService achievementInterestService;
  78. @Resource
  79. private DemandInterestService demandInterestService;
  80. @Resource
  81. private GlobalSearchService globalSearchService;
  82. @Resource
  83. private ProjectInterestMapper projectInterestMapper;
  84. @Resource
  85. private JtBusinessCategoryMapper jtBusinessCategoryMapper;
  86. @RequestMapping(value = "/user/account/index", method = RequestMethod.GET)
  87. public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
  88. modelview.setViewName("/user/account/index");
  89. return modelview;
  90. }
  91. @RequestMapping(value = "/user/account/evaluateInfo", method = RequestMethod.GET)
  92. public ModelAndView evaluateInfo(HttpServletRequest request, ModelAndView modelview) {
  93. modelview.setViewName("/user/account/evaluateInfo");
  94. return modelview;
  95. }
  96. @RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
  97. public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
  98. modelview.setViewName("/user/account/set");
  99. return modelview;
  100. }
  101. @RequestMapping(value = "/portal/news/agreement", method = RequestMethod.GET)
  102. public ModelAndView portalNewsAgreement(HttpServletRequest request, ModelAndView modelview) {
  103. modelview.setViewName("/portal/news/agreement");
  104. return modelview;
  105. }
  106. @RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
  107. public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
  108. modelview.setViewName("/user/account/achievement");
  109. return modelview;
  110. }
  111. @RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
  112. public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
  113. modelview.setViewName("/user/account/demand");
  114. return modelview;
  115. }
  116. @RequestMapping(value = "/user/login", method = RequestMethod.GET)
  117. public String userLogin(HttpServletRequest request, ModelAndView modelview) {
  118. return "/user/login";
  119. }
  120. @RequestMapping(value = "/user/logout", method = RequestMethod.GET)
  121. public String userLogout(HttpServletRequest request, ModelAndView modelview) {
  122. TokenManager.logout();
  123. // return userLogin(request, modelview);
  124. return "redirect:/portal/index";
  125. }
  126. @RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
  127. public String userSignin(HttpServletRequest request, ModelAndView modelview) {
  128. return "/user/signIn";
  129. }
  130. @RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
  131. public String mSignin(HttpServletRequest request, ModelAndView modelview) {
  132. return "/user/msignIn";
  133. }
  134. @RequestMapping(value = "/user/certify", method = RequestMethod.GET)
  135. public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
  136. modelview.setViewName("/user/certify");
  137. return modelview;
  138. }
  139. @RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
  140. public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
  141. modelview.setViewName("/user/groupCertify");
  142. return modelview;
  143. }
  144. @RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
  145. public ModelAndView userServices(HttpServletRequest request, ModelAndView modelview) {
  146. modelview.setViewName("/user/account/services");
  147. return modelview;
  148. }
  149. @RequestMapping(value = "/admin/login", method = RequestMethod.GET)
  150. public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
  151. return "/admin/login";
  152. }
  153. @RequestMapping(value = "/admin/demand", method = RequestMethod.GET)
  154. public String adminDemand(HttpServletRequest request, ModelAndView modelview) {
  155. return "/admin/demand";
  156. }
  157. @RequestMapping(value = "/admin/achievement", method = RequestMethod.GET)
  158. public String adminAchievement(HttpServletRequest request, ModelAndView modelview) {
  159. return "/admin/achievement";
  160. }
  161. @RequestMapping(value = "/admin/set", method = RequestMethod.GET)
  162. public String adminSet(HttpServletRequest request, ModelAndView modelview) {
  163. return "/admin/set";
  164. }
  165. @RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
  166. public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
  167. modelview.setViewName("/admin/userManage");
  168. return modelview;
  169. }
  170. @RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
  171. public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
  172. modelview.setViewName("/admin/customer");
  173. return modelview;
  174. }
  175. @RequestMapping(value = "/admin/servicesManage/technology", method = RequestMethod.GET)
  176. public ModelAndView adminServicesManageTechnology(HttpServletRequest request, ModelAndView modelview) {
  177. modelview.setViewName("/admin/servicesManage/technology");
  178. return modelview;
  179. }
  180. @RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
  181. public ModelAndView adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
  182. modelview.setViewName("/admin/servicesManage/patent");
  183. return modelview;
  184. }
  185. @RequestMapping(value = "/admin/servicesManage/contract", method = RequestMethod.GET)
  186. public ModelAndView adminServicesManageContract(HttpServletRequest request, ModelAndView modelview) {
  187. modelview.setViewName("/admin/servicesManage/contract");
  188. return modelview;
  189. }
  190. @RequestMapping(value = "/admin/servicesManage/highTech", method = RequestMethod.GET)
  191. public ModelAndView adminServicesManageHighTech(HttpServletRequest request, ModelAndView modelview) {
  192. modelview.setViewName("/admin/servicesManage/highTech");
  193. return modelview;
  194. }
  195. @RequestMapping(value = "/admin/servicesManage/copyright", method = RequestMethod.GET)
  196. public ModelAndView adminServicesManageCopyright(HttpServletRequest request, ModelAndView modelview) {
  197. modelview.setViewName("/admin/servicesManage/copyright");
  198. return modelview;
  199. }
  200. @RequestMapping(value = "/admin/servicesManage/projectOrder", method = RequestMethod.GET)
  201. public ModelAndView adminServiceManageProjectOrder(HttpServletRequest request, ModelAndView modelview) {
  202. modelview.setViewName("/admin/servicesManage/projectOrder");
  203. return modelview;
  204. }
  205. @RequestMapping(value = "/admin/index", method = RequestMethod.GET)
  206. public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
  207. modelview.setViewName("/admin/index");
  208. return modelview;
  209. }
  210. @RequestMapping(value = "/admin/idea", method = RequestMethod.GET)
  211. public ModelAndView adminIdea(HttpServletRequest request, ModelAndView modelview) {
  212. modelview.setViewName("/admin/idea");
  213. return modelview;
  214. }
  215. @RequestMapping(value = "/admin/userOrder", method = RequestMethod.GET)
  216. public ModelAndView adminUserOrder(HttpServletRequest request, ModelAndView modelview) {
  217. modelview.setViewName("/admin/userOrder");
  218. return modelview;
  219. }
  220. @RequestMapping(value = "/portal/continueHigh", method = RequestMethod.GET)
  221. public ModelAndView portalContinueHigh(HttpServletRequest request, ModelAndView modelview) {
  222. modelview.setViewName("/portal/continueHigh");
  223. return modelview;
  224. }
  225. @RequestMapping(value = "/portal/militaryProject", method = RequestMethod.GET)
  226. public ModelAndView portalMilitaryProject(HttpServletRequest request, ModelAndView modelview) {
  227. modelview.setViewName("/portal/militaryProject");
  228. return modelview;
  229. }
  230. @RequestMapping(value = "/portal/practicalPatent", method = RequestMethod.GET)
  231. public ModelAndView portalPracticalPatent(HttpServletRequest request, ModelAndView modelview) {
  232. modelview.setViewName("/portal/practicalPatent");
  233. return modelview;
  234. }
  235. @RequestMapping(value = "/admin/order", method = RequestMethod.GET)
  236. public ModelAndView adminOrder(HttpServletRequest request, ModelAndView modelview) {
  237. modelview.setViewName("/admin/order");
  238. return modelview;
  239. }
  240. @RequestMapping(value = "/admin/operate", method = RequestMethod.GET)
  241. public ModelAndView adminOperate(HttpServletRequest request, ModelAndView modelview) {
  242. modelview.setViewName("/admin/operate");
  243. return modelview;
  244. }
  245. @RequestMapping(value = "/portal/membership", method = RequestMethod.GET)
  246. public ModelAndView membership(HttpServletRequest request, ModelAndView modelview) {
  247. modelview.setViewName("/portal/membership");
  248. return modelview;
  249. }
  250. @RequestMapping(value = "/portal/search/subscriberUser", method = RequestMethod.GET)
  251. public ModelAndView portalSearchSubscriberUser(HttpServletRequest request, ModelAndView modelview) {
  252. modelview.setViewName("/portal/search/subscriberUser");
  253. return modelview;
  254. }
  255. @RequestMapping(value = "/portal/search/subscriberOrg", method = RequestMethod.GET)
  256. public ModelAndView portalSearchSubscriberOrg(HttpServletRequest request, ModelAndView modelview) {
  257. modelview.setViewName("/portal/search/subscriberOrg");
  258. return modelview;
  259. }
  260. /**
  261. * 评估页
  262. */
  263. @RequestMapping(value = "/portal/evaluation/index", method = RequestMethod.GET)
  264. public ModelAndView evaluation(HttpServletRequest request, ModelAndView modelview) {
  265. modelview.setViewName("/portal/evaluation/index");
  266. //handleBanners(modelview, BannersType.JI_SHU_PING_GU);
  267. return modelview;
  268. }
  269. /**
  270. * 服务汇
  271. */
  272. @SuppressWarnings("unchecked")
  273. @RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
  274. public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
  275. modelview.setViewName("/portal/service/serviceIndex");
  276. // 政策
  277. // List<PolicyEntity>policyEntities=achievementService.getIntellectualProperty(8);
  278. List<PolicyResult> policies = (List<PolicyResult>) policyService
  279. .searchPolicy("", 2, null, null, "web_tech_service_index", 1, 8, null).getList();
  280. modelview.addObject("policyList", policies);
  281. // 新闻
  282. List<News> news = (List<News>) newsService.portalNewsList(5, 1, null, null, null, null, 2).getList();
  283. modelview.addObject("newsList", news);
  284. //军工认证
  285. /*JtBusinessCategory military = jtBusinessService.getBusinessCategoryByLayerAndName(1, "军工认证");
  286. List<JtBusinessProject> l = jtBusinessService.getModuleByName("军工认证", null, 3);
  287. for (JtBusinessProject project : l) {
  288. //去除数据中的标签
  289. if(StringUtils.isNotBlank(project.getIntroduce())){
  290. project.setIntroduce(project.getIntroduce().replaceAll("\\<.*?>", ""));
  291. }
  292. }
  293. modelview.addObject("military", military);
  294. modelview.addObject("militaryList", l);*/
  295. // 高企服务
  296. /*JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高新技术企业服务");
  297. JtBusinessCategory gaoqi2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "高新技术企业服务");
  298. if (gaoqi2 != null) {
  299. List<JtBusinessProject> gaoqiList = jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(), 6,
  300. null);
  301. for (JtBusinessProject project : gaoqiList) {
  302. if (project.getMinImgUrl() != null && project.getMinImgUrl().length() <= 0)
  303. project.setMinImgUrl(null);
  304. //去除数据中的标签
  305. if(StringUtils.isNotBlank(project.getIntroduce())){
  306. project.setIntroduce(project.getIntroduce().replaceAll("\\<.*?>", ""));
  307. }
  308. }
  309. modelview.addObject("gaoqiList", gaoqiList);
  310. modelview.addObject("gqc1", gaoqi);
  311. }
  312. // 知识产权贯标
  313. JtBusinessCategory zscqgb = jtBusinessService.getBusinessCategoryByLayerAndName(1, "知识产权");
  314. if (zscqgb != null) {
  315. List<JtBusinessCategory> zscqgbCategories = jtBusinessService.getBusinessCategoryBySuperId(zscqgb.getId(),
  316. 4);
  317. int[] zscqsizes = { 1, 2, 4, 10 };
  318. businessHelper(modelview, "zscqgb", zscqgbCategories, zscqsizes);
  319. modelview.addObject("zscqc1", zscqgb);
  320. }
  321. // 企业认证
  322. JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业资质认定");
  323. if (qiyerenzheng != null) {
  324. List<JtBusinessCategory> qyrzCategories = jtBusinessService
  325. .getBusinessCategoryBySuperId(qiyerenzheng.getId(), 2);
  326. int[] qyrzsizes = { 8, 8 };
  327. businessHelper(modelview, "qyrz", qyrzCategories, qyrzsizes);
  328. modelview.addObject("qyrzc1", qiyerenzheng);
  329. }
  330. // 管理体系
  331. JtBusinessCategory manageSys = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系认证");
  332. JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系认证");
  333. if (manageSys2 != null) {
  334. List<JtBusinessProject> manageSysPro = jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(),
  335. 18, null);
  336. modelview.addObject("manageSystemList", manageSysPro);
  337. modelview.addObject("managerSysc1", manageSys);
  338. }
  339. // 科技项目
  340. JtBusinessCategory scienceProject = jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
  341. JtBusinessCategory scienceProject2 = jtBusinessService.getBusinessCategoryByLayerAndName(2, "科技项目");
  342. if (scienceProject2 != null) {
  343. List<JtBusinessProject> scienceProjects = jtBusinessService
  344. .getBusinessProjectByCategoryId(scienceProject2.getId(), 12, AFTConstants.YES);
  345. modelview.addObject("scienceProjectList", scienceProjects);
  346. modelview.addObject("spc1", scienceProject);
  347. }
  348. */
  349. /*************以下是重新查询的数据********************************/
  350. JtBusinessCategory category = new JtBusinessCategory();
  351. category.setPcIndex(1);
  352. category.setLayer(6);
  353. category.setName("高新技术企业服务");
  354. //高企服务
  355. JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高新技术企业服务");
  356. if (gaoqi != null) {
  357. List<JtBusinessCategory> gaoqiList = jtBusinessCategoryMapper.getCategoryByName(category);
  358. modelview.addObject("gaoqiList", gaoqiList);
  359. modelview.addObject("gqc1", gaoqi);
  360. }
  361. //企业资质认证
  362. JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业资质认定");
  363. category.setLayer(10);
  364. category.setName("企业资质认定");
  365. if (qiyerenzheng != null) {
  366. //List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("企业资质认定", null, 12);
  367. List<JtBusinessCategory> qyrzCategories = jtBusinessCategoryMapper.getCategoryByName(category);
  368. modelview.addObject("qyrzCategories", qyrzCategories);
  369. modelview.addObject("qyrzc1", qiyerenzheng);
  370. }
  371. //管理体系认证
  372. JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系认证");
  373. category.setLayer(14);
  374. category.setName("管理体系认证");
  375. if (manageSys2 != null) {
  376. List<JtBusinessCategory> qyrzCategories = jtBusinessCategoryMapper.getCategoryByName(category);
  377. //List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("管理体系认证", null, 18);
  378. modelview.addObject("manageSystemList", qyrzCategories);
  379. modelview.addObject("managerSysc1", manageSys2);
  380. }
  381. //军工认证
  382. JtBusinessCategory jungong1 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "军工认证");
  383. category.setLayer(3);
  384. category.setName("军工认证");
  385. if (manageSys2 != null) {
  386. List<JtBusinessCategory> jungongList = jtBusinessCategoryMapper.getCategoryByName(category);
  387. modelview.addObject("jungongList", jungongList);
  388. modelview.addObject("jungong1", jungong1);
  389. }
  390. //科技项目
  391. //获得所有模块为5的科技项目id
  392. JtBusinessCategory scienceProject1 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
  393. category.setLayer(2);//第3级分类
  394. category.setModule(5);
  395. category.setPcIndex(1);//pc首页显示
  396. category.setSort(12);//个数
  397. List<JtBusinessCategory> manageSysPro = jtBusinessCategoryMapper.getCategoryByModel(category);
  398. modelview.addObject("scienceProjectList", manageSysPro);
  399. modelview.addObject("spc1", scienceProject1);
  400. //军民融合
  401. /*JtBusinessCategory jmrh = jtBusinessService.getBusinessCategoryByLayerAndName(1, "军民融合");
  402. List<JtBusinessProject> jlist = jtBusinessService.getKJListByIds(3,null,3);
  403. modelview.addObject("jmrh", jmrh);
  404. modelview.addObject("jlist", jlist);*/
  405. /****************************以上是新修改的部分********************************************/
  406. // 咨询师
  407. List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(8);
  408. // List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
  409. modelview.addObject("consultants", userIdentityBos);
  410. //获得轮播图数据
  411. List<Banners> blist = bannersService.findBannersList("serviceIndex", 0, 3, 1);
  412. if(null != blist){
  413. modelview.addObject("sbannerlist", blist);
  414. }
  415. return modelview;
  416. }
  417. /*
  418. * 服务详情
  419. *
  420. * @param id String
  421. */
  422. @RequestMapping(value = "/portal/service/serviceDetail", method = RequestMethod.GET)
  423. public ModelAndView portalServiceServiceDetail(HttpServletRequest request, ModelAndView modelview, String id) {
  424. modelview.setViewName("/portal/service/serviceDetails");
  425. JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
  426. if (null != jtBusinessProject) {
  427. if (jtBusinessProject.getMaxImgUrl() != null && jtBusinessProject.getMaxImgUrl().length() <= 0)
  428. jtBusinessProject.setMaxImgUrl(null);
  429. }
  430. if (jtBusinessProject.getCreateTime() != null
  431. && 7 >= differentDaysByMillisecond(jtBusinessProject.getCreateTime(), new Date())) {
  432. modelview.addObject("newly", true);
  433. } else
  434. modelview.addObject("newly", false);
  435. String owner = "平台管理员";
  436. if (jtBusinessProject.getOwnerId() != null) {
  437. User user = userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
  438. if (user != null && user.getIdentifyName() != null) {
  439. owner = user.getIdentifyName();
  440. }
  441. }
  442. modelview.addObject("owner", owner);
  443. modelview.addObject("pj", jtBusinessProject);
  444. //System.out.println(jtBusinessProject.toString());
  445. if (jtBusinessProject != null) {
  446. JtBusinessCategoryTree tree = jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
  447. modelview.addObject("tree", tree);
  448. }
  449. JtBusinessCategory jtBusinessCategory = jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
  450. if (jtBusinessCategory != null && jtBusinessCategory.getModule() != null)
  451. modelview.addObject("module", jtBusinessCategory.getModule());
  452. else
  453. modelview.addObject("module", 0);
  454. // 是否关注
  455. if (StringUtils.isNotBlank(TokenManager.getUserId())) {
  456. int projectInterest = projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
  457. if (projectInterest > 0)
  458. modelview.addObject("interested", true);
  459. }
  460. return modelview;
  461. }
  462. /*
  463. * 服务详情2
  464. *
  465. * @param id String
  466. */
  467. @RequestMapping(value = "/portal/service/patentDetail", method = RequestMethod.GET)
  468. public ModelAndView portalServicePatentDetail(HttpServletRequest request, ModelAndView modelview, String id) {
  469. modelview.setViewName("/portal/service/patenteDetails");
  470. JtBusinessProject jtBusinessProject = jtBusinessService.getBusinessProjectDetail(id);
  471. if (jtBusinessProject != null) {
  472. if (jtBusinessProject.getMaxImgUrl() != null && jtBusinessProject.getMaxImgUrl().length() <= 0)
  473. jtBusinessProject.setMaxImgUrl(null);
  474. }
  475. if (jtBusinessProject.getCreateTime() != null
  476. && 7 >= differentDaysByMillisecond(jtBusinessProject.getCreateTime(), new Date())) {
  477. modelview.addObject("newly", true);
  478. } else
  479. modelview.addObject("newly", false);
  480. String owner = "平台管理员";
  481. if (jtBusinessProject.getOwnerId() != null) {
  482. User user = userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
  483. if (user != null && user.getIdentifyName() != null) {
  484. owner = user.getIdentifyName();
  485. }
  486. }
  487. modelview.addObject("owner", owner);
  488. modelview.addObject("pj", jtBusinessProject);
  489. //System.out.println(jtBusinessProject.toString());
  490. if (jtBusinessProject != null) {
  491. JtBusinessCategoryTree tree = jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
  492. modelview.addObject("tree", tree);
  493. }
  494. JtBusinessCategory jtBusinessCategory = jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
  495. if (jtBusinessCategory != null && jtBusinessCategory.getModule() != null)
  496. modelview.addObject("module", jtBusinessCategory.getModule());
  497. else
  498. modelview.addObject("module", 0);
  499. // 是否关注
  500. if (StringUtils.isNotBlank(TokenManager.getUserId())) {
  501. int projectInterest = projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
  502. if (projectInterest > 0)
  503. modelview.addObject("interested", true);
  504. }
  505. return modelview;
  506. }
  507. @RequestMapping(value = "/portal/service/serviceList", method = RequestMethod.GET)
  508. public ModelAndView serviceList(HttpServletRequest request, ModelAndView modelview) {
  509. modelview.setViewName("/portal/service/serviceList");
  510. return modelview;
  511. }
  512. @RequestMapping(value = "/portal/technologyTrading/demandList", method = RequestMethod.GET)
  513. public ModelAndView demandList(HttpServletRequest request, ModelAndView modelview) {
  514. String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  515. modelview.setViewName("/portal/technologyTrading/demandList");
  516. List<DemandListBo> boutiques = demandService.getHotDemand(3, url, "web_demand_list", 0);
  517. modelview.addObject("boutiques", boutiques);
  518. return modelview;
  519. }
  520. @RequestMapping(value = "/portal/technologyTrading/achievementList", method = RequestMethod.GET)
  521. public ModelAndView achievementList(HttpServletRequest request, ModelAndView modelview) {
  522. modelview.setViewName("/portal/technologyTrading/achievementList");
  523. List<AchievementObject> boutiques = achievementService.getBoutiquePatent(3,0);
  524. modelview.addObject("boutiques", boutiques);
  525. return modelview;
  526. }
  527. /**
  528. * 知识产权
  529. *
  530. * @param request
  531. * @param modelview
  532. * @return
  533. */
  534. @RequestMapping(value = "/portal/service/propertyRight", method = RequestMethod.GET)
  535. public ModelAndView propertyRight(HttpServletRequest request, ModelAndView modelview) {
  536. modelview.setViewName("/portal/service/propertyRight");
  537. return modelview;
  538. }
  539. /**
  540. * 高企认定
  541. *
  542. * @param request
  543. * @param modelview
  544. * @return
  545. */
  546. @RequestMapping(value = "/portal/service/highTechCognizance", method = RequestMethod.GET)
  547. public ModelAndView highTechCognizance(HttpServletRequest request, ModelAndView modelview) {
  548. modelview.setViewName("/portal/service/highTechCognizance");
  549. return modelview;
  550. }
  551. /**
  552. * 技术交易
  553. */
  554. @RequestMapping(value = "/portal/technologyTrading/index", method = RequestMethod.GET)
  555. public ModelAndView portalTechnologyTradingIndex(HttpServletRequest request, ModelAndView modelview) {
  556. modelview.setViewName("/portal/technologyTrading/index");
  557. //handleBanners(modelview, BannersType.JI_SHU_JIAO_YI);
  558. List<NewsPortalList> newsPortalList = newsService.portalNewsPolicy();
  559. modelview.addObject("newsPortalList", newsPortalList);
  560. List<NewsPortalList> portalNewsQuestion = newsService.portalNewsQuestion();
  561. modelview.addObject("portalNewsQuestion", portalNewsQuestion);
  562. return modelview;
  563. }
  564. /**
  565. *
  566. * 智库咨询
  567. *
  568. * @param request
  569. * @param modelview
  570. * @return
  571. */
  572. @RequestMapping(value = "/portal/thinkTank/index", method = RequestMethod.GET)
  573. public ModelAndView thinkTank(HttpServletRequest request, ModelAndView modelview) {
  574. modelview.setViewName("/portal/thinkTank/index");
  575. return modelview;
  576. }
  577. /**
  578. * 政策列表
  579. *
  580. * @return
  581. */
  582. @SuppressWarnings("unchecked")
  583. @RequestMapping(value = "/portal/thinkTank/policyList", method = RequestMethod.GET)
  584. public ModelAndView policyList(ModelAndView modelview) {
  585. modelview.setViewName("/portal/thinkTank/policyList");
  586. List<NewsPortalList> newsList = (List<NewsPortalList>) newsService
  587. .portalNewsList(5, 1, null, null, null, null, 2).getList();
  588. modelview.addObject("newsList", newsList);
  589. return modelview;
  590. }
  591. /**
  592. * 会员介绍
  593. *
  594. * @param request
  595. * @param modelview
  596. * @return
  597. */
  598. @RequestMapping(value = "/portal/member")
  599. public ModelAndView member(HttpServletRequest request, ModelAndView modelview) {
  600. modelview.setViewName("/portal/member");
  601. return modelview;
  602. }
  603. /**
  604. * 技术评估
  605. *
  606. * @param request
  607. * @param modelview
  608. * @return
  609. */
  610. @RequestMapping(value = "/portal/technologyTrading/assessMent")
  611. public ModelAndView assessMent(HttpServletRequest request, ModelAndView modelview) {
  612. modelview.setViewName("/portal/technologyTrading/assessMent");
  613. modelview.addObject("zcfg", newsService.findIndexNewsList(0, NewsType.KJZX.getCode(), 4));
  614. return modelview;
  615. }
  616. /**
  617. * 关于我们
  618. *
  619. * @param request
  620. * @param modelview
  621. * @return
  622. */
  623. @RequestMapping(value = "/portal/aboutUs", method = RequestMethod.GET)
  624. public ModelAndView aboutUs(HttpServletRequest request, ModelAndView modelview) {
  625. modelview.setViewName("/portal/aboutUs");
  626. return modelview;
  627. }
  628. /**
  629. * 联系我们
  630. *
  631. * @param request
  632. * @param modelview
  633. * @return
  634. */
  635. @RequestMapping(value = "/portal/contactUs", method = RequestMethod.GET)
  636. public ModelAndView contactUs(HttpServletRequest request, ModelAndView modelview) {
  637. modelview.setViewName("/portal/contactUs");
  638. return modelview;
  639. }
  640. /*private void handleBanners(ModelAndView modelview, BannersType bannersType) {
  641. List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
  642. if (!banners.isEmpty()) {
  643. modelview.addObject("banners", banners);
  644. }
  645. }*/
  646. /**
  647. * 服务-推荐
  648. *
  649. * @param request
  650. * @param modelview
  651. * @return
  652. */
  653. @RequestMapping(value = "/portal/service/recommended")
  654. public ModelAndView recommended(HttpServletRequest request, ModelAndView modelview) {
  655. modelview.setViewName("/portal/service/recommended");
  656. return modelview;
  657. }
  658. /*
  659. * 首页
  660. *
  661. */
  662. @SuppressWarnings("unchecked")
  663. @RequestMapping(value = "/portal/index")
  664. public ModelAndView mainIndex(HttpServletRequest request, ModelAndView modelview) {
  665. // String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  666. modelview.setViewName("/portal/index");
  667. List<JtBusinessCategoryBo> patentCategory = jtBusinessService.getCategoryBoList(1);
  668. patentCategory = patentCategory.subList(0, Math.min(6, patentCategory.size()));
  669. modelview.addObject("patentCategory", patentCategory);
  670. List<JtBusinessProject> jtBusinessProjects = (List<JtBusinessProject>) jtBusinessService
  671. .getProjects(null,null, null, null, 8, 1, 1, 2, null, 1, 0, 0, null).getList();
  672. for (JtBusinessProject project : jtBusinessProjects) {
  673. if (project.getMaxImgUrl() != null && project.getMaxImgUrl().length() <= 0)
  674. project.setMaxImgUrl(null);
  675. if (project.getMinImgUrl() != null && project.getMinImgUrl().length() <= 0)
  676. project.setMinImgUrl(null);
  677. //去除数据中的标签
  678. if(StringUtils.isNotBlank(project.getIntroduce())){
  679. project.setIntroduce(project.getIntroduce().replaceAll("\\<.*?>", ""));
  680. }
  681. }
  682. modelview.addObject("projects", jtBusinessProjects);
  683. List<PolicyResult> policies = (List<PolicyResult>) policyService
  684. .searchPolicy("", 2, null, null, "web_index", 1, 3, null).getList();
  685. for (PolicyResult p : policies) {
  686. if (null != p.getTitleImg() && p.getTitleImg().contains(",")) {
  687. p.setTitleImg(p.getTitleImg().substring(0, p.getTitleImg().indexOf(",")));
  688. }
  689. }
  690. modelview.addObject("policys", policies);//政策
  691. List<News> newsList = (List<News>) newsService
  692. .listNews(0, null, null, null, null, null, null, 1, 3, "2", null, null,null).getList();
  693. modelview.addObject("news", newsList);//资讯
  694. //
  695. List<News> subscriptions = (List<News>) newsService
  696. .listNews(99, null, null, null, null, null, null, 1, 4, "2", null, null,null).getList();
  697. modelview.addObject("subscription", subscriptions);//技淘观点精选
  698. if (subscriptions != null && subscriptions.size() > 0 && subscriptions.get(0).getSourceUrl() != null
  699. && subscriptions.get(0).getSourceUrl().contains(".")) {
  700. modelview.addObject("videoUrl", subscriptions.get(0).getSourceUrl());
  701. }
  702. //获得轮播图数据
  703. List<Banners> blist = bannersService.findBannersList("index", 0, 3, 1);
  704. if(null != blist){
  705. modelview.addObject("bannerlist", blist);
  706. }
  707. // List<AchievementObject>
  708. // achievementObjects=achievementService.getHotAchievements(9, url,
  709. // "web_index");
  710. // modelview.addObject("achievements",achievementObjects);
  711. //
  712. //
  713. //
  714. //
  715. // List<DemandListBo> demandListBos=demandService.getHotDemand(9, url,
  716. // "web_index");
  717. // for(DemandListBo demandListBo:demandListBos) {
  718. // if(demandListBo.getPictureUrl()==null ||
  719. // !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
  720. // else
  721. // demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  722. // }
  723. // //专家
  724. // List<UserIdentityBo>aExperts=userIdentityService.getExperts(8);
  725. // for(UserIdentityBo u:aExperts) {
  726. // if(u.getHeadPortraitUrl()!=null &&
  727. // u.getHeadPortraitUrl().length()<=0) {
  728. // u.setHeadPortraitUrl(null);
  729. // }
  730. // }
  731. // modelview.addObject("experts",aExperts);
  732. // modelview.addObject("demands",demandListBos);
  733. return modelview;
  734. }
  735. /*
  736. *
  737. *
  738. * 技淘3.0-科技需求页
  739. *
  740. * @param request
  741. *
  742. * @param modelview
  743. *
  744. * @return
  745. *
  746. */
  747. // 需求首页
  748. @RequestMapping(value = "/portal/technologyTrading/demand")
  749. public ModelAndView demand(HttpServletRequest request, ModelAndView modelview) {
  750. String showLocation = "web_demand_main";
  751. String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  752. modelview.setViewName("/portal/technologyTrading/demand");
  753. // 行业
  754. List<fieldGlossoryBo> industryList = userIdentityService.domainList();
  755. modelview.addObject("industryList", industryList);
  756. // 最新需求
  757. List<DemandListBo> recentDemandList = demandService.recentDemand(5, url, showLocation);
  758. LimitLengthUtil.limiteDemandCompanyAndName(recentDemandList, 18, 18);
  759. modelview.addObject("recentDemandList", recentDemandList);
  760. //
  761. // //加急需求
  762. List<DemandListBo> urgentDemand = demandService.getUrgentDemand(5, url, showLocation);
  763. List<DemandListBo> urgentDemand2 = urgentDemand.subList(0, Math.min(2, urgentDemand.size()));
  764. List<DemandListBo> urgentDemand3 = urgentDemand.subList(Math.min(2, urgentDemand.size()),
  765. Math.min(5, urgentDemand.size()));
  766. System.out.print("u2:" + urgentDemand2.size() + " u3:" + urgentDemand3.size());
  767. LimitLengthUtil.limiteDemandLength(urgentDemand2, 13, 30);
  768. LimitLengthUtil.limiteDemandLength(urgentDemand3, 13, 33);
  769. modelview.addObject("urgentDemand2", urgentDemand2);
  770. modelview.addObject("urgentDemand3", urgentDemand3);
  771. // 热点需求
  772. List<DemandListBo> hotDemand = demandService.getHotDemand(5, url, showLocation,0);
  773. List<DemandListBo> hotDemand2 = hotDemand.subList(0, Math.min(2, hotDemand.size()));
  774. List<DemandListBo> hotDemand3 = hotDemand.subList(Math.min(2, hotDemand.size()), Math.min(5, hotDemand.size()));
  775. System.out.print("u2:" + hotDemand2.size() + " u3:" + hotDemand3.size());
  776. LimitLengthUtil.limiteDemandLength(hotDemand2, 13, 30);
  777. LimitLengthUtil.limiteDemandLength(hotDemand3, 13, 33);
  778. modelview.addObject("hotDemand2", hotDemand2);
  779. modelview.addObject("hotDemand3", hotDemand3);
  780. // 企业技术需求
  781. List<DemandListBo> eightMaxCompanyDemand = demandService.companyDemand(8, url, showLocation);
  782. for (DemandListBo demandListBo : eightMaxCompanyDemand) {
  783. if (demandListBo.getPictureUrl() == null || !demandListBo.getPictureUrl().contains("."))
  784. demandListBo.setPictureUrl(null);
  785. else
  786. demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  787. }
  788. modelview.addObject("companyDemandList", eightMaxCompanyDemand);
  789. // 地区产业需求 最多4个
  790. List<DemandListBo> fourMaxareaDemand = demandService.areaDemand(4, url, showLocation);
  791. for (DemandListBo demandListBo : fourMaxareaDemand) {
  792. if (demandListBo.getPictureUrl() == null || !demandListBo.getPictureUrl().contains("."))
  793. demandListBo.setPictureUrl(null);
  794. else
  795. demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  796. }
  797. LimitLengthUtil.limiteDemandLength(fourMaxareaDemand, 10, 208);
  798. modelview.addObject("areaDemandList", fourMaxareaDemand);
  799. // 产学研需求 最多9个
  800. List<DemandListBo> nightMaxProLearnStudyDemand = demandService.proLearnStudyDemand(9, url, showLocation);
  801. for (DemandListBo demandListBo : nightMaxProLearnStudyDemand) {
  802. if (demandListBo.getPictureUrl() == null || !demandListBo.getPictureUrl().contains("."))
  803. demandListBo.setPictureUrl(null);
  804. else
  805. demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  806. }
  807. LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand, 10, 18);
  808. LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 18);
  809. modelview.addObject("proLearnStudyDemandList", nightMaxProLearnStudyDemand);
  810. // 研产资金需求 最多4个
  811. List<DemandListBo> fourMaxFundDemand = demandService.getFundCrowdDemand(4, url, showLocation);
  812. for (DemandListBo demandListBo : fourMaxFundDemand) {
  813. if (demandListBo.getPictureUrl() == null || !demandListBo.getPictureUrl().contains("."))
  814. demandListBo.setPictureUrl(null);
  815. else
  816. demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  817. }
  818. LimitLengthUtil.limiteDemandLength(fourMaxFundDemand, 9, 30);
  819. modelview.addObject("fundDemandList", fourMaxFundDemand);
  820. // 技术人才需求
  821. List<DemandListBo> sixMaxPersonnelDemand = demandService.getPersonnelDemand(6, url, showLocation);
  822. // List
  823. // <DemandListBo>fourMaxPersonnelDemand=personnelDemand.subList(0,Math.min(6,
  824. // personnelDemand.size()));
  825. for (DemandListBo demandListBo : sixMaxPersonnelDemand) {
  826. if (demandListBo.getPictureUrl() == null || !demandListBo.getPictureUrl().contains("."))
  827. demandListBo.setPictureUrl(null);
  828. else
  829. demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
  830. }
  831. LimitLengthUtil.limiteDemandLength(sixMaxPersonnelDemand, 7, 30);
  832. modelview.addObject("personnelDemandList", sixMaxPersonnelDemand);
  833. //获得轮播图数据
  834. List<Banners> blist = bannersService.findBannersList("demand", 0, 3, 1);
  835. if(null != blist){
  836. modelview.addObject("dbannerlist", blist);
  837. }
  838. return modelview;
  839. }
  840. // 需求详情
  841. @RequestMapping(value = "/portal/technologyTrading/demandDetail")
  842. public ModelAndView DemandDetail(HttpServletRequest request, ModelAndView modelAndView, String id, Integer type) {
  843. String url = StringUtils.getDomainByHttpRequest(request);
  844. // 详情
  845. DemandListBo demand = demandService.getDemandDetail(id, type);
  846. int countInterest = demandService.getInterestCount(id);
  847. demand.setCountInterest(countInterest);
  848. modelAndView.addObject("demand", demand);
  849. // 精品需求
  850. List<DemandListBo> boutiqueDemandList = LimitLengthUtil
  851. .LimitListLengthRandomly(demandService.getHotDemand(10, url, "web_demand_list",0), 3, 10);
  852. modelAndView.addObject("reboutiquedemand", boutiqueDemandList);
  853. // 猜你喜欢
  854. List<DemandListBo> guessYouLikeList = LimitLengthUtil
  855. .LimitListLengthRandomly(demandService.recentDemand(10, url, "web_demand_list"), 4, 10);
  856. modelAndView.addObject("redemandlist", guessYouLikeList);
  857. // view
  858. modelAndView.setViewName("/portal/technologyTrading/demandDetail");
  859. // 是否关注
  860. if (StringUtils.isNotBlank(TokenManager.getUserId())) {
  861. DemandInterest demandInterest = demandInterestService
  862. .selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
  863. if (demandInterest != null)
  864. modelAndView.addObject("interested", true);
  865. }
  866. return modelAndView;
  867. }
  868. // 成果首页
  869. @SuppressWarnings("unchecked")
  870. @RequestMapping(value = "/portal/technologyTrading/achievement", method = RequestMethod.GET)
  871. public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
  872. String showLocation = "web_achievement_main";
  873. String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  874. modelview.setViewName("/portal/technologyTrading/achievement");
  875. // 行业
  876. List<fieldGlossoryBo> industryList = userIdentityService.domainList();// 行业类型
  877. // 1级
  878. modelview.addObject("industryList", industryList);
  879. // 最新成果
  880. List<AchievementObject> recentAchievements = achievementService.recentAchievements(5, url, showLocation);
  881. modelview.addObject("recentAchievements", recentAchievements);
  882. // 热门关注
  883. List<AchievementObject> hotAchievements = achievementService.getHotAchievements(6, url, showLocation);
  884. modelview.addObject("hotAchievements", hotAchievements);
  885. // 专利
  886. List<AchievementObject> patentAchievements = achievementService.getPatentList(9, url, showLocation);
  887. modelview.addObject("patents", patentAchievements);
  888. // 实用技术
  889. List<AchievementObject> practicalTechnology = achievementService.getPracticalTechnologys(8, url, showLocation);
  890. modelview.addObject("practicalTechnology", practicalTechnology);
  891. // List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
  892. List<PolicyResult> policies = (List<PolicyResult>) policyService
  893. .searchPolicy("", 2, null, null, "web_index", 1, 5, null).getList();
  894. modelview.addObject("policyList", policies);
  895. //获得轮播图数据
  896. List<Banners> blist = bannersService.findBannersList("achievement", 0, 3, 1);
  897. if(null != blist){
  898. modelview.addObject("abannerlist", blist);
  899. }
  900. return modelview;
  901. }
  902. @RequestMapping(value = "/portal/technologyTrading/achievementDetail")
  903. public ModelAndView achievementDetail(HttpServletRequest request, ModelAndView modelAndView, String id,
  904. Integer type) {
  905. if (type == null) {
  906. type = 1;
  907. }
  908. // 详情
  909. AchievementObject achievementObject = achievementService.getAchievementDetail(id, type);
  910. modelAndView.addObject("achievementdetail", achievementObject);
  911. // 精品
  912. List<AchievementObject> boutiques = LimitLengthUtil
  913. .LimitListLengthRandomly(achievementService.getBoutiquePatent(10,0), 3, 10);
  914. modelAndView.addObject("reboutiqueachievement", boutiques);
  915. // 猜你喜欢
  916. List<AchievementObject> guess = LimitLengthUtil.LimitListLengthRandomly(achievementService.guessYouLike(10), 4,
  917. 10);
  918. modelAndView.addObject("guess", guess);
  919. // view
  920. modelAndView.setViewName("/portal/technologyTrading/achievementDetail");
  921. // 是否关注
  922. if (StringUtils.isNotBlank(TokenManager.getUserId())) {
  923. AchievementInterest achievementInterest = achievementInterestService
  924. .selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
  925. if (achievementInterest != null)
  926. modelAndView.addObject("isInterested", true);
  927. }
  928. return modelAndView;
  929. }
  930. @RequestMapping(value = "/portal/service/patentList")
  931. public ModelAndView patentList(HttpServletRequest request, ModelAndView modelAndView, String id, Integer type) {
  932. modelAndView.setViewName("/portal/service/patentList");
  933. return modelAndView;
  934. }
  935. @SuppressWarnings("unchecked")
  936. @RequestMapping(value = "/portal/service/patent")
  937. public ModelAndView patentIndex(HttpServletRequest request, ModelAndView modelAndView, String id, Integer type) {
  938. List<JtBusinessCategoryBo> categoryBos = jtBusinessService.getCategoryBoList(1);
  939. modelAndView.addObject("categories", categoryBos);
  940. modelAndView.setViewName("/portal/service/patent");
  941. // 最新发布
  942. List<JtBusinessProjectResult> recents = (List<JtBusinessProjectResult>) jtBusinessService
  943. .getProjects(null,null, null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
  944. modelAndView.addObject("recent", recents);
  945. // 专利服务-商标服务-版权服务
  946. /*for (JtBusinessCategoryBo c : categoryBos) {
  947. if ("专利服务".equals(c.getTopLevel())) {
  948. List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
  949. .getProjects(null,c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
  950. modelAndView.addObject("patentService", res);
  951. modelAndView.addObject("patentTopId", c.getTopLevelId());
  952. } else if ("商标服务".equals(c.getTopLevel())) {
  953. List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
  954. .getProjects(null,c.getTopLevelId(), null, null, 4, 1, 1, 2, 1, null, 0, 0, null).getList();
  955. modelAndView.addObject("branchService", res);
  956. modelAndView.addObject("branchTopId", c.getTopLevelId());
  957. } else if ("版权服务".equals(c.getTopLevel())) {
  958. List<JtBusinessProjectResult> res = (List<JtBusinessProjectResult>) jtBusinessService
  959. .getProjects(null,c.getTopLevelId(), null, null, 3, 1, 1, 2, 1, null, 0, 0, null).getList();
  960. modelAndView.addObject("copyrightService", res);
  961. modelAndView.addObject("copyrightTopId", c.getTopLevelId());
  962. }
  963. }*/
  964. /*******************************************修改首页专利商标版权************************************************/
  965. JtBusinessCategory category = new JtBusinessCategory();
  966. category.setPcIndex(1);
  967. category.setLayer(3);
  968. category.setName("专利服务");
  969. //专利 3
  970. List<JtBusinessCategory> zl = jtBusinessCategoryMapper.getCategoryByName(category);
  971. if(null != zl && zl.size() > 0){
  972. modelAndView.addObject("patentService", zl);
  973. modelAndView.addObject("patentTopId", zl.get(0).getSuperId());
  974. }
  975. //商标4
  976. category.setLayer(4);
  977. category.setName("商标服务");
  978. List<JtBusinessCategory> sb = jtBusinessCategoryMapper.getCategoryByName(category);
  979. if(null != sb && sb.size() > 0){
  980. modelAndView.addObject("branchService", sb);
  981. modelAndView.addObject("branchTopId", sb.get(0).getSuperId());
  982. }
  983. //版权3
  984. category.setLayer(3);
  985. category.setName("版权服务");
  986. List<JtBusinessCategory> bq = jtBusinessCategoryMapper.getCategoryByName(category);
  987. if(null != bq && bq.size() > 0){
  988. modelAndView.addObject("copyrightService", bq);
  989. modelAndView.addObject("copyrightTopId", bq.get(0).getSuperId());
  990. }
  991. /*********************************结束**************************************/
  992. // 知产百科
  993. List<News> news = (List<News>) newsService
  994. .listNews(98, null, null, null, null, null, null, 1, 4, 2 + "", null, "web_tech_service_index",null)
  995. .getList();
  996. for (News n : news) {
  997. if (null != n.getTitleImg() && n.getTitleImg().contains(",")) {
  998. n.setTitleImg(n.getTitleImg().substring(0, n.getTitleImg().indexOf(",")));
  999. }
  1000. }
  1001. modelAndView.addObject("jtNews", news);
  1002. //获得轮播图数据
  1003. List<Banners> blist = bannersService.findBannersList("patent", 0, 3, 1);
  1004. if(null != blist){
  1005. modelAndView.addObject("pbannerlist", blist);
  1006. }
  1007. return modelAndView;
  1008. }
  1009. /*
  1010. * 交易
  1011. */
  1012. @SuppressWarnings("unchecked")
  1013. @RequestMapping(value = "/portal/technologyTrading/tradingIndex")
  1014. public ModelAndView patentTrading(HttpServletRequest request, ModelAndView modelAndView) {
  1015. String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
  1016. modelAndView.setViewName("/portal/technologyTrading/tradingIndex");
  1017. // 成果
  1018. List<AchievementObject> achievementObjects = achievementService.getHotAchievements(4, url,
  1019. "web_achievement_trading_index");
  1020. for (AchievementObject a : achievementObjects) {
  1021. if (null != a.getTechnicalPictureUrl() && a.getTechnicalPictureUrl().contains(",")) {
  1022. a.setTechnicalPictureUrl(
  1023. a.getTechnicalPictureUrl().substring(0, a.getTechnicalPictureUrl().indexOf(",")));
  1024. }
  1025. }
  1026. modelAndView.addObject("achievement", achievementObjects);
  1027. // 需求
  1028. List<DemandListBo> demandListBos = demandService.getHotDemand(2, url, "web_demand_trading_index",0);
  1029. for (DemandListBo d : demandListBos) {
  1030. if (null != d.getFirstPic() && d.getFirstPic().contains(",")) {
  1031. d.setFirstPic(d.getFirstPic().substring(0, d.getFirstPic().indexOf(",")));
  1032. }
  1033. }
  1034. modelAndView.addObject("demand", demandListBos);
  1035. // 政策
  1036. List<Policy> policies = (List<Policy>) policyService.searchPolicy(null, 2, null, null, "web_index", 1, 5, null)
  1037. .getList();
  1038. modelAndView.addObject("policy", policies);
  1039. // 专家
  1040. List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(3);
  1041. modelAndView.addObject("expert", userIdentityBos);
  1042. //获得轮播图数据
  1043. List<Banners> blist = bannersService.findBannersList("tradingIndex", 0, 3, 1);
  1044. if(null != blist){
  1045. modelAndView.addObject("tbannerlist", blist);
  1046. }
  1047. return modelAndView;
  1048. }
  1049. @SuppressWarnings("unchecked")
  1050. @RequestMapping(value = "/portal/companyProfile")
  1051. public ModelAndView companyProfile(HttpServletRequest request, ModelAndView modelAndView, String uid) {
  1052. modelAndView.setViewName("/portal/companyProfile");
  1053. OrgIdentityBo org = organizationIdentityService.selectOrgIdentityBoByUserId(uid);
  1054. modelAndView.addObject("org", org);
  1055. List<JtBusinessProjectResult> projectResults = (List<JtBusinessProjectResult>) jtBusinessService
  1056. .getProjects(null,null, null, null, 4, 1, 0, 2, null, null, 0, 0, uid).getList();
  1057. modelAndView.addObject("jtProjects", projectResults);
  1058. String honor = org.getHonorPicture();
  1059. if (honor != null && honor.contains(".")) {
  1060. List<String> honorPictures = Arrays.asList(honor.split(","));
  1061. if (honorPictures.size() > 0)
  1062. modelAndView.addObject("honors", honorPictures);
  1063. }
  1064. return modelAndView;
  1065. }
  1066. /* private void businessHelper(ModelAndView modelAndView, String categoryName,
  1067. List<JtBusinessCategory> jtBusinessCategories, int[] sizes) {
  1068. for (int i = 0; i < jtBusinessCategories.size(); i++) {
  1069. List<JtBusinessProject> projects = jtBusinessService
  1070. .getBusinessProjectByCategoryId(jtBusinessCategories.get(i).getId(), sizes[i], null);
  1071. modelAndView.addObject(categoryName + i, jtBusinessCategories.get(i));
  1072. modelAndView.addObject(categoryName + "List" + i, projects);
  1073. }
  1074. }*/
  1075. public static int differentDaysByMillisecond(Date date1, Date date2) {
  1076. int days = (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24));
  1077. return days;
  1078. }
  1079. @RequestMapping(value = "/portal/technologyTrading/shopList")
  1080. public ModelAndView shopList(HttpServletRequest request, ModelAndView modelAndView, String id, Integer type) {
  1081. modelAndView.setViewName("/portal/technologyTrading/shopList");
  1082. return modelAndView;
  1083. }
  1084. /*
  1085. * - * - * type 0-政策 1-新闻 - *
  1086. */
  1087. @RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
  1088. public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview, Long id,
  1089. Integer type) {
  1090. modelview.setViewName("/portal/news/newsDetail");
  1091. modelview.addObject("type", type);
  1092. if (type == null)
  1093. type = 1;
  1094. if (type == 1) {
  1095. Pagination<NewsPortalList> newsList = newsService.portalNewsList(6, 1, null, 1, null, null, 2);
  1096. News newsDetail = newsService.findNewsDetail(id);
  1097. Object news = null;
  1098. if (newsList != null && newsList.getList().size() > 0)
  1099. news = newsList.getList().get(0);
  1100. if (null != newsDetail) {
  1101. newsDetail.setCreateTimeS(newsDetail.getCreateTime() != null
  1102. ? DateFormatUtils.format(newsDetail.getCreateTime(), AFTConstants.MMDDYYYY) : "");
  1103. String summary = newsDetail.getSummary();
  1104. modelview.addObject("hasHighTech",
  1105. summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
  1106. modelview.addObject("hasPatent",
  1107. summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
  1108. modelview.addObject("hasCopyright",
  1109. summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
  1110. modelview.addObject("hasTechProj",
  1111. summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
  1112. }
  1113. @SuppressWarnings("unchecked")
  1114. List<NewsPortalList> la = (List<NewsPortalList>) newsList.getList();
  1115. for (NewsPortalList n : la) {
  1116. String createTimeFormattedDate = n.getCreateTimeFormattedDate();
  1117. n.setDataS(createTimeFormattedDate);
  1118. }
  1119. if (newsDetail.getTitleImg() != null) {
  1120. String[] imgs = newsDetail.getTitleImg().split(",");
  1121. if (imgs[0] == null || imgs[0].length() < 1)
  1122. modelview.addObject("imgs", null);
  1123. else
  1124. modelview.addObject("imgs", imgs[0]);
  1125. }
  1126. modelview.addObject("newsDetail", newsDetail);
  1127. modelview.addObject("newsList", newsList.getList());
  1128. if (news != null)
  1129. modelview.addObject("news", news);
  1130. } else {
  1131. List<PolicyEntity> newsList = achievementService.getIntellectualProperty(6);
  1132. PolicyEntity newsDetail = newsService.getPolicyDetail(id + "");
  1133. if (null != newsDetail) {
  1134. String summary = newsDetail.getSummary();
  1135. modelview.addObject("hasHighTech",
  1136. summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
  1137. modelview.addObject("hasPatent",
  1138. summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
  1139. modelview.addObject("hasCopyright",
  1140. summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
  1141. modelview.addObject("hasTechProj",
  1142. summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
  1143. }
  1144. if (newsDetail.getTitleImg() != null) {
  1145. String[] imgs = newsDetail.getTitleImg().split(",");
  1146. if (imgs[0] == null || imgs[0].length() < 1)
  1147. modelview.addObject("imgs", null);
  1148. else
  1149. modelview.addObject("imgs", imgs[0]);
  1150. }
  1151. modelview.addObject("newsDetail", newsDetail);
  1152. modelview.addObject("newsList", newsList);
  1153. if (newsList != null && newsList.size() > 0)
  1154. modelview.addObject("news", newsList.get(0));
  1155. }
  1156. return modelview;
  1157. }
  1158. /**
  1159. * 新闻详情列表
  1160. */
  1161. @RequestMapping(value = "/portal/news/list", method = RequestMethod.GET)
  1162. @ResponseBody
  1163. public Result portalNewsList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
  1164. String keyword) {
  1165. Result res = new Result();
  1166. Integer pNo = 1, pSize = 4;
  1167. if (StringUtils.isNumeric(pageNo)) {
  1168. pNo = Integer.parseInt(pageNo);
  1169. }
  1170. if (StringUtils.isNumeric(pageSize)) {
  1171. pSize = Integer.parseInt(pageSize);
  1172. }
  1173. res.setData(newsService.portalNewsList(pSize, pNo, type, hot, provinceId, keyword, 2));
  1174. return res;
  1175. }
  1176. /**
  1177. * 政策列表
  1178. */
  1179. @RequestMapping(value = "/portal/policy/list", method = RequestMethod.GET)
  1180. @ResponseBody
  1181. public Result policyList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
  1182. String keyword) {
  1183. Result res = new Result();
  1184. Integer pNo = 1, pSize = 4;
  1185. if (StringUtils.isNumeric(pageNo)) {
  1186. pNo = Integer.parseInt(pageNo);
  1187. }
  1188. if (StringUtils.isNumeric(pageSize)) {
  1189. pSize = Integer.parseInt(pageSize);
  1190. }
  1191. res.setData(policyService.searchPolicy(keyword, 2, null, null, null, pNo, pSize, provinceId));
  1192. return res;
  1193. }
  1194. /**
  1195. * 全局搜索
  1196. */
  1197. @RequestMapping(value = "/portal/globalSearch", method = RequestMethod.GET)
  1198. @ResponseBody
  1199. public Result globalSearch(String name,String keyword,Integer pageSize,Integer pageNo) {
  1200. Result res = new Result();
  1201. res.setData(globalSearchService.globalSearchList(name,pageNo,pageSize));
  1202. return res;
  1203. }
  1204. /**
  1205. * 知识产权维权
  1206. * @param request
  1207. * @param modelview
  1208. * @return
  1209. */
  1210. @RequestMapping(value = "/portal/service/safeguarding", method = RequestMethod.GET)
  1211. public ModelAndView portalServiceSafeguarding(HttpServletRequest request, ModelAndView modelview){
  1212. modelview.setViewName("/portal/service/safeguarding");
  1213. return modelview;
  1214. }
  1215. /**
  1216. * 高企自评
  1217. * @param request
  1218. * @param modelview
  1219. * @return
  1220. */
  1221. @RequestMapping(value = "/portal/evaluation/evaluate", method = RequestMethod.GET)
  1222. public ModelAndView evaluate(HttpServletRequest request, ModelAndView modelview) {
  1223. modelview.setViewName("/portal/evaluation/evaluate");
  1224. return modelview;
  1225. }
  1226. /**
  1227. * 顾问详情
  1228. * @param modelview
  1229. * @return
  1230. */
  1231. @RequestMapping(value = "/portal/adviser/adviserDetail", method = RequestMethod.GET)
  1232. public ModelAndView adviserDetail(ModelAndView modelview,String id){
  1233. modelview.setViewName("/portal/adviser/adviserDetail");
  1234. ExpertsListBo adviserDetail = userIdentityService.selectExpertsDetail(id);
  1235. adviserDetail.setConsultantTypeName(ConsultantType.getDesc(adviserDetail.getConsultantType()));
  1236. modelview.addObject("adviserDetail", adviserDetail);
  1237. return modelview;
  1238. }
  1239. /**
  1240. * 顾问列表
  1241. * @param modelview
  1242. * @return
  1243. */
  1244. @RequestMapping(value = "/portal/adviser/adviserList", method = RequestMethod.GET)
  1245. public ModelAndView adviserList(ModelAndView modelview){
  1246. modelview.setViewName("/portal/adviser/adviserList");
  1247. return modelview;
  1248. }
  1249. /**
  1250. * 顾问首页
  1251. * @param modelview
  1252. * @return
  1253. */
  1254. @RequestMapping(value = "/portal/adviser", method = RequestMethod.GET)
  1255. public ModelAndView portalAdviser(ModelAndView modelview){
  1256. modelview.setViewName("/portal/adviser");
  1257. return modelview;
  1258. }
  1259. /**
  1260. * 搜索列表页
  1261. * @param modelview
  1262. * @return
  1263. */
  1264. @RequestMapping(value = "/portal/search", method = RequestMethod.GET)
  1265. public ModelAndView portalSearch(ModelAndView modelview){
  1266. modelview.setViewName("/portal/search");
  1267. return modelview;
  1268. }
  1269. /**
  1270. * 政策 资讯 百科
  1271. * @param policy
  1272. * @param pageNo
  1273. * @param pageSize
  1274. * @return
  1275. */
  1276. @RequestMapping(value="/portal/policyAndNewsList", method = RequestMethod.GET)
  1277. @ResponseBody
  1278. public Result policyAndNewsList(Policy policy, Integer pageNo, Integer pageSize){
  1279. Result res = new Result();
  1280. //如果type是null 查看政策和新闻等的数据
  1281. if(null == policy.getType() || "".equals(policy.getType())){
  1282. res.setData(policyService.searchPolicyAndNewsList(policy, pageNo, pageSize));
  1283. }else if(policy.getType() == 0 || policy.getType() == 99 || policy.getType() == 98 ){//资讯\观点\知产 news表
  1284. Pagination<News> listNews = newsService.listNews(policy.getType(), policy.getTitle(), null, null, null, null, null, pageNo, pageSize, "2", null, null,policy.getProvince());
  1285. @SuppressWarnings("unchecked")
  1286. Iterator<News> iterator = (Iterator<News>) listNews.getList().iterator();
  1287. while (iterator.hasNext()) {
  1288. News news = (News) iterator.next();
  1289. news.setType(1);
  1290. news.setHot(news.getHotspot());//是否热门处理
  1291. }
  1292. res.setData(listNews);
  1293. }else{//政策
  1294. Pagination<PolicyResult> policyList = policyService.searchPolicy(policy.getTitle(), 2, null, null, null, pageNo, pageSize, policy.getProvince());
  1295. @SuppressWarnings("unchecked")
  1296. Iterator<PolicyResult> iterator = (Iterator<PolicyResult>) policyList.getList().iterator();
  1297. while (iterator.hasNext()) {
  1298. PolicyResult policyResult = (PolicyResult) iterator.next();
  1299. policyResult.setType(0);
  1300. }
  1301. res.setData(policyList);
  1302. }
  1303. return res;
  1304. }
  1305. }