| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089 |
- package com.goafanti.common.controller;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Date;
- import java.util.List;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletRequest;
- import org.apache.commons.lang3.time.DateFormatUtils;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.servlet.ModelAndView;
- import com.goafanti.achievement.service.AchievementInterestService;
- import com.goafanti.achievement.service.AchievementService;
- import com.goafanti.app.bo.consultantListBo;
- import com.goafanti.banners.enums.BannersType;
- import com.goafanti.banners.service.BannersService;
- import com.goafanti.business.bo.JtBusinessCategoryBo;
- import com.goafanti.business.bo.JtBusinessCategoryTree;
- import com.goafanti.business.bo.JtBusinessProjectResult;
- import com.goafanti.business.service.JtBusinessService;
- import com.goafanti.common.bo.PolicyEntity;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.bo.fieldGlossoryBo;
- import com.goafanti.common.constant.AFTConstants;
- import com.goafanti.common.constant.PageConstants;
- import com.goafanti.common.dao.ProjectInterestMapper;
- import com.goafanti.common.model.Achievement;
- import com.goafanti.common.model.AchievementInterest;
- import com.goafanti.common.model.Banners;
- import com.goafanti.common.model.Demand;
- import com.goafanti.common.model.DemandInterest;
- import com.goafanti.common.model.IndustryCategory;
- import com.goafanti.common.model.JtBusinessCategory;
- import com.goafanti.common.model.JtBusinessProject;
- import com.goafanti.common.model.News;
- import com.goafanti.common.model.Policy;
- import com.goafanti.common.model.ProjectInterest;
- import com.goafanti.common.model.User;
- import com.goafanti.common.utils.LimitLengthUtil;
- import com.goafanti.common.utils.StringUtils;
- import com.goafanti.core.mybatis.page.Pagination;
- import com.goafanti.core.shiro.token.TokenManager;
- import com.goafanti.demand.bo.DemandListBo;
- import com.goafanti.demand.service.DemandInterestService;
- import com.goafanti.demand.service.DemandService;
- import com.goafanti.user.bo.OrgIdentityBo;
- import com.goafanti.user.bo.UserIdentityBo;
- import com.goafanti.user.service.OrganizationIdentityService;
- import com.goafanti.user.service.UserIdentityService;
- import com.goafanti.user.service.UserService;
- import com.mysql.fabric.xmlrpc.base.Array;
- import com.goafanti.news.bo.NewsPortalList;
- import com.goafanti.news.bo.PolicyResult;
- import com.goafanti.news.enums.NewsType;
- import com.goafanti.news.service.NewsService;
- import com.goafanti.news.service.PolicyService;
- import com.goafanti.portal.bo.AchievementObject;
- @Controller
- public class WebpageController extends BaseController {
- @Resource
- private DemandService demandService;
- @Resource
- private AchievementService achievementService;
- @Resource
- private BannersService bannersService;
- @Resource
- private UserIdentityService userIdentityService;
- @Resource
- private OrganizationIdentityService organizationIdentityService;
- @Resource
- private NewsService newsService;
-
- @Resource
- private PolicyService policyService;
-
- @Resource
- private JtBusinessService jtBusinessService;
-
- @Resource
- private UserService userService;
-
- @Resource
- private AchievementInterestService achievementInterestService;
-
- @Resource
- private DemandInterestService demandInterestService;
-
- @Resource
- private ProjectInterestMapper projectInterestMapper;
- @RequestMapping(value = "/user/account/index", method = RequestMethod.GET)
- public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/index");
- return modelview;
- }
- @RequestMapping(value = "/user/account/evaluateInfo", method = RequestMethod.GET)
- public ModelAndView evaluateInfo(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/evaluateInfo");
- return modelview;
- }
- @RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
- public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/set");
- return modelview;
- }
- @RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
- public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/achievement");
- return modelview;
- }
- @RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
- public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/demand");
- return modelview;
- }
- @RequestMapping(value = "/user/login", method = RequestMethod.GET)
- public String userLogin(HttpServletRequest request, ModelAndView modelview) {
- return "/user/login";
- }
- @RequestMapping(value = "/user/logout", method = RequestMethod.GET)
- public String userLogout(HttpServletRequest request, ModelAndView modelview) {
- TokenManager.logout();
- // return userLogin(request, modelview);
- return "redirect:/portal/index";
- }
- @RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
- public String userSignin(HttpServletRequest request, ModelAndView modelview) {
- return "/user/signIn";
- }
- @RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
- public String mSignin(HttpServletRequest request, ModelAndView modelview) {
- return "/user/msignIn";
- }
- @RequestMapping(value = "/user/certify", method = RequestMethod.GET)
- public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/certify");
- return modelview;
- }
- @RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
- public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/groupCertify");
- return modelview;
- }
- @RequestMapping(value = "/user/account/services", method = RequestMethod.GET)
- public ModelAndView userServices(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/user/account/services");
- return modelview;
- }
- @RequestMapping(value = "/admin/login", method = RequestMethod.GET)
- public String adminLogin(HttpServletRequest request, ModelAndView modelview) {
- return "/admin/login";
- }
- @RequestMapping(value = "/admin/demand", method = RequestMethod.GET)
- public String adminDemand(HttpServletRequest request, ModelAndView modelview) {
- return "/admin/demand";
- }
- @RequestMapping(value = "/admin/achievement", method = RequestMethod.GET)
- public String adminAchievement(HttpServletRequest request, ModelAndView modelview) {
- return "/admin/achievement";
- }
- @RequestMapping(value = "/admin/set", method = RequestMethod.GET)
- public String adminSet(HttpServletRequest request, ModelAndView modelview) {
- return "/admin/set";
- }
- @RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
- public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/userManage");
- return modelview;
- }
- @RequestMapping(value = "/admin/customer", method = RequestMethod.GET)
- public ModelAndView adminCustomer(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/customer");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/technology", method = RequestMethod.GET)
- public ModelAndView adminServicesManageTechnology(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/technology");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
- public ModelAndView adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/patent");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/contract", method = RequestMethod.GET)
- public ModelAndView adminServicesManageContract(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/contract");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/highTech", method = RequestMethod.GET)
- public ModelAndView adminServicesManageHighTech(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/highTech");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/copyright", method = RequestMethod.GET)
- public ModelAndView adminServicesManageCopyright(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/copyright");
- return modelview;
- }
- @RequestMapping(value = "/admin/servicesManage/projectOrder", method = RequestMethod.GET)
- public ModelAndView adminServiceManageProjectOrder(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/servicesManage/projectOrder");
- return modelview;
- }
- @RequestMapping(value = "/admin/index", method = RequestMethod.GET)
- public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/index");
- return modelview;
- }
- @RequestMapping(value = "/admin/idea", method = RequestMethod.GET)
- public ModelAndView adminIdea(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/idea");
- return modelview;
- }
- @RequestMapping(value = "/admin/userOrder", method = RequestMethod.GET)
- public ModelAndView adminUserOrder(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/userOrder");
- return modelview;
- }
-
- @RequestMapping(value = "/portal/continueHigh", method = RequestMethod.GET)
- public ModelAndView portalContinueHigh(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/continueHigh");
- return modelview;
- }
- @RequestMapping(value = "/portal/militaryProject", method = RequestMethod.GET)
- public ModelAndView portalMilitaryProject(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/militaryProject");
- return modelview;
- }
- @RequestMapping(value = "/portal/practicalPatent", method = RequestMethod.GET)
- public ModelAndView portalPracticalPatent(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/practicalPatent");
- return modelview;
- }
- @RequestMapping(value = "/admin/order", method = RequestMethod.GET)
- public ModelAndView adminOrder(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/order");
- return modelview;
- }
- @RequestMapping(value = "/admin/operate", method = RequestMethod.GET)
- public ModelAndView adminOperate(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/admin/operate");
- return modelview;
- }
- @RequestMapping(value = "/portal/membership", method = RequestMethod.GET)
- public ModelAndView membership(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/membership");
- return modelview;
- }
- @RequestMapping(value = "/portal/search/subscriberUser", method = RequestMethod.GET)
- public ModelAndView portalSearchSubscriberUser(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/search/subscriberUser");
- return modelview;
- }
- @RequestMapping(value = "/portal/search/subscriberOrg", method = RequestMethod.GET)
- public ModelAndView portalSearchSubscriberOrg(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/search/subscriberOrg");
- return modelview;
- }
- /**
- * 评估页
- */
- @RequestMapping(value = "/portal/evaluation/index", method = RequestMethod.GET)
- public ModelAndView evaluation(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/evaluation/index");
- handleBanners(modelview, BannersType.JI_SHU_PING_GU);
- return modelview;
- }
- /**
- * 服务汇
- */
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/service/serviceIndex", method = RequestMethod.GET)
- public ModelAndView portalServiceServiceIndex(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/service/serviceIndex");
- //政策
- // List<PolicyEntity>policyEntities=achievementService.getIntellectualProperty(8);
- List<PolicyResult>policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_tech_service_index", 1, 8).getList();
- modelview.addObject("policyList",policies);
- //新闻
- List<News>news=(List<News>) newsService.portalNewsList(5, 1, null, null, null, null,2).getList();
- modelview.addObject("newsList",news);
- //高企服务
- JtBusinessCategory gaoqi=jtBusinessService.getBusinessCategoryByLayerAndName(1, "高企服务");
- JtBusinessCategory gaoqi2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "高企服务");
- if(gaoqi2!=null)
- {
- List<JtBusinessProject>gaoqiList=jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(),6,null);
- for(JtBusinessProject project:gaoqiList) {
- if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
- }
- modelview.addObject("gaoqiList",gaoqiList);
- modelview.addObject("gqc1",gaoqi);}
- //知识产权贯标
- JtBusinessCategory zscqgb=jtBusinessService.getBusinessCategoryByLayerAndName(1, "知识产权");
- if(zscqgb!=null) {
- List<JtBusinessCategory> zscqgbCategories=jtBusinessService.getBusinessCategoryBySuperId(zscqgb.getId(), 4);
- int[]zscqsizes= {1,2,4,10};
- businessHelper(modelview, "zscqgb", zscqgbCategories, zscqsizes);
- modelview.addObject("zscqc1",zscqgb);}
- //企业认证
- JtBusinessCategory qiyerenzheng=jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业认证");
- if(qiyerenzheng!=null) {
- List<JtBusinessCategory>qyrzCategories=jtBusinessService.getBusinessCategoryBySuperId(qiyerenzheng.getId(), 2);
- int []qyrzsizes= {8,8};
- businessHelper(modelview, "qyrz", qyrzCategories, qyrzsizes);
- modelview.addObject("qyrzc1",qiyerenzheng);}
- //管理体系
- JtBusinessCategory manageSys=jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系");
- JtBusinessCategory manageSys2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "管理体系");
- if(manageSys2!=null) {
- List<JtBusinessProject>manageSysPro=jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(), 18,null);
- modelview.addObject("manageSystemList",manageSysPro);
- modelview.addObject("managerSysc1",manageSys);}
- //科技项目
- JtBusinessCategory scienceProject=jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
- JtBusinessCategory scienceProject2=jtBusinessService.getBusinessCategoryByLayerAndName(2, "科技项目");
- if(scienceProject2!=null) {
- List<JtBusinessProject>scienceProjects=jtBusinessService.getBusinessProjectByCategoryId(scienceProject2.getId(), 12,AFTConstants.YES);
- modelview.addObject("scienceProjectList",scienceProjects);
- modelview.addObject("spc1",scienceProject);}
- //咨询师
- List<UserIdentityBo> userIdentityBos=userIdentityService.getExperts(8);
- // List<consultantListBo>userIdentityBos=userIdentityService.getConsultantList(8);
- modelview.addObject("consultants",userIdentityBos);
- return modelview;
- }
-
- /*
- * 服务详情
- *
- * @param id String
- * */
- @RequestMapping(value = "/portal/service/serviceDetail", method = RequestMethod.GET)
- public ModelAndView portalServiceServiceDetail(HttpServletRequest request, ModelAndView modelview,String id) {
- modelview.setViewName("/portal/service/serviceDetails");
- JtBusinessProject jtBusinessProject=jtBusinessService.getBusinessProjectDetail(id);
- if(jtBusinessProject!=null) {
- if(jtBusinessProject.getMaxImgUrl()!=null && jtBusinessProject.getMaxImgUrl().length()<=0)jtBusinessProject.setMaxImgUrl(null);
- }
- if(jtBusinessProject.getCreateTime()!=null && 7>=differentDaysByMillisecond(jtBusinessProject.getCreateTime(),new Date())) {
- modelview.addObject("newly",true);
- }
- else modelview.addObject("newly",false);
- String owner="平台管理员";
- if(jtBusinessProject.getOwnerId()!=null) {
- User user=userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
- if(user!=null && user.getIdentifyName()!=null) {
- owner=user.getIdentifyName();
- }
- }
- modelview.addObject("owner",owner);
- modelview.addObject("pj",jtBusinessProject);
- System.out.println(jtBusinessProject.toString());
- if(jtBusinessProject!=null) {
- JtBusinessCategoryTree tree=jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
- modelview.addObject("tree",tree);}
- JtBusinessCategory jtBusinessCategory=jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
- if(jtBusinessCategory!=null && jtBusinessCategory.getModule()!=null)modelview.addObject("module",jtBusinessCategory.getModule());
- else modelview.addObject("module",0);
-
- //是否关注
- if(StringUtils.isNotBlank(TokenManager.getUserId())) {
- int projectInterest=projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
- if(projectInterest>0)modelview.addObject("interested",true);
- }
- return modelview;
- }
-
-
- /*
- * 服务详情2
- *
- * @param id String
- * */
- @RequestMapping(value = "/portal/service/patentDetail", method = RequestMethod.GET)
- public ModelAndView portalServicePatentDetail(HttpServletRequest request, ModelAndView modelview,String id) {
- modelview.setViewName("/portal/service/patenteDetails");
- JtBusinessProject jtBusinessProject=jtBusinessService.getBusinessProjectDetail(id);
- if(jtBusinessProject!=null) {
- if(jtBusinessProject.getMaxImgUrl()!=null && jtBusinessProject.getMaxImgUrl().length()<=0)jtBusinessProject.setMaxImgUrl(null);
- }
- if(jtBusinessProject.getCreateTime()!=null && 7>=differentDaysByMillisecond(jtBusinessProject.getCreateTime(),new Date())) {
- modelview.addObject("newly",true);
- }
- else modelview.addObject("newly",false);
- String owner="平台管理员";
- if(jtBusinessProject.getOwnerId()!=null) {
- User user=userService.selectByPrimaryKey(jtBusinessProject.getOwnerId());
- if(user!=null && user.getIdentifyName()!=null) {
- owner=user.getIdentifyName();
- }
- }
- modelview.addObject("owner",owner);
- modelview.addObject("pj",jtBusinessProject);
- System.out.println(jtBusinessProject.toString());
- if(jtBusinessProject!=null) {
- JtBusinessCategoryTree tree=jtBusinessService.getCategoryTree(jtBusinessProject.getCategoryId());
- modelview.addObject("tree",tree);}
- JtBusinessCategory jtBusinessCategory=jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
- if(jtBusinessCategory!=null && jtBusinessCategory.getModule()!=null)modelview.addObject("module",jtBusinessCategory.getModule());
- else modelview.addObject("module",0);
-
- //是否关注
- if(StringUtils.isNotBlank(TokenManager.getUserId())) {
- int projectInterest=projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
- if(projectInterest>0)modelview.addObject("interested",true);
- }
- return modelview;
- }
-
-
- @RequestMapping(value="/portal/service/serviceList",method=RequestMethod.GET)
- public ModelAndView serviceList(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/service/serviceList");
- return modelview;
- }
-
- @RequestMapping(value="/portal/technologyTrading/demandList",method=RequestMethod.GET)
- public ModelAndView demandList(HttpServletRequest request, ModelAndView modelview) {
- String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- modelview.setViewName("/portal/technologyTrading/demandList");
- List<DemandListBo> boutiques=demandService.getHotDemand(3, url, "web_demand_list");
- modelview.addObject("boutiques",boutiques);
- return modelview;
- }
-
- @RequestMapping(value="/portal/technologyTrading/achievementList",method=RequestMethod.GET)
- public ModelAndView achievementList(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/technologyTrading/achievementList");
- List<AchievementObject>boutiques=achievementService.getBoutiquePatent(3);
- modelview.addObject("boutiques",boutiques);
- return modelview;
- }
-
- /**
- * 知识产权
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/service/propertyRight", method = RequestMethod.GET)
- public ModelAndView propertyRight(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/service/propertyRight");
- return modelview;
- }
- /**
- * 高企认定
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/service/highTechCognizance", method = RequestMethod.GET)
- public ModelAndView highTechCognizance(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/service/highTechCognizance");
- return modelview;
- }
- /**
- * 技术交易
- */
- @RequestMapping(value = "/portal/technologyTrading/index", method = RequestMethod.GET)
- public ModelAndView portalTechnologyTradingIndex(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/technologyTrading/index");
- handleBanners(modelview, BannersType.JI_SHU_JIAO_YI);
- List<NewsPortalList> newsPortalList = newsService.portalNewsPolicy();
- modelview.addObject("newsPortalList", newsPortalList);
- List<NewsPortalList> portalNewsQuestion = newsService.portalNewsQuestion();
- modelview.addObject("portalNewsQuestion", portalNewsQuestion);
- return modelview;
- }
- /**
- *
- * 智库咨询
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/thinkTank/index", method = RequestMethod.GET)
- public ModelAndView thinkTank(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/thinkTank/index");
- return modelview;
- }
- /**
- * 政策列表
- *
- * @return
- */
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/thinkTank/policyList", method = RequestMethod.GET)
- public ModelAndView policyList(ModelAndView modelview) {
- modelview.setViewName("/portal/thinkTank/policyList");
- List<NewsPortalList> newsList = (List<NewsPortalList>) newsService.portalNewsList(5, 1, null, null, null, null,2)
- .getList();
- modelview.addObject("newsList", newsList);
- return modelview;
- }
- /**
- * 会员介绍
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/member")
- public ModelAndView member(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/member");
- return modelview;
- }
- /**
- * 技术评估
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/technologyTrading/assessMent")
- public ModelAndView assessMent(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/technologyTrading/assessMent");
- modelview.addObject("zcfg", newsService.findIndexNewsList(0, NewsType.KJZX.getCode(), 4));
- return modelview;
- }
- /**
- * 关于我们
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/aboutUs", method = RequestMethod.GET)
- public ModelAndView aboutUs(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/aboutUs");
- return modelview;
- }
- /**
- * 联系我们
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/contactUs", method = RequestMethod.GET)
- public ModelAndView contactUs(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/contactUs");
- return modelview;
- }
- private void handleBanners(ModelAndView modelview, BannersType bannersType) {
- List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
- if (!banners.isEmpty()) {
- modelview.addObject("banners", banners);
- }
- }
- /**
- * 服务-推荐
- *
- * @param request
- * @param modelview
- * @return
- */
- @RequestMapping(value = "/portal/service/recommended")
- public ModelAndView recommended(HttpServletRequest request, ModelAndView modelview) {
- modelview.setViewName("/portal/service/recommended");
- return modelview;
- }
- /*
- * 首页
- *
- * */
-
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/index")
- public ModelAndView mainIndex(HttpServletRequest request, ModelAndView modelview) {
- String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- modelview.setViewName("/portal/index");
-
- List<JtBusinessCategoryBo> patentCategory=jtBusinessService.getCategoryBoList(1);
- patentCategory=patentCategory.subList(0, Math.min(3, patentCategory.size()));
- modelview.addObject("patentCategory",patentCategory);
- List<JtBusinessProject> jtBusinessProjects=(List<JtBusinessProject>) jtBusinessService.getProjects(null, null, null, 5, 1, 1, 2, 0, 1,0,0,null).getList();
- for(JtBusinessProject project:jtBusinessProjects) {
- if(project.getMaxImgUrl()!=null && project.getMaxImgUrl().length()<=0)project.setMaxImgUrl(null);
- if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
- }
- modelview.addObject("projects",jtBusinessProjects);
- List<PolicyResult>policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_index", 1, 2).getList();
- modelview.addObject("policys",policies);
- List<News>newsList=(List<News>) newsService.listNews(0, null, null, null, null, null, 1, 1, 3, "2", null, "web_index").getList();
- modelview.addObject("news",newsList);
- //
- List<News> subscriptions=(List<News>) newsService.listNews(0, null, null, null, null, null, null, 1, 4, "2", null, "web_index").getList();
- modelview.addObject("subscription",subscriptions);
-
- if(subscriptions!=null && subscriptions.size()>0 && subscriptions.get(0).getSourceUrl()!=null && subscriptions.get(0).getSourceUrl().contains(".")) {
- modelview.addObject("videoUrl",subscriptions.get(0).getSourceUrl());
- }
- // List<AchievementObject> achievementObjects=achievementService.getHotAchievements(9, url, "web_index");
- // modelview.addObject("achievements",achievementObjects);
- //
- //
- //
- //
- // List<DemandListBo> demandListBos=demandService.getHotDemand(9, url, "web_index");
- // for(DemandListBo demandListBo:demandListBos) {
- // if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- // else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- // }
- // //专家
- // List<UserIdentityBo>aExperts=userIdentityService.getExperts(8);
- // for(UserIdentityBo u:aExperts) {
- // if(u.getHeadPortraitUrl()!=null && u.getHeadPortraitUrl().length()<=0) {
- // u.setHeadPortraitUrl(null);
- // }
- // }
- // modelview.addObject("experts",aExperts);
- // modelview.addObject("demands",demandListBos);
-
- return modelview;
- }
-
- /*
-
-
- * 技淘3.0-科技需求页
- * @param request
- * @param modelview
- * @return
- *
- * */
- //需求首页
- @RequestMapping(value = "/portal/technologyTrading/demand")
- public ModelAndView demand(HttpServletRequest request, ModelAndView modelview) {
- String showLocation="web_demand_main";
- String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- modelview.setViewName("/portal/technologyTrading/demand");
- //行业
- List<fieldGlossoryBo> industryList = userIdentityService.domainList();
- modelview.addObject("industryList", industryList);
-
- //最新需求
- List<DemandListBo> recentDemandList=demandService.recentDemand(5,url,showLocation);
- LimitLengthUtil.limiteDemandCompanyAndName(recentDemandList, 18, 18);
- modelview.addObject("recentDemandList",recentDemandList);
- //
- // //加急需求
- List<DemandListBo> urgentDemand=demandService.getUrgentDemand(5,url,showLocation);
- List<DemandListBo> urgentDemand2=urgentDemand.subList(0, Math.min(2, urgentDemand.size()));
- List<DemandListBo> urgentDemand3=urgentDemand.subList( Math.min(2, urgentDemand.size()), Math.min(5, urgentDemand.size()));
- System.out.print("u2:"+urgentDemand2.size()+" u3:"+urgentDemand3.size());
- LimitLengthUtil.limiteDemandLength(urgentDemand2,13,30);
- LimitLengthUtil.limiteDemandLength(urgentDemand3,13,33);
- modelview.addObject("urgentDemand2",urgentDemand2);
- modelview.addObject("urgentDemand3",urgentDemand3);
-
- //热点需求
- List<DemandListBo> hotDemand=demandService.getHotDemand(5,url,showLocation);
- List<DemandListBo> hotDemand2=hotDemand.subList(0, Math.min(2, hotDemand.size()));
- List<DemandListBo> hotDemand3=hotDemand.subList( Math.min(2, hotDemand.size()), Math.min(5, hotDemand.size()));
- System.out.print("u2:"+hotDemand2.size()+" u3:"+hotDemand3.size());
- LimitLengthUtil.limiteDemandLength(hotDemand2,13,30);
- LimitLengthUtil.limiteDemandLength(hotDemand3,13,33);
- modelview.addObject("hotDemand2",hotDemand2);
- modelview.addObject("hotDemand3",hotDemand3);
-
-
- //企业技术需求
- List<DemandListBo> eightMaxCompanyDemand=demandService.companyDemand(8,url,showLocation);
- for(DemandListBo demandListBo:eightMaxCompanyDemand) {
- if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- }
- modelview.addObject("companyDemandList",eightMaxCompanyDemand);
-
- //地区产业需求 最多4个
- List<DemandListBo> fourMaxareaDemand=demandService.areaDemand(4,url,showLocation);
- for(DemandListBo demandListBo:fourMaxareaDemand) {
- if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- }
- LimitLengthUtil.limiteDemandLength(fourMaxareaDemand,10,208);
- modelview.addObject("areaDemandList",fourMaxareaDemand);
-
- //产学研需求 最多9个
- List<DemandListBo> nightMaxProLearnStudyDemand=demandService.proLearnStudyDemand(9,url,showLocation);
- for(DemandListBo demandListBo:nightMaxProLearnStudyDemand) {
- if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- }
- LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand,10,18);
- LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 18);
- modelview.addObject("proLearnStudyDemandList",nightMaxProLearnStudyDemand);
-
- //研产资金需求 最多4个
- List<DemandListBo> fourMaxFundDemand=demandService.getFundCrowdDemand(4,url,showLocation);
- for(DemandListBo demandListBo:fourMaxFundDemand) {
- if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- }
- LimitLengthUtil.limiteDemandLength(fourMaxFundDemand,9,30);
- modelview.addObject("fundDemandList",fourMaxFundDemand);
-
- //技术人才需求
- List<DemandListBo> sixMaxPersonnelDemand=demandService.getPersonnelDemand(6,url,showLocation);
- // List <DemandListBo>fourMaxPersonnelDemand=personnelDemand.subList(0,Math.min(6, personnelDemand.size()));
- for(DemandListBo demandListBo:sixMaxPersonnelDemand) {
- if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
- else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
- }
- LimitLengthUtil.limiteDemandLength(sixMaxPersonnelDemand,7,30);
- modelview.addObject("personnelDemandList",sixMaxPersonnelDemand);
- return modelview;
- }
-
- //需求详情
- @RequestMapping(value = "/portal/technologyTrading/demandDetail")
- public ModelAndView DemandDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
- String url=StringUtils.getDomainByHttpRequest(request);
- //详情
- DemandListBo demand=demandService.getDemandDetail(id, type);
- int countInterest=demandService.getInterestCount(id);
- demand.setCountInterest(countInterest+"");
- modelAndView.addObject("demand",demand);
-
- //精品需求
- List<DemandListBo>boutiqueDemandList=LimitLengthUtil.LimitListLengthRandomly(demandService.getHotDemand(10,url,"web_demand_list"),3,10);
- modelAndView.addObject("reboutiquedemand",boutiqueDemandList);
-
- //猜你喜欢
- List<DemandListBo>guessYouLikeList=LimitLengthUtil.LimitListLengthRandomly(demandService.recentDemand(10, url,"web_demand_list"), 4, 10);
- modelAndView.addObject("redemandlist",guessYouLikeList);
-
- //view
- modelAndView.setViewName("/portal/technologyTrading/demandDetail");
-
- //是否关注
- if(StringUtils.isNotBlank(TokenManager.getUserId())) {
- DemandInterest demandInterest=demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
- if(demandInterest!=null)modelAndView.addObject("interested",true);
- }
- return modelAndView;
- }
-
-
- //成果首页
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/technologyTrading/achievement", method = RequestMethod.GET)
- public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
- String showLocation="web_achievement_main";
- String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- modelview.setViewName("/portal/technologyTrading/achievement");
- //行业
- List<fieldGlossoryBo> industryList = userIdentityService.domainList();//行业类型 1级
- modelview.addObject("industryList", industryList);
- //最新成果
- List<AchievementObject>recentAchievements=achievementService.recentAchievements(5,url,showLocation);
- modelview.addObject("recentAchievements",recentAchievements);
- //热门关注
- List<AchievementObject> hotAchievements=achievementService.getHotAchievements(6,url,showLocation);
- modelview.addObject("hotAchievements",hotAchievements);
-
- //专利
- List<AchievementObject>patentAchievements=achievementService.getPatentList(9,url,showLocation);
- modelview.addObject("patents",patentAchievements);
- //实用技术
- List<AchievementObject>practicalTechnology=achievementService.getPracticalTechnologys(8,url,showLocation);
- modelview.addObject("practicalTechnology",practicalTechnology);
-
- // List<PolicyEntity>intellectualPropertyPolicyList=achievementService.getIntellectualProperty(5);
- List<PolicyResult> policies=(List<PolicyResult>) policyService.searchPolicy("", 2, null, null, "web_index", 1, 5).getList();
- modelview.addObject("policyList",policies);
- return modelview;
- }
-
- @RequestMapping(value = "/portal/technologyTrading/achievementDetail")
- public ModelAndView achievementDetail(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
- if(type==null) {type =1;}
- //详情
- AchievementObject achievementObject=achievementService.getAchievementDetail(id,type);
- modelAndView.addObject("achievementdetail",achievementObject);
- //精品
- List<AchievementObject>boutiques=LimitLengthUtil.LimitListLengthRandomly(achievementService.getBoutiquePatent(10),3,10);
- modelAndView.addObject("reboutiqueachievement",boutiques);
-
- //猜你喜欢
- List<AchievementObject> guess =LimitLengthUtil.LimitListLengthRandomly(achievementService.guessYouLike(10), 4, 10);
- modelAndView.addObject("guess",guess);
- //view
- modelAndView.setViewName("/portal/technologyTrading/achievementDetail");
-
- //是否关注
- if(StringUtils.isNotBlank(TokenManager.getUserId())){
- AchievementInterest achievementInterest=achievementInterestService.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
- if(achievementInterest!=null)modelAndView.addObject("isInterested",true);
- }
- return modelAndView;
- }
-
-
- @RequestMapping(value = "/portal/service/patentList")
- public ModelAndView patentList(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
-
- modelAndView.setViewName("/portal/service/patentList");
-
- return modelAndView;
- }
-
-
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/service/patent")
- public ModelAndView patentIndex(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
- List<JtBusinessCategoryBo> categoryBos=jtBusinessService.getCategoryBoList(1);
- modelAndView.addObject("categories",categoryBos);
- modelAndView.setViewName("/portal/service/patent");
-
- //最新发布
- List<JtBusinessProjectResult>recents=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(null, null, null, 4, 1,
- 1, 2, 1, null, 0, 0,null).getList();
- modelAndView.addObject("recent",recents);
-
- //专利服务-商标服务-版权服务
- for(JtBusinessCategoryBo c:categoryBos) {
- if("专利服务".equals(c.getTopLevel())){
- List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
- null, 3, 1, 1, 2, 1, null, 0, 0,null).getList();
- modelAndView.addObject("patentService",res);
- modelAndView.addObject("patentTopId",c.getTopLevelId());
- }
- else if("商标服务".equals(c.getTopLevel())){
- List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
- null, 4, 1, 1, 2, 1, null, 0, 0,null).getList();
- modelAndView.addObject("branchService",res);
- modelAndView.addObject("branchTopId",c.getTopLevelId());
- }
- else if("版权服务".equals(c.getTopLevel())){
- List<JtBusinessProjectResult>res=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(c.getTopLevelId(), null,
- null, 3, 1, 1, 2, 1, null, 0, 0,null).getList();
- modelAndView.addObject("copyrightService",res);
- modelAndView.addObject("copyrightTopId",c.getTopLevelId());
- }
-
- }
-
- //知产百科
- List<News> news=(List<News>) newsService.listNews(98, null, null, null, null, null, null, 1, 4, 2+"", null, "web_tech_service_index").getList();
- modelAndView.addObject("jtNews",news);
-
- return modelAndView;
- }
- /*
- * 交易
- * */
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/technologyTrading/tradingIndex")
- public ModelAndView patentTrading(HttpServletRequest request, ModelAndView modelAndView) {
- String showLocation="web_demand_trading_index";
- String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- modelAndView.setViewName("/portal/technologyTrading/tradingIndex");
- //成果
- List<AchievementObject>achievementObjects=achievementService.getHotAchievements(4, url, showLocation);
- modelAndView.addObject("achievement",achievementObjects);
-
- //需求
- List<DemandListBo>demandListBos=demandService.getHotDemand(2, url,showLocation);
- modelAndView.addObject("demand",demandListBos);
-
- //政策
- List<Policy> policies=(List<Policy>) policyService.searchPolicy(null, 2, null, null, "web_index", 1, 5).getList();
- modelAndView.addObject("policy",policies);
-
- //专家
- List<UserIdentityBo> userIdentityBos=userIdentityService.getExperts(3);
- modelAndView.addObject("expert",userIdentityBos);
-
- return modelAndView;
- }
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/portal/companyProfile")
- public ModelAndView companyProfile(HttpServletRequest request, ModelAndView modelAndView,String uid) {
- modelAndView.setViewName("/portal/companyProfile");
- OrgIdentityBo org=organizationIdentityService.selectOrgIdentityBoByUserId(uid);
- modelAndView.addObject("org",org);
- List<JtBusinessProjectResult>projectResults=(List<JtBusinessProjectResult>) jtBusinessService.getProjects(null, null, null, 4, 1, 0, 2, null, null, 0, 1,uid).getList();
- modelAndView.addObject("jtProjects",projectResults);
- String honor=org.getHonorPicture();
- if(honor!=null && honor.contains(".")) {
- List<String>honorPictures=Arrays.asList(honor.split(","));
- if(honorPictures.size()>0)modelAndView.addObject("honors",honorPictures);
-
- }
- return modelAndView;
- }
-
- private void businessHelper(ModelAndView modelAndView,String categoryName,List<JtBusinessCategory> jtBusinessCategories,int[] sizes) {
- for(int i=0;i<jtBusinessCategories.size();i++) {
- List<JtBusinessProject>projects=jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategories.get(i).getId(), sizes[i],null);
- modelAndView.addObject(categoryName+i,jtBusinessCategories.get(i));
- modelAndView.addObject(categoryName+"List"+i,projects);
- }
-
- }
-
- public static int differentDaysByMillisecond(Date date1,Date date2)
- {
- int days = (int) ((date2.getTime() - date1.getTime()) / (1000*3600*24));
- return days;
- }
-
-
- @RequestMapping(value = "/portal/technologyTrading/shopList")
- public ModelAndView shopList(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
- modelAndView.setViewName("/portal/technologyTrading/shopList");
- return modelAndView;
- }
-
- /*
- - *
- - * type 0-政策 1-新闻
- - * */
- @RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
- public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview, Long id,Integer type) {
- modelview.setViewName("/portal/news/newsDetail");
- modelview.addObject("type",type);
- if(type ==null )type=1;
- if(type ==1) {
- Pagination<NewsPortalList> newsList = newsService.portalNewsList(6, 1, 5, null, null, null,2);
- News newsDetail = newsService.findNewsDetail(id);
- Object news =null;
- if(newsList!=null && newsList.getList().size()>0)news= newsList.getList().get(0);
- if (null != newsDetail) {
- newsDetail.setCreateTimeS(newsDetail.getCreateTime() != null
- ? DateFormatUtils.format(newsDetail.getCreateTime(), AFTConstants.MMDDYYYY) : "");
- String summary = newsDetail.getSummary();
- modelview.addObject("hasHighTech",
- summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
- modelview.addObject("hasPatent",
- summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
- modelview.addObject("hasCopyright",
- summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
- modelview.addObject("hasTechProj",
- summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
- }
- @SuppressWarnings("unchecked")
- List<NewsPortalList> la = (List<NewsPortalList>) newsList.getList();
- for (NewsPortalList n : la) {
- String createTimeFormattedDate = n.getCreateTimeFormattedDate();
- n.setDataS(createTimeFormattedDate);
- }
- if(newsDetail.getTitleImg()!=null) {
- String[] imgs=newsDetail.getTitleImg().split(",");
- if(imgs[0]==null || imgs[0].length()<1)modelview.addObject("imgs",null);
- else
- modelview.addObject("imgs",imgs[0]);
- }
- modelview.addObject("newsDetail", newsDetail);
- modelview.addObject("newsList", newsList.getList());
- if(news!=null)
- modelview.addObject("news", news);
-
- }
- else {
- List<PolicyEntity> newsList = achievementService.getIntellectualProperty(6);
- PolicyEntity newsDetail = newsService.getPolicyDetail(id+"");
- if (null != newsDetail) {
-
- String summary = newsDetail.getSummary();
- modelview.addObject("hasHighTech",
- summary != null && (summary.indexOf("高新") > -1 || summary.indexOf("高企") > -1));
- modelview.addObject("hasPatent",
- summary != null && (summary.indexOf("专利") > -1 || summary.indexOf("知识产权") > -1));
- modelview.addObject("hasCopyright",
- summary != null && (summary.indexOf("软著") > -1 || summary.indexOf("知识产权") > -1));
- modelview.addObject("hasTechProj",
- summary != null && (summary.indexOf("科技") > -1 || summary.indexOf("项目") > -1));
- }
- @SuppressWarnings("unchecked")
- List<PolicyEntity> la = (List<PolicyEntity>) newsList;
- if(newsDetail.getTitleImg()!=null) {
- String[] imgs=newsDetail.getTitleImg().split(",");
- if(imgs[0]==null || imgs[0].length()<1)modelview.addObject("imgs",null);
- else
- modelview.addObject("imgs",imgs[0]);
- }
- modelview.addObject("newsDetail", newsDetail);
- modelview.addObject("newsList", newsList);
- if(newsList!=null && newsList.size()>0)
- modelview.addObject("news", newsList.get(0));
- }
- return modelview;
- }
-
- /**
- * 新闻详情列表
- */
- @RequestMapping(value = "/portal/news/list", method = RequestMethod.GET)
- @ResponseBody
- public Result portalNewsList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
- String keyword) {
- Result res = new Result();
- Integer pNo = 1, pSize = 4;
- if (StringUtils.isNumeric(pageNo)) {
- pNo = Integer.parseInt(pageNo);
- }
- if (StringUtils.isNumeric(pageSize)) {
- pSize = Integer.parseInt(pageSize);
- }
- res.setData(newsService.portalNewsList(pSize, pNo, type, hot, provinceId, keyword,2));
- return res;
- }
- /**
- * 政策列表
- */
- @RequestMapping(value = "/portal/policy/list", method = RequestMethod.GET)
- @ResponseBody
- public Result policyList(Integer type, String pageSize, String pageNo, Integer hot, Integer provinceId,
- String keyword) {
- Result res = new Result();
- Integer pNo = 1, pSize = 4;
- if (StringUtils.isNumeric(pageNo)) {
- pNo = Integer.parseInt(pageNo);
- }
- if (StringUtils.isNumeric(pageSize)) {
- pSize = Integer.parseInt(pageSize);
- }
- res.setData(policyService.searchPolicy( keyword,2, null, null, "web_index", pNo, pSize));
- return res;
- }
- }
|