|
|
@@ -1,33 +1,20 @@
|
|
|
package com.kede.common.controller;
|
|
|
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.data.convert.ReadingConverter;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
-import org.springframework.web.servlet.view.RedirectView;
|
|
|
|
|
|
-import com.kede.banners.bo.InputBannerDetails;
|
|
|
-import com.kede.banners.bo.OutBannerDetails;
|
|
|
import com.kede.banners.service.BannersService;
|
|
|
-import com.kede.common.constant.AFTConstants;
|
|
|
-import com.kede.common.utils.DateUtils;
|
|
|
-import com.kede.customerCase.bo.InputCustomerCase;
|
|
|
import com.kede.customerCase.service.CustomerCaseService;
|
|
|
-import com.kede.news.bo.InputNews;
|
|
|
-import com.kede.news.bo.OutNews;
|
|
|
import com.kede.news.service.NewsService;
|
|
|
-import com.kede.organization.bo.InputOrganization;
|
|
|
import com.kede.organization.service.OrganizationService;
|
|
|
|
|
|
|
|
|
-@Controller
|
|
|
+@ReadingConverter
|
|
|
+@RequestMapping(value = "/open")
|
|
|
public class publicApiController extends BaseController {
|
|
|
|
|
|
@Resource
|
|
|
@@ -39,130 +26,6 @@ public class publicApiController extends BaseController {
|
|
|
@Resource
|
|
|
private OrganizationService organizationService;
|
|
|
|
|
|
- @RequestMapping(value = "/admin/login", method = RequestMethod.GET)
|
|
|
- public ModelAndView adminLogin(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- modelview.setViewName("/admin/login");
|
|
|
- return modelview;
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping(value = "/admin/index", method = RequestMethod.GET)
|
|
|
- public ModelAndView adminHome(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- modelview.setViewName("/admin/index");
|
|
|
- return modelview;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 关于科德
|
|
|
- * @param request
|
|
|
- * @param modelview
|
|
|
- * @return
|
|
|
- */
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @RequestMapping(value = "/portal/aboutKede", method = RequestMethod.GET)
|
|
|
- public ModelAndView portalAboutKede(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- modelview.setViewName("/portal/aboutKede");
|
|
|
- InputBannerDetails ibd=new InputBannerDetails(1,5);
|
|
|
- OutBannerDetails o=new OutBannerDetails();
|
|
|
- List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
|
|
|
- o=list.size()>0?list.get(0):null;
|
|
|
- modelview.addObject("banners",o);
|
|
|
- return modelview;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 联系我们
|
|
|
- * @param request
|
|
|
- * @param modelview
|
|
|
- * @return
|
|
|
- */
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @RequestMapping(value = "/portal/contactUs", method = RequestMethod.GET)
|
|
|
- public ModelAndView portalContactUs(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- modelview.setViewName("/portal/contactUs");
|
|
|
- InputBannerDetails ibd=new InputBannerDetails(1,6);
|
|
|
- OutBannerDetails o=new OutBannerDetails();
|
|
|
- List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
|
|
|
- o=list.size()>0?list.get(0):null;
|
|
|
- modelview.addObject("banners",o);
|
|
|
- return modelview;
|
|
|
- }
|
|
|
- /**
|
|
|
- * 新闻详情
|
|
|
- * @param request
|
|
|
- * @param modelview
|
|
|
- * @return
|
|
|
- */
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @RequestMapping(value = "/portal/newsDetails", method = RequestMethod.GET)
|
|
|
- public ModelAndView portalNewsDetails(HttpServletRequest request, ModelAndView modelview,Integer id) {
|
|
|
- modelview.setViewName("/portal/news/newsDetails");
|
|
|
- InputBannerDetails ibd=new InputBannerDetails(1,4);
|
|
|
- OutBannerDetails o=new OutBannerDetails();
|
|
|
- List<OutBannerDetails> list=(List<OutBannerDetails>) bannersService.listBannersDetails(ibd, 1, 1).getList();
|
|
|
- o=list.size()>0?list.get(0):null;
|
|
|
- modelview.addObject("banners",o);
|
|
|
- modelview.addObject("news",newsService.selectNews(new InputNews(id)));
|
|
|
- return modelview;
|
|
|
- }
|
|
|
-
|
|
|
- @RequestMapping(value = "/", method = RequestMethod.GET)
|
|
|
- public ModelAndView home(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- RedirectView rv = new RedirectView();
|
|
|
- modelview.setViewName("/portal/index");
|
|
|
- rv.setExposeModelAttributes(false);
|
|
|
- modelview.setView(rv);
|
|
|
- return modelview;
|
|
|
- }
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @RequestMapping(value = "/portal/index", method = RequestMethod.GET)
|
|
|
- public ModelAndView protalIndex(HttpServletRequest request, ModelAndView modelview) {
|
|
|
- modelview.setViewName("/portal/index");
|
|
|
- //获取轮播图
|
|
|
- InputBannerDetails ibd=new InputBannerDetails(1,0);
|
|
|
- modelview.addObject("banners",bannersService.listBannersDetails(ibd, 5, 1).getList());
|
|
|
- //获取服务客户20个
|
|
|
- InputCustomerCase ic=new InputCustomerCase();
|
|
|
- ic.setReleaseStatus(1);
|
|
|
- ic.setStatus(1);
|
|
|
- modelview.addObject("clist1",customerCaseService.listCustomerCase(ic, 10, 1).getList());
|
|
|
- modelview.addObject("clist2",customerCaseService.listCustomerCase(ic, 10, 2).getList());
|
|
|
- //获取公司新闻1个与3个,获取行业新闻3个
|
|
|
- InputNews in=new InputNews();
|
|
|
- in.setType(0);
|
|
|
- in.setStatus(1);
|
|
|
- List<OutNews>list=(List<OutNews>) newsService.listnewsDetails(in, 4, 1).getList();
|
|
|
- OutNews gs1=new OutNews();
|
|
|
- List<OutNews> gs2=new ArrayList<>();
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- list.get(i).setReleaseTimeConvert(DateUtils.formatDate(list.get(i).getReleaseTime(), AFTConstants.MMDD));
|
|
|
- list.get(i).setContent(displayRestriction(list.get(i).getContent()));
|
|
|
- if (i==1) {
|
|
|
- gs1=list.get(i);
|
|
|
- }else {
|
|
|
- gs2.add(list.get(i));
|
|
|
- }
|
|
|
- }
|
|
|
- in.setType(1);
|
|
|
- modelview.addObject("gs1", gs1);
|
|
|
- modelview.addObject("gs2", gs2);
|
|
|
- List<OutNews>hy=(List<OutNews>) newsService.listnewsDetails(in, 3, 1).getList();
|
|
|
- for (OutNews o : hy) {
|
|
|
- o.setReleaseTimeConvert(DateUtils.formatDate(o.getReleaseTime(), AFTConstants.MMDD));
|
|
|
- o.setContent(displayRestriction(o.getContent()));
|
|
|
- }
|
|
|
- modelview.addObject("hy", hy);
|
|
|
- //获取战略合作16个
|
|
|
- InputOrganization ir=new InputOrganization();
|
|
|
- ir.setReleaseStatus(1);
|
|
|
- modelview.addObject("orgList1", organizationService.listOrganization(ir, 8, 1).getList());
|
|
|
- modelview.addObject("orgList2", organizationService.listOrganization(ir, 8, 2).getList());
|
|
|
- return modelview;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- public String displayRestriction(String str) {
|
|
|
- if(str.length()>24)str=str.substring(0, 24)+"...";
|
|
|
- return str;
|
|
|
- }
|
|
|
|
|
|
}
|