|
@@ -7,7 +7,9 @@ import com.keao.edu.common.entity.HttpResponseResult;
|
|
|
import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
|
|
|
import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
|
|
|
+import com.keao.edu.user.entity.Employee;
|
|
|
import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
|
|
|
+import com.keao.edu.user.service.EmployeeService;
|
|
|
import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping("examRoomStudentRelation")
|
|
|
@Api(tags = "考场与学生关联服务")
|
|
@@ -26,6 +30,8 @@ public class ExamRoomStudentRelationController extends BaseController {
|
|
|
private ExamRoomStudentRelationService examRoomStudentRelationService;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private EmployeeService employeeService;
|
|
|
|
|
|
@ApiOperation("开启/关闭教室")
|
|
|
@GetMapping(value = "/switchClassRoom")
|
|
@@ -51,7 +57,12 @@ public class ExamRoomStudentRelationController extends BaseController {
|
|
|
@GetMapping(value = "/findExamRoomStudents")
|
|
|
public HttpResponseResult<PageInfo<ExamRoomStudentRelationDto>> findExamRoomStudents(ExamRoomStudentRelationQueryInfo queryInfo){
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- queryInfo.setOrganId(sysUser.getId());
|
|
|
+ if(!sysUser.getIsSuperAdmin()){
|
|
|
+ Employee employee = employeeService.get(sysUser.getId());
|
|
|
+ if(Objects.nonNull(employee)){
|
|
|
+ queryInfo.setOrganId(employee.getOrganId());
|
|
|
+ }
|
|
|
+ }
|
|
|
return succeed(examRoomStudentRelationService.findExamRoomStudents(queryInfo));
|
|
|
}
|
|
|
|