heheng
2024-11-26 c9d2e60f7d1a5cfe9e5b2da93af4d9edeecf5577
expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java
@@ -68,6 +68,9 @@
     */
    @Override
    public List<ProjectManagement> selectProjectManagementList(ProjectManagement projectManagement) {
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){
           projectManagement.setDeptId(SecurityUtils.getDeptId());
        }
        return projectManagementMapper.selectProjectManagementList(projectManagement);
    }
@@ -80,7 +83,9 @@
    @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){
@@ -222,13 +227,7 @@
                .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);
    }
    /**
@@ -239,7 +238,7 @@
     */
    @Override
    public int deleteProjectManagementByIds(Long[] ids) {
        //todo 校验
        // 校验
        for (Long id : ids) {
            checkDataPer(id);
        }
@@ -450,8 +449,8 @@
        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());