123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- package com.keao.edu.user.controller;
- import com.keao.edu.auth.api.client.SysUserFeignService;
- import com.keao.edu.auth.api.entity.SysUser;
- import com.keao.edu.common.controller.BaseController;
- import com.keao.edu.common.entity.HttpResponseResult;
- import com.keao.edu.common.page.PageInfo;
- import com.keao.edu.im.api.entity.PublishMessageDto;
- import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
- import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
- import com.keao.edu.user.dto.StuRecordDetailDto;
- 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;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- 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 = "考场与学生关联服务")
- public class ExamRoomStudentRelationController extends BaseController {
- @Autowired
- private ExamRoomStudentRelationService examRoomStudentRelationService;
- @Autowired
- private SysUserFeignService sysUserFeignService;
- @Autowired
- private EmployeeService employeeService;
- /*@ApiOperation("开启/关闭教室")
- @GetMapping(value = "/switchClassRoom")
- public HttpResponseResult switchClassRoom(Integer openFlag,Integer examinationBasicId,Integer studentId) {
- examRoomStudentRelationService.switchClassRoom(openFlag,examinationBasicId,studentId);
- return succeed();
- }*/
- @ApiOperation("签到")
- @PostMapping(value = "/signIn")
- public HttpResponseResult signIn(Long examRegistrationId) {
- examRoomStudentRelationService.signIn(examRegistrationId);
- return succeed();
- }
- @ApiOperation("下一位")
- @PostMapping(value = "/nextBit")
- public HttpResponseResult nextBit(Integer examStatus,Long roomId) {
- examRoomStudentRelationService.nextBit(examStatus,roomId);
- return succeed();
- }
- @ApiOperation("开始考试")
- @PostMapping(value = "/actionExam")
- public HttpResponseResult actionExam(Long roomId) {
- examRoomStudentRelationService.actionExam(roomId);
- return succeed();
- }
- @ApiOperation("监考端选择去录播")
- @PostMapping(value = "/webRecorded")
- public HttpResponseResult webRecorded(Long roomId) {
- examRoomStudentRelationService.recorded(roomId);
- return succeed();
- }
- /*@ApiOperation("学生选择去录播")
- @PostMapping(value = "/stuRecorded")
- public HttpResponseResult<NeedCheckingDetailDto> stuRecorded(Long examRegistrationId) {
- return succeed(examRoomStudentRelationService.stuRecorded(examRegistrationId));
- }*/
- @ApiOperation("学生端录播详情页面")
- @GetMapping(value = "/stuRecordDetail")
- public HttpResponseResult<StuRecordDetailDto> stuRecordDetail(Long examRegistrationId) {
- return succeed(examRoomStudentRelationService.stuRecordDetail(examRegistrationId));
- }
- @ApiOperation("学生端完成录播")
- @PostMapping(value = "/stuEndRecord")
- public HttpResponseResult stuEndRecord(Long examRegistrationId,String videoUrl) {
- examRoomStudentRelationService.stuEndRecord(examRegistrationId,videoUrl);
- return succeed();
- }
- /*@ApiOperation("学生选择重新排队")
- @PostMapping(value = "/againQueue")
- public HttpResponseResult<NeedCheckingDetailDto> againQueue(Long examRegistrationId) {
- return succeed(examRoomStudentRelationService.againQueue(examRegistrationId));
- }*/
- @ApiOperation("获取后台考场待考队列")
- @PostMapping(value = "/queryNeedCheckingList")
- public HttpResponseResult queryNeedCheckingList(Long roomId) {
- return succeed(examRoomStudentRelationService.queryNeedCheckingList(roomId));
- }
- @ApiOperation("获取推送消息内容")
- @PostMapping(value = "api/getPublishMessage")
- public PublishMessageDto getPublishMessage(Long examRegistrationId) {
- return examRoomStudentRelationService.getPublishMessage(examRegistrationId);
- }
- @ApiOperation("获取教室学员关联")
- @PostMapping(value = "api/getExamRoomStudentRelation")
- public ExamRoomStudentRelation getExamRoomStudentRelation(Long registrationId) {
- return examRoomStudentRelationService.getExamRoomStudentRelation(registrationId);
- }
- @ApiOperation("给教室分配学员")
- @PostMapping(value = "/addStudentForRoom")
- public HttpResponseResult addStudentForRoom(Long examRoomId, String registIds){
- SysUser sysUser = sysUserFeignService.queryUserInfo();
- Integer organId=null;
- if(!sysUser.getIsSuperAdmin()){
- Employee employee = employeeService.get(sysUser.getId());
- if(Objects.isNull(employee)){
- return failed("用户信息异常");
- }
- organId=employee.getOrganId();
- }
- examRoomStudentRelationService.addStudentForRoom(examRoomId, registIds, organId);
- return succeed();
- }
- @ApiOperation("更换学员考场")
- @PostMapping(value = "/changeStudentExamRoom")
- public HttpResponseResult changeStudentExamRoom(Long registId, Long examRoomId){
- SysUser sysUser = sysUserFeignService.queryUserInfo();
- Integer organId=null;
- if(!sysUser.getIsSuperAdmin()){
- Employee employee = employeeService.get(sysUser.getId());
- if(Objects.isNull(employee)){
- return failed("用户信息异常");
- }
- organId=employee.getOrganId();
- }
- examRoomStudentRelationService.changeStudentExamRoom(registId, examRoomId, organId);
- return succeed();
- }
- @ApiOperation("获取教室学员")
- @GetMapping(value = "/findExamRoomStudents")
- public HttpResponseResult<PageInfo<ExamRoomStudentRelationDto>> findExamRoomStudents(ExamRoomStudentRelationQueryInfo queryInfo){
- SysUser sysUser = sysUserFeignService.queryUserInfo();
- if(!sysUser.getIsSuperAdmin()){
- Employee employee = employeeService.get(sysUser.getId());
- if(Objects.nonNull(employee)){
- queryInfo.setOrganId(employee.getOrganId());
- }
- }
- return succeed(examRoomStudentRelationService.findExamRoomStudents(queryInfo));
- }
- @ApiOperation("删除指定教室学员")
- @PostMapping(value = "/deleteStudentFromRoom")
- public HttpResponseResult deleteStudentFromRoom(Long examRoomId, String registIds){
- SysUser sysUser = sysUserFeignService.queryUserInfo();
- Integer organId=null;
- if(!sysUser.getIsSuperAdmin()){
- Employee employee = employeeService.get(sysUser.getId());
- if(Objects.isNull(employee)){
- return failed("用户信息异常");
- }
- organId=employee.getOrganId();
- }
- examRoomStudentRelationService.deleteStudentFromRoom(examRoomId, registIds, organId);
- return succeed();
- }
- }
|