禅道#636、#670问题修复

This commit is contained in:
gaoqr
2024-11-25 16:09:43 +08:00
parent 8f695c765b
commit dfb2a0cccf
3 changed files with 12 additions and 6 deletions
@@ -1,6 +1,7 @@
package com.cf.imes.module.system.controller.admin.notice;
import cn.hutool.core.lang.Assert;
import com.cf.imes.framework.common.enums.CommonStatusEnum;
import com.cf.imes.framework.common.enums.UserTypeEnum;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageResult;
@@ -62,11 +63,21 @@ public class NoticeController {
@GetMapping("/page")
@Operation(summary = "获取通知公告列表")
@PreAuthorize("@ss.hasPermission('system:notice:query')")
public CommonResult<PageResult<NoticeRespVO>> getNoticePage(@Validated NoticePageReqVO pageReqVO) {
PageResult<NoticeDO> pageResult = noticeService.getNoticePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, NoticeRespVO.class));
}
@GetMapping("/homepage")
@Operation(summary = "获取首页通知公告列表")
public CommonResult<PageResult<NoticeRespVO>> getHomePageNoticePage(@Validated NoticePageReqVO pageReqVO) {
// 首页只看生效的公告
pageReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
PageResult<NoticeDO> pageResult = noticeService.getNoticePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, NoticeRespVO.class));
}
@GetMapping("/get")
@Operation(summary = "获得通知公告")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@@ -36,7 +36,7 @@ public interface RoleMapper extends BaseMapperX<RoleDO> {
.eqIfPresent(RoleDO::getStatus, reqVO.getStatus())
.betweenIfPresent(RoleDO::getCreateTime, reqVO.getCreateTime())
.ne(RoleDO::getId, 1)
.orderByAsc(RoleDO::getId);
.orderByAsc(RoleDO::getSort).orderByAsc(RoleDO::getId);
return selectPage(reqVO, lambdaQueryWrapperX);
}
@@ -54,11 +54,6 @@ public class NoticeServiceImpl implements NoticeService {
@Override
public PageResult<NoticeDO> getNoticePage(NoticePageReqVO reqVO) {
// 没有显示传入状态默认查有效的
Integer status = reqVO.getStatus();
if (ObjectUtil.isNull(status)) {
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
}
return noticeMapper.selectPage(reqVO);
}