| | |
| | | } |
| | | |
| | | @Override |
| | | public StateProject getEnableProjectById(String id) { |
| | | LambdaQueryWrapper<StateProject> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(StateProject::getDelFlag, NOT_DELETED.getKey()); |
| | | queryWrapper.eq(StateProject::getId, id); |
| | | return getOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<ProjectImplPageVO> getProjectImplPage(GetProjectPageBO getProjectPageBO) { |
| | | PageUtils.startPage(); |
| | | |
| | |
| | | if (CollectionUtils.isEmpty(projectList)) { |
| | | return new PageInfo<>(); |
| | | } |
| | | //现在存储的department是项目名字这里直接注释掉 |
| | | // // 获取所有的 department ID 列表 |
| | | // List<String> deptIdList = projectList.stream() |
| | | // .flatMap(project -> Arrays.stream(project.getDepartment().split(","))) // 根据逗号分隔 |
| | | // .map(String::trim) // 去除空格 |
| | | // .distinct() // 去重 |
| | | // .collect(Collectors.toList()); |
| | | // |
| | | // // 获取对应的部门数据 |
| | | // Map<String, SysDept> stringSysDeptMap = deptService.selectMapDeptById(deptIdList); |
| | | // |
| | | // // 更新 projectList 中的 department |
| | | // projectList.forEach(project -> { |
| | | // // 将 department 以逗号分隔并获取对应的部门名称 |
| | | // String newDepartment = Arrays.stream(project.getDepartment().split(",")) |
| | | // .map(deptId -> Optional.ofNullable(stringSysDeptMap.get(deptId.trim())).map(SysDept::getDeptName).orElse("")) |
| | | // .filter(name -> !name.isEmpty()) // 过滤空的部门名称 |
| | | // .collect(Collectors.joining(",")); // 以逗号连接 |
| | | // project.setDepartment(newDepartment); |
| | | // }); |
| | | |
| | | // 4. 构建结果对象 |
| | | PageInfo<StateProject> stateProjectPageInfo = new PageInfo<>(projectList); |
| | | List<String> projectIdList = stateProjectPageInfo.getList().stream().map(StateProject::getId).collect(Collectors.toList()); |