From aa3a7d33689536fc5dc084c0df27f337db8971dd Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 30 May 2024 15:29:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/home/HomeController.java | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) 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 bc34902..ff4f2f0 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 @@ -227,36 +227,20 @@ public class HomeController { @RequestParam(required = false ) String columnId) { //部门动态对应的栏目 - List deptColumns = null; - if(StringUtils.isNotBlank(columnId)){ - deptColumns = columnService.lambdaQuery() - .eq(SysColumn::getParentId,columnId) - .list(); - } else{ - deptColumns = columnService.lambdaQuery() - .eq(SysColumn::getColumnType, DEPT_COLUMN_TYPE) - .eq(SysColumn::getColumnGrade, COLUMN_GRADE) - .eq(SysColumn::getStatus,STATUS) - .list(); - } - if(CollUtil.isEmpty(deptColumns)){ - deptColumns = columnService.lambdaQuery() - .eq(SysColumn::getColumnId,columnId) - .eq(SysColumn::getStatus,STATUS) - .list(); - } + 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); - List columnIdList = deptColumns.stream().map(SysColumn::getColumnId).collect(Collectors.toList()); - PageMethod.startPage(pageNum,pageSize); //部门动态 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(SysDeptTrends::getStatus,STATUS); - if(CollUtil.isNotEmpty(columnIdList)){ - queryWrapper.in(SysDeptTrends::getColumnId,columnIdList); - }else{ - queryWrapper.eq(SysDeptTrends::getColumnId, null); + if(StringUtils.isNotBlank(columnId)){ + queryWrapper.eq(SysDeptTrends::getColumnId, columnId); } List deptTrends = trendsService.list(queryWrapper); PageInfo page = new PageInfo<>(deptTrends, pageSize); @@ -313,6 +297,7 @@ public class HomeController { .eq(SysColumn::getColumnType, SPECIAL_COLUMN_TYPE) .eq(SysColumn::getColumnGrade, COLUMN_GRADE) .eq(SysColumn::getStatus,STATUS) + .orderByAsc(SysColumn::getOrderNum) .list(); mmap.put("specialColumns", specialColumns);