From 7cf455d9e9dd66a13c01b3e5d6536a4b3ce7bfbf Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 16 十月 2025 18:09:00 +0800
Subject: [PATCH] 项目管理代码生成

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaNotificationServiceImpl.java |   34 +++++++++++++++++++++++++++++++++-
 1 files changed, 33 insertions(+), 1 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 e581beb..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
@@ -60,6 +60,38 @@
 
         }
         pageInfo.setRecords(list);
-        return null;
+        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