From 9ec0ecb6e1a81f1ce55935b9ba7fbda6c3a8810a Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期三, 15 十月 2025 15:27: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