xuhy
2026-03-04 30521c18a4c09ca3ff03b8216a243adc745ccf3c
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TExperimentResultReportController.java
@@ -134,13 +134,25 @@
        Long userId = tokenService.getLoginUser().getUserId();
        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
        if(roleType != 1){
            // 查询用户所参与的实验调度
            List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class)
                    .eq(TExperimentDispatchParticipants::getUserId, userId));
            if(experimentDispatchParticipants.size() > 0){
                // 查询项目组id
                List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList());
                query.setDispatchIds(dispatchIds);
            // 查询项目组
            List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class)
                    .eq(TProjectTeamStaff::getUserId, userId)
                    .eq(TProjectTeamStaff::getRoleType, 2));
            if(!CollectionUtils.isEmpty(projectTeamStaffs)){
                List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).collect(Collectors.toList());
                // 查询分组
                List<TProjectTeamStaff> tProjectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class)
                        .in(TProjectTeamStaff::getTeamId, teamIds)
                        .eq(TProjectTeamStaff::getRoleType, 3));
                List<Long> userIds = tProjectTeamStaffs.stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
                // 查询用户所参与的实验调度
                List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class)
                        .in(TExperimentDispatchParticipants::getUserId, userIds));
                if(!experimentDispatchParticipants.isEmpty()){
                    // 查询项目组id
                    List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList());
                    query.setDispatchIds(dispatchIds);
                }
            }
        }
        return R.ok(experimentResultReportService.evaluatePageList(query));
@@ -174,6 +186,14 @@
        }
        resultWorkEvaluateService.saveOrUpdateBatch(resultWorkEvaluates);
        // 查询实验调度
        TExperimentDispatch dispatch = experimentDispatchService.getById(dto.getDispatchId());
        if(Objects.nonNull(dispatch)){
            // 修改结束时间
            dispatch.setExperimentEndTime(LocalDateTime.now());
            experimentDispatchService.updateById(dispatch);
        }
        // 查询项目组
        TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId());
        // MESSAGE 添加消息
@@ -205,6 +225,15 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class)
                .eq(TProjectTeamStaff::getUserId, userId));
        // 查询实验调度
        TExperimentDispatch dispatch = experimentDispatchService.getById(dto.getDispatchId());
        if(Objects.nonNull(dispatch)){
            // 修改结束时间
            dispatch.setExperimentEndTime(LocalDateTime.now());
            experimentDispatchService.updateById(dispatch);
        }
        // 查询项目组
        TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId());
        if(dto.getStatus() != -1){