parent
eaa2da840e
commit
9735a3f8f1
@ -1,349 +1,34 @@
|
|||||||
package com.ruoyi.web.controller.home;
|
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.annotation.Log;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
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.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页门户
|
* ClassName: HomeController
|
||||||
* @author wangxy
|
* Package: com.ruoyi.web.controller.home
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* @Author wangxy
|
||||||
|
* @Create 2025/1/13 14:19
|
||||||
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
@Api("首页门户")
|
@Api("首页门户")
|
||||||
@Controller
|
@Controller
|
||||||
public class HomeController {
|
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<SysWork> urlList = workService.selectWorkHomeUrl(new SysWork());
|
|
||||||
mmap.put("urlList", urlList);
|
|
||||||
List<SysNotice> list = noticeService.selectNoticeHomeList(new SysNotice());
|
|
||||||
mmap.put("noticeList", list);
|
|
||||||
//工作动态
|
|
||||||
List<SysWork> workList = workService.selectSysWorkHomeList(new SysWork());
|
|
||||||
mmap.put("workList", workList);
|
|
||||||
//检查业务
|
|
||||||
List<SysBusiness> businessList = businessService.selectSysBusinessHomeList(new SysBusiness());
|
|
||||||
mmap.put("businessList", businessList);
|
|
||||||
//网站内容
|
|
||||||
List<SysContent> contentList = contentService.selectSysContentHomeList(new SysContent());
|
|
||||||
mmap.put("contentList", contentList);
|
|
||||||
|
|
||||||
//部门动态对应的栏目
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> deptColumns = columnService.list(query);
|
|
||||||
mmap.put("deptColumns", deptColumns);
|
|
||||||
//专题活动对应的栏目
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> specialColumns = columnService.list(queryWrapper);
|
|
||||||
mmap.put("specialColumns", specialColumns);
|
|
||||||
//兰铁之窗的栏目
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> 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<SysWork> urlList = workService.selectWorkHomeUrl(new SysWork());
|
|
||||||
mmap.put("urlList", urlList);
|
|
||||||
List<SysNotice> list = noticeService.selectNoticeHomeList(new SysNotice());
|
|
||||||
mmap.put("noticeList", list);
|
|
||||||
//工作动态
|
|
||||||
List<SysWork> workList = workService.selectSysWorkHomeList(new SysWork());
|
|
||||||
mmap.put("workList", workList);
|
|
||||||
//检查业务
|
|
||||||
List<SysBusiness> businessList = businessService.selectSysBusinessHomeList(new SysBusiness());
|
|
||||||
mmap.put("businessList", businessList);
|
|
||||||
//网站内容
|
|
||||||
List<SysContent> contentList = contentService.selectSysContentHomeList(new SysContent());
|
|
||||||
mmap.put("contentList", contentList);
|
|
||||||
|
|
||||||
//部门动态对应的栏目
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> deptColumns = columnService.list(query);
|
|
||||||
mmap.put("deptColumns", deptColumns);
|
|
||||||
|
|
||||||
//专题活动对应的栏目
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> specialColumns = columnService.list(queryWrapper);
|
|
||||||
mmap.put("specialColumns", specialColumns);
|
|
||||||
|
|
||||||
LambdaQueryWrapper<SysColumn> 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<SysColumn> 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<SysNotice> list = noticeService.selectNoticeList(sysNotice);
|
|
||||||
PageInfo<SysNotice> 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<SysWork> workList = workService.selectSysWorkList(sysWork);
|
|
||||||
PageInfo<SysWork> 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<SysColumn> 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<SysDeptTrends> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(SysDeptTrends::getStatus,STATUS);
|
|
||||||
if(StringUtils.isNotBlank(columnId)){
|
|
||||||
queryWrapper.eq(SysDeptTrends::getColumnId, columnId);
|
|
||||||
}
|
|
||||||
List<SysDeptTrends> deptTrends = trendsService.list(queryWrapper);
|
|
||||||
PageInfo<SysDeptTrends> 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<SysBusiness> businessList = businessService.selectSysBusinessList(sysBusiness);
|
|
||||||
PageInfo<SysBusiness> 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<SysSpecial> specialList = specialService.selectSysSpecialList(sysSpecial);
|
|
||||||
PageInfo<SysSpecial> 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<SysColumn> 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("搜索")
|
@Log(title = Constants.WEBSITE_ACCESS, businessType = BusinessType.OTHER)
|
||||||
@GetMapping("/search")
|
@ApiOperation("首页门户")
|
||||||
public String search(ModelMap mmap, @RequestParam(required = false) String title,
|
@GetMapping("/home")
|
||||||
@RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum,
|
public String home(ModelMap mmap) {
|
||||||
@RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize) {
|
|
||||||
PageMethod.startPage(pageNum,pageSize);
|
|
||||||
List<SysTitleVo> sysTitleVos = noticeService.selectNoticeHomeSearch(title);
|
|
||||||
PageInfo<SysTitleVo> page = new PageInfo<>(sysTitleVos, pageSize);
|
|
||||||
mmap.put("page", page);
|
|
||||||
mmap.put("pageUrl", "/search");
|
|
||||||
mmap.put("title", title);
|
|
||||||
return "home/search _list";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return "law/base";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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<SysWork> urlList = workService.selectWorkHomeUrl(new SysWork());
|
||||||
|
mmap.put("urlList", urlList);
|
||||||
|
List<SysNotice> list = noticeService.selectNoticeHomeList(new SysNotice());
|
||||||
|
mmap.put("noticeList", list);
|
||||||
|
//工作动态
|
||||||
|
List<SysWork> workList = workService.selectSysWorkHomeList(new SysWork());
|
||||||
|
mmap.put("workList", workList);
|
||||||
|
//检查业务
|
||||||
|
List<SysBusiness> businessList = businessService.selectSysBusinessHomeList(new SysBusiness());
|
||||||
|
mmap.put("businessList", businessList);
|
||||||
|
//网站内容
|
||||||
|
List<SysContent> contentList = contentService.selectSysContentHomeList(new SysContent());
|
||||||
|
mmap.put("contentList", contentList);
|
||||||
|
|
||||||
|
//部门动态对应的栏目
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> deptColumns = columnService.list(query);
|
||||||
|
mmap.put("deptColumns", deptColumns);
|
||||||
|
//专题活动对应的栏目
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> specialColumns = columnService.list(queryWrapper);
|
||||||
|
mmap.put("specialColumns", specialColumns);
|
||||||
|
//兰铁之窗的栏目
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> 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<SysWork> urlList = workService.selectWorkHomeUrl(new SysWork());
|
||||||
|
mmap.put("urlList", urlList);
|
||||||
|
List<SysNotice> list = noticeService.selectNoticeHomeList(new SysNotice());
|
||||||
|
mmap.put("noticeList", list);
|
||||||
|
//工作动态
|
||||||
|
List<SysWork> workList = workService.selectSysWorkHomeList(new SysWork());
|
||||||
|
mmap.put("workList", workList);
|
||||||
|
//检查业务
|
||||||
|
List<SysBusiness> businessList = businessService.selectSysBusinessHomeList(new SysBusiness());
|
||||||
|
mmap.put("businessList", businessList);
|
||||||
|
//网站内容
|
||||||
|
List<SysContent> contentList = contentService.selectSysContentHomeList(new SysContent());
|
||||||
|
mmap.put("contentList", contentList);
|
||||||
|
|
||||||
|
//部门动态对应的栏目
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> deptColumns = columnService.list(query);
|
||||||
|
mmap.put("deptColumns", deptColumns);
|
||||||
|
|
||||||
|
//专题活动对应的栏目
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> specialColumns = columnService.list(queryWrapper);
|
||||||
|
mmap.put("specialColumns", specialColumns);
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SysColumn> 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<SysColumn> 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<SysNotice> list = noticeService.selectNoticeList(sysNotice);
|
||||||
|
PageInfo<SysNotice> 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<SysWork> workList = workService.selectSysWorkList(sysWork);
|
||||||
|
PageInfo<SysWork> 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<SysColumn> 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<SysDeptTrends> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(SysDeptTrends::getStatus,STATUS);
|
||||||
|
if(StringUtils.isNotBlank(columnId)){
|
||||||
|
queryWrapper.eq(SysDeptTrends::getColumnId, columnId);
|
||||||
|
}
|
||||||
|
List<SysDeptTrends> deptTrends = trendsService.list(queryWrapper);
|
||||||
|
PageInfo<SysDeptTrends> 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<SysBusiness> businessList = businessService.selectSysBusinessList(sysBusiness);
|
||||||
|
PageInfo<SysBusiness> 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<SysSpecial> specialList = specialService.selectSysSpecialList(sysSpecial);
|
||||||
|
PageInfo<SysSpecial> 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<SysColumn> 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<SysTitleVo> sysTitleVos = noticeService.selectNoticeHomeSearch(title);
|
||||||
|
PageInfo<SysTitleVo> page = new PageInfo<>(sysTitleVos, pageSize);
|
||||||
|
mmap.put("page", page);
|
||||||
|
mmap.put("pageUrl", "/search");
|
||||||
|
mmap.put("title", title);
|
||||||
|
return "home/search _list";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue