|
@@ -2,7 +2,9 @@ package cn.iocoder.yudao.module.system.controller.admin.studentSelectionProject;
|
|
|
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.supervisorSelectionSetting.vo.supervisorSelectionSettingSaveReqVO;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.supervisorSelectionSetting.supervisorSelectionSettingDO;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
import cn.iocoder.yudao.module.system.service.supervisorSelectionSetting.supervisorSelectionSettingService;
|
|
|
+import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
@@ -18,6 +20,7 @@ import javax.servlet.http.*;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.*;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
@@ -46,6 +49,8 @@ public class studentSelectionProjectController {
|
|
|
private studentSelectionProjectService studentSelectionProjectService;
|
|
|
@Resource
|
|
|
private supervisorSelectionSettingService supervisorSelectionSettingService;
|
|
|
+ @Resource
|
|
|
+ private AdminUserService adminUserService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "创建师生互选项目")
|
|
@@ -175,4 +180,16 @@ public class studentSelectionProjectController {
|
|
|
return success(BeanUtils.toBean(result, studentSelectionProjectRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getProjectSupervisors")
|
|
|
+ @Operation(summary = "获取所有项目")
|
|
|
+ public CommonResult<List<AdminUserDO>> getProjectSupervisors(@RequestParam("projectId") Integer projectId) {
|
|
|
+ // 获取项目数据并转换成相应的 VO
|
|
|
+ studentSelectionProjectSaveReqVO project = BeanUtils.toBean(studentSelectionProjectService.getStudentSelectionProject(projectId), studentSelectionProjectSaveReqVO.class);
|
|
|
+ List<Long> supervisorIds = project.getSupervisorIds();
|
|
|
+ Set<Long> newSupervisorIds = new HashSet<>(supervisorIds);
|
|
|
+ List<AdminUserDO> supervisors = adminUserService.getUserList(newSupervisorIds);
|
|
|
+
|
|
|
+ return success(supervisors);
|
|
|
+ }
|
|
|
+
|
|
|
}
|