WebpageController.java 59 KB

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