From 0b7e2752b6f1e87084b837043291c890cca780a8 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期三, 15 十月 2025 19:11:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java index 8887cd7..0ca76f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java @@ -62,4 +62,36 @@ pageInfo.setRecords(list); return pageInfo; } + + @Override + public PageInfo<NotificationVO> pageListUser(NotificationListQuery query) { + List<TDept> tDepts = deptMapper.selectList(null); + Map<Integer, String> deptMap = tDepts.stream().collect(Collectors.toMap(TDept::getId, TDept::getDeptName)); + if (StringUtils.hasLength(query.getDeptName())){ + List<Integer> deptIds = deptMapper.selectList(new LambdaQueryWrapper<TDept>().like(TDept::getDeptName, query.getDeptName())) + .stream().map(TDept::getId).collect(Collectors.toList()); + if (deptIds.isEmpty()){ + return new PageInfo<>(); + } + query.setDeptIds(deptIds); + } + PageInfo<NotificationVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); + List<NotificationVO> list = this.baseMapper.pageListUser(query,pageInfo); + for (NotificationVO notificationVO : list) { + StringBuilder deptName = new StringBuilder(); + if (notificationVO.getType()){ + for (String deptId : notificationVO.getDeptIds().split(",")) { + String orDefault = deptMap.getOrDefault(Integer.parseInt(deptId), ""); + deptName.append(orDefault).append(","); + } + notificationVO.setDeptName(deptName.substring(0,deptName.length()-1)); + }else{ + notificationVO.setDeptName("全部人员"); + + } + + } + pageInfo.setRecords(list); + return pageInfo; + } } -- Gitblit v1.7.1