From 9735a3f8f1bb8d1495139eeea55f7b7d0644201c Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Mon, 13 Jan 2025 14:21:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/home/HomeController.java | 341 +---------------- .../controller/home/HomeOldController.java | 344 ++++++++++++++++++ 2 files changed, 357 insertions(+), 328 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeOldController.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeController.java index 390bb79..dea0024 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeController.java @@ -1,349 +1,34 @@ package com.ruoyi.web.controller.home; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.convert.Convert; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.github.pagehelper.PageInfo; -import com.github.pagehelper.page.PageMethod; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.*; -import com.ruoyi.system.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; /** - * 首页门户 - * @author wangxy + * ClassName: HomeController + * Package: com.ruoyi.web.controller.home + * Description: + * + * @Author wangxy + * @Create 2025/1/13 14:19 + * @Version 1.0 */ @Api("首页门户") @Controller public class HomeController { - @Autowired - private ISysNoticeService noticeService; - - @Autowired - private ISysWorkService workService; - - @Autowired - private ISysDeptTrendsService trendsService; - - @Autowired - private ISysBusinessService businessService; - - @Autowired - private ISysSpecialService specialService; - - @Autowired - private ISysOperLogService operLogService; - - @Autowired - private ISysContentService contentService; - - @Autowired - private ISysColumnService columnService; - - - public static final String PAGE_SIZE = "15"; - - //栏目等级 - public static final String COLUMN_GRADE = "2"; - //部门动态类型 - public static final String DEPT_COLUMN_TYPE = "1"; - //专题活动类型 - public static final String SPECIAL_COLUMN_TYPE = "2"; - - //专题活动类型 - public static final String WINDOW_COLUMN_TYPE = "3"; - - public static final String STATUS = "0"; - - - @Log(title = Constants.WEBSITE_ACCESS, businessType = BusinessType.OTHER) - @ApiOperation("首页门户") - @GetMapping("/home") - public String home(ModelMap mmap) { - //最新通知 - List urlList = workService.selectWorkHomeUrl(new SysWork()); - mmap.put("urlList", urlList); - List list = noticeService.selectNoticeHomeList(new SysNotice()); - mmap.put("noticeList", list); - //工作动态 - List workList = workService.selectSysWorkHomeList(new SysWork()); - mmap.put("workList", workList); - //检查业务 - List businessList = businessService.selectSysBusinessHomeList(new SysBusiness()); - mmap.put("businessList", businessList); - //网站内容 - List contentList = contentService.selectSysContentHomeList(new SysContent()); - mmap.put("contentList", contentList); - - //部门动态对应的栏目 - LambdaQueryWrapper query= new LambdaQueryWrapper<>(); - query.eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE); - query.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - query.eq(SysColumn::getStatus,STATUS); - query.last("limit 23"); - query.orderByAsc(SysColumn::getOrderNum); - List deptColumns = columnService.list(query); - mmap.put("deptColumns", deptColumns); - //专题活动对应的栏目 - LambdaQueryWrapper queryWrapper= new LambdaQueryWrapper<>(); - queryWrapper.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE); - queryWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - queryWrapper.eq(SysColumn::getStatus,STATUS); - queryWrapper.last("limit 6"); - queryWrapper.orderByAsc(SysColumn::getOrderNum); - List specialColumns = columnService.list(queryWrapper); - mmap.put("specialColumns", specialColumns); - //兰铁之窗的栏目 - LambdaQueryWrapper windowWrapper= new LambdaQueryWrapper<>(); - windowWrapper.eq(SysColumn::getColumnType, WINDOW_COLUMN_TYPE); - windowWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - windowWrapper.eq(SysColumn::getStatus,STATUS); - windowWrapper.orderByAsc(SysColumn::getOrderNum); - List windowColumns = columnService.list(windowWrapper); - mmap.put("windowColumns", windowColumns); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/base"; - } - - /** - * - * - * @param mmap - * @return java.lang.String - */ - @ApiOperation("首页") - @GetMapping("/base.html") - public String base(ModelMap mmap) { - //最新通知 - List urlList = workService.selectWorkHomeUrl(new SysWork()); - mmap.put("urlList", urlList); - List list = noticeService.selectNoticeHomeList(new SysNotice()); - mmap.put("noticeList", list); - //工作动态 - List workList = workService.selectSysWorkHomeList(new SysWork()); - mmap.put("workList", workList); - //检查业务 - List businessList = businessService.selectSysBusinessHomeList(new SysBusiness()); - mmap.put("businessList", businessList); - //网站内容 - List contentList = contentService.selectSysContentHomeList(new SysContent()); - mmap.put("contentList", contentList); - - //部门动态对应的栏目 - LambdaQueryWrapper query= new LambdaQueryWrapper<>(); - query.eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE); - query.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - query.eq(SysColumn::getStatus,STATUS); - query.last("limit 23"); - query.orderByAsc(SysColumn::getOrderNum); - List deptColumns = columnService.list(query); - mmap.put("deptColumns", deptColumns); - - //专题活动对应的栏目 - LambdaQueryWrapper queryWrapper= new LambdaQueryWrapper<>(); - queryWrapper.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE); - queryWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - queryWrapper.eq(SysColumn::getStatus,STATUS); - queryWrapper.last("limit 6"); - queryWrapper.orderByAsc(SysColumn::getOrderNum); - List specialColumns = columnService.list(queryWrapper); - mmap.put("specialColumns", specialColumns); - - LambdaQueryWrapper windowWrapper= new LambdaQueryWrapper<>(); - windowWrapper.eq(SysColumn::getColumnType, WINDOW_COLUMN_TYPE); - windowWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); - windowWrapper.eq(SysColumn::getStatus,STATUS); - windowWrapper.orderByAsc(SysColumn::getOrderNum); - List windowColumns = columnService.list(windowWrapper); - mmap.put("windowColumns", windowColumns); - - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/base"; - } - - @ApiOperation("通知公告") - @GetMapping("/announce_view.html") - public String announce(ModelMap mmap, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { - - PageMethod.startPage(pageNum,pageSize); - //最新通知 - SysNotice sysNotice = new SysNotice(); - sysNotice.setStatus(STATUS); - List list = noticeService.selectNoticeList(sysNotice); - PageInfo page = new PageInfo<>(list, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/announce_view.html"); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/announce_view"; - } - - @ApiOperation("工作动态") - @GetMapping("/work_view.html") - public String work(ModelMap mmap, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { - PageMethod.startPage(pageNum,pageSize); - //工作动态 - SysWork sysWork = new SysWork(); - sysWork.setStatus(STATUS); - List workList = workService.selectSysWorkList(sysWork); - PageInfo page = new PageInfo<>(workList, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/work_view.html"); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/work_view"; - } - - @ApiOperation("部门动态") - @GetMapping("/dept_trends_view.html") - public String trends(ModelMap mmap, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, - @RequestParam(required = false ) String columnId) { - - //部门动态对应的栏目 - List deptColumns = columnService.lambdaQuery() - .eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE) - .eq(SysColumn::getColumnGrade, COLUMN_GRADE) - .eq(SysColumn::getStatus,STATUS) - .orderByAsc(SysColumn::getOrderNum) - .list(); - mmap.put("deptColumns", deptColumns); - - PageMethod.startPage(pageNum,pageSize); - //部门动态 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(SysDeptTrends::getStatus,STATUS); - if(StringUtils.isNotBlank(columnId)){ - queryWrapper.eq(SysDeptTrends::getColumnId, columnId); - } - List deptTrends = trendsService.list(queryWrapper); - PageInfo page = new PageInfo<>(deptTrends, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/dept_trends_view.html"); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - - mmap.put("columnId", columnId); - return "home/dept_trends_view"; - } - - @ApiOperation("检查业务") - @GetMapping("/business_view.html") - public String check(ModelMap mmap, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { - PageMethod.startPage(pageNum,pageSize); - //检查业务 - SysBusiness sysBusiness = new SysBusiness(); - sysBusiness.setStatus(STATUS); - List businessList = businessService.selectSysBusinessList(sysBusiness); - PageInfo page = new PageInfo<>(businessList, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/business_view.html"); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/business_view"; - } - - @ApiOperation("专题活动") - @GetMapping("/special_view.html") - public String special(ModelMap mmap, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, - @RequestParam(required = false ) String columnId - ) { - PageMethod.startPage(pageNum,pageSize); - //专题活动 - SysSpecial sysSpecial = new SysSpecial(); - sysSpecial.setStatus(STATUS); - sysSpecial.setColumnId(columnId); - List specialList = specialService.selectSysSpecialList(sysSpecial); - PageInfo page = new PageInfo<>(specialList, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/special_view.html"); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - //专题活动对应的栏目 - List specialColumns = columnService.lambdaQuery() - .eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE) - .eq(SysColumn::getColumnGrade, COLUMN_GRADE) - .eq(SysColumn::getStatus,STATUS) - .orderByAsc(SysColumn::getOrderNum) - .list(); - mmap.put("specialColumns", specialColumns); - - mmap.put("columnId", columnId); - - return "home/special_view"; - } - - - @ApiOperation("详情") - @GetMapping("/public_view.html") - public String notice(ModelMap mmap,@RequestParam(required = false) String type, @RequestParam String id) { - SysNotice sysNotice = noticeService.selectNoticeById(id); - mmap.put("sysNotice", sysNotice); - SysWork sysWork = workService.selectSysWorkById(id); - mmap.put("sysWork", sysWork); - SysDeptTrends sysDeptTrends = trendsService.selectSysDeptTrendsById(id); - mmap.put("sysDeptTrends", sysDeptTrends); - - SysBusiness sysBusiness = businessService.selectSysBusinessById(id); - mmap.put("sysBusiness", sysBusiness); - - SysSpecial sysSpecial = specialService.selectSysSpecialById(id); - mmap.put("sysSpecial", sysSpecial); - mmap.put("type", type); - //访问量 - /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); - mmap.put("total", total);*/ - return "home/public_view"; - } - @ApiOperation("搜索") - @GetMapping("/search") - public String search(ModelMap mmap, @RequestParam(required = false) String title, - @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, - @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { - PageMethod.startPage(pageNum,pageSize); - List sysTitleVos = noticeService.selectNoticeHomeSearch(title); - PageInfo page = new PageInfo<>(sysTitleVos, pageSize); - mmap.put("page", page); - mmap.put("pageUrl", "/search"); - mmap.put("title", title); - return "home/search _list"; - } + @Log(title = Constants.WEBSITE_ACCESS, businessType = BusinessType.OTHER) + @ApiOperation("首页门户") + @GetMapping("/home") + public String home(ModelMap mmap) { + return "law/base"; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeOldController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeOldController.java new file mode 100644 index 0000000..e35a3cd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/home/HomeOldController.java @@ -0,0 +1,344 @@ +package com.ruoyi.web.controller.home; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.pagehelper.PageInfo; +import com.github.pagehelper.page.PageMethod; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.*; +import com.ruoyi.system.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; + +/** + * 首页门户 + * @author wangxy + */ +@Api("首页门户") +@Controller +public class HomeOldController { + + @Autowired + private ISysNoticeService noticeService; + + @Autowired + private ISysWorkService workService; + + @Autowired + private ISysDeptTrendsService trendsService; + + @Autowired + private ISysBusinessService businessService; + + @Autowired + private ISysSpecialService specialService; + + @Autowired + private ISysOperLogService operLogService; + + @Autowired + private ISysContentService contentService; + + @Autowired + private ISysColumnService columnService; + + + public static final String PAGE_SIZE = "15"; + + //栏目等级 + public static final String COLUMN_GRADE = "2"; + //部门动态类型 + public static final String DEPT_COLUMN_TYPE = "1"; + //专题活动类型 + public static final String SPECIAL_COLUMN_TYPE = "2"; + + //专题活动类型 + public static final String WINDOW_COLUMN_TYPE = "3"; + + public static final String STATUS = "0"; + + + @Log(title = Constants.WEBSITE_ACCESS, businessType = BusinessType.OTHER) + @ApiOperation("首页门户") + @GetMapping("/homeOld") + public String home(ModelMap mmap) { + //最新通知 + List urlList = workService.selectWorkHomeUrl(new SysWork()); + mmap.put("urlList", urlList); + List list = noticeService.selectNoticeHomeList(new SysNotice()); + mmap.put("noticeList", list); + //工作动态 + List workList = workService.selectSysWorkHomeList(new SysWork()); + mmap.put("workList", workList); + //检查业务 + List businessList = businessService.selectSysBusinessHomeList(new SysBusiness()); + mmap.put("businessList", businessList); + //网站内容 + List contentList = contentService.selectSysContentHomeList(new SysContent()); + mmap.put("contentList", contentList); + + //部门动态对应的栏目 + LambdaQueryWrapper query= new LambdaQueryWrapper<>(); + query.eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE); + query.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + query.eq(SysColumn::getStatus,STATUS); + query.last("limit 23"); + query.orderByAsc(SysColumn::getOrderNum); + List deptColumns = columnService.list(query); + mmap.put("deptColumns", deptColumns); + //专题活动对应的栏目 + LambdaQueryWrapper queryWrapper= new LambdaQueryWrapper<>(); + queryWrapper.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE); + queryWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + queryWrapper.eq(SysColumn::getStatus,STATUS); + queryWrapper.last("limit 6"); + queryWrapper.orderByAsc(SysColumn::getOrderNum); + List specialColumns = columnService.list(queryWrapper); + mmap.put("specialColumns", specialColumns); + //兰铁之窗的栏目 + LambdaQueryWrapper windowWrapper= new LambdaQueryWrapper<>(); + windowWrapper.eq(SysColumn::getColumnType, WINDOW_COLUMN_TYPE); + windowWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + windowWrapper.eq(SysColumn::getStatus,STATUS); + windowWrapper.orderByAsc(SysColumn::getOrderNum); + List windowColumns = columnService.list(windowWrapper); + mmap.put("windowColumns", windowColumns); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/base"; + } + + /** + * + * + * @param mmap + * @return java.lang.String + */ + @ApiOperation("首页") + @GetMapping("/base.html") + public String base(ModelMap mmap) { + //最新通知 + List urlList = workService.selectWorkHomeUrl(new SysWork()); + mmap.put("urlList", urlList); + List list = noticeService.selectNoticeHomeList(new SysNotice()); + mmap.put("noticeList", list); + //工作动态 + List workList = workService.selectSysWorkHomeList(new SysWork()); + mmap.put("workList", workList); + //检查业务 + List businessList = businessService.selectSysBusinessHomeList(new SysBusiness()); + mmap.put("businessList", businessList); + //网站内容 + List contentList = contentService.selectSysContentHomeList(new SysContent()); + mmap.put("contentList", contentList); + + //部门动态对应的栏目 + LambdaQueryWrapper query= new LambdaQueryWrapper<>(); + query.eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE); + query.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + query.eq(SysColumn::getStatus,STATUS); + query.last("limit 23"); + query.orderByAsc(SysColumn::getOrderNum); + List deptColumns = columnService.list(query); + mmap.put("deptColumns", deptColumns); + + //专题活动对应的栏目 + LambdaQueryWrapper queryWrapper= new LambdaQueryWrapper<>(); + queryWrapper.eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE); + queryWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + queryWrapper.eq(SysColumn::getStatus,STATUS); + queryWrapper.last("limit 6"); + queryWrapper.orderByAsc(SysColumn::getOrderNum); + List specialColumns = columnService.list(queryWrapper); + mmap.put("specialColumns", specialColumns); + + LambdaQueryWrapper windowWrapper= new LambdaQueryWrapper<>(); + windowWrapper.eq(SysColumn::getColumnType, WINDOW_COLUMN_TYPE); + windowWrapper.eq(SysColumn::getColumnGrade, COLUMN_GRADE); + windowWrapper.eq(SysColumn::getStatus,STATUS); + windowWrapper.orderByAsc(SysColumn::getOrderNum); + List windowColumns = columnService.list(windowWrapper); + mmap.put("windowColumns", windowColumns); + + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/base"; + } + + @ApiOperation("通知公告") + @GetMapping("/announce_view.html") + public String announce(ModelMap mmap, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { + + PageMethod.startPage(pageNum,pageSize); + //最新通知 + SysNotice sysNotice = new SysNotice(); + sysNotice.setStatus(STATUS); + List list = noticeService.selectNoticeList(sysNotice); + PageInfo page = new PageInfo<>(list, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/announce_view.html"); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/announce_view"; + } + + @ApiOperation("工作动态") + @GetMapping("/work_view.html") + public String work(ModelMap mmap, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { + PageMethod.startPage(pageNum,pageSize); + //工作动态 + SysWork sysWork = new SysWork(); + sysWork.setStatus(STATUS); + List workList = workService.selectSysWorkList(sysWork); + PageInfo page = new PageInfo<>(workList, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/work_view.html"); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/work_view"; + } + + @ApiOperation("部门动态") + @GetMapping("/dept_trends_view.html") + public String trends(ModelMap mmap, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, + @RequestParam(required = false ) String columnId) { + + //部门动态对应的栏目 + List deptColumns = columnService.lambdaQuery() + .eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE) + .eq(SysColumn::getColumnGrade, COLUMN_GRADE) + .eq(SysColumn::getStatus,STATUS) + .orderByAsc(SysColumn::getOrderNum) + .list(); + mmap.put("deptColumns", deptColumns); + + PageMethod.startPage(pageNum,pageSize); + //部门动态 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SysDeptTrends::getStatus,STATUS); + if(StringUtils.isNotBlank(columnId)){ + queryWrapper.eq(SysDeptTrends::getColumnId, columnId); + } + List deptTrends = trendsService.list(queryWrapper); + PageInfo page = new PageInfo<>(deptTrends, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/dept_trends_view.html"); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + + mmap.put("columnId", columnId); + return "home/dept_trends_view"; + } + + @ApiOperation("检查业务") + @GetMapping("/business_view.html") + public String check(ModelMap mmap, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { + PageMethod.startPage(pageNum,pageSize); + //检查业务 + SysBusiness sysBusiness = new SysBusiness(); + sysBusiness.setStatus(STATUS); + List businessList = businessService.selectSysBusinessList(sysBusiness); + PageInfo page = new PageInfo<>(businessList, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/business_view.html"); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/business_view"; + } + + @ApiOperation("专题活动") + @GetMapping("/special_view.html") + public String special(ModelMap mmap, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize, + @RequestParam(required = false ) String columnId + ) { + PageMethod.startPage(pageNum,pageSize); + //专题活动 + SysSpecial sysSpecial = new SysSpecial(); + sysSpecial.setStatus(STATUS); + sysSpecial.setColumnId(columnId); + List specialList = specialService.selectSysSpecialList(sysSpecial); + PageInfo page = new PageInfo<>(specialList, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/special_view.html"); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + //专题活动对应的栏目 + List specialColumns = columnService.lambdaQuery() + .eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE) + .eq(SysColumn::getColumnGrade, COLUMN_GRADE) + .eq(SysColumn::getStatus,STATUS) + .orderByAsc(SysColumn::getOrderNum) + .list(); + mmap.put("specialColumns", specialColumns); + + mmap.put("columnId", columnId); + + return "home/special_view"; + } + + + @ApiOperation("详情") + @GetMapping("/public_view.html") + public String notice(ModelMap mmap,@RequestParam(required = false) String type, @RequestParam String id) { + SysNotice sysNotice = noticeService.selectNoticeById(id); + mmap.put("sysNotice", sysNotice); + SysWork sysWork = workService.selectSysWorkById(id); + mmap.put("sysWork", sysWork); + SysDeptTrends sysDeptTrends = trendsService.selectSysDeptTrendsById(id); + mmap.put("sysDeptTrends", sysDeptTrends); + + SysBusiness sysBusiness = businessService.selectSysBusinessById(id); + mmap.put("sysBusiness", sysBusiness); + + SysSpecial sysSpecial = specialService.selectSysSpecialById(id); + mmap.put("sysSpecial", sysSpecial); + mmap.put("type", type); + //访问量 + /*Integer total = operLogService.selectOperToatl(Constants.WEBSITE_ACCESS); + mmap.put("total", total);*/ + return "home/public_view"; + } + + @ApiOperation("搜索") + @GetMapping("/search") + public String search(ModelMap mmap, @RequestParam(required = false) String title, + @RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum, + @RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) { + PageMethod.startPage(pageNum,pageSize); + List sysTitleVos = noticeService.selectNoticeHomeSearch(title); + PageInfo page = new PageInfo<>(sysTitleVos, pageSize); + mmap.put("page", page); + mmap.put("pageUrl", "/search"); + mmap.put("title", title); + return "home/search _list"; + } + + +}