| | |
| | | */ |
| | | @Override |
| | | public List<ProjectManagement> selectProjectManagementList(ProjectManagement projectManagement) { |
| | | if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | projectManagement.setDeptId(SecurityUtils.getDeptId()); |
| | | } |
| | | return projectManagementMapper.selectProjectManagementList(projectManagement); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Long insertProjectManagement(ProjectManageSaveReq projectManagement) { |
| | | ProjectManagement projectManagementSave = new ProjectManagement(); |
| | | |
| | | if (SecurityUtils.isAdmin(SecurityUtils.getUserId())){ |
| | | throw new ServiceException("无权新增"); |
| | | } |
| | | projectManagementSave.setDelFlag(0L); |
| | | BeanUtil.copyProperties(projectManagement, projectManagementSave); |
| | | if (projectManagement.getId() != null){ |
| | |
| | | .collect(Collectors.groupingBy(ProjectExpertSaveReqDto::getExpertId, Collectors.counting())); |
| | | |
| | | // 检查是否有任何 expertId 的频率大于 1 |
| | | boolean hasDuplicates = frequencyMap.values().stream().anyMatch(count -> count > 1); |
| | | |
| | | if (hasDuplicates) { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | return frequencyMap.values().stream().anyMatch(count -> count > 1); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deleteProjectManagementByIds(Long[] ids) { |
| | | //todo 校验 |
| | | // 校验 |
| | | for (Long id : ids) { |
| | | checkDataPer(id); |
| | | } |
| | |
| | | if (!StringUtils.isEmpty(dataNum)){ |
| | | Map<Integer, Long> statusCounts = dataNum.stream() |
| | | .collect(Collectors.groupingBy( |
| | | status -> status, // 分组键 |
| | | Collectors.counting() // 计数 |
| | | status -> status, |
| | | Collectors.counting() |
| | | )); |
| | | projectNumResp.setTotal(dataNum.size()); |
| | | projectNumResp.setApproval(statusCounts.get(3) == null ? 0 : statusCounts.get(3).intValue()); |