zouxuan 5 yıl önce
ebeveyn
işleme
811d3ed0ad

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/EmployeeController.java

@@ -34,9 +34,9 @@ public class EmployeeController extends BaseController {
 	public HttpResponseResult<PageInfo<Employee>> getList(EmployeeQueryInfo queryInfo) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		queryInfo.setUserId(sysUser.getId());
-		if(queryInfo.getOrganId() != null){
+		/*if(queryInfo.getOrganId() != null){
 			queryInfo.setOrganIds(organizationService.getChildOrganIds(queryInfo.getOrganId(),true));
-		}
+		}*/
 		return succeed(employeeService.queryPage(queryInfo));
 	}
 

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java

@@ -7,6 +7,7 @@ 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.dto.RoomStudentListDto;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 import com.keao.edu.user.service.EmployeeService;
@@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
 import java.util.Objects;
 
 @RestController
@@ -47,6 +49,13 @@ public class ExamRoomStudentRelationController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation("获取考场学员队列")
+    @PostMapping(value = "/queryStudentList")
+    public HttpResponseResult queryStudentList(Long roomId) {
+        List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationService.queryStudentList(roomId);
+        return succeed();
+    }
+
     @ApiOperation("获取教室学员关联")
     @PostMapping(value = "/getExamRoomStudentRelation")
     public ExamRoomStudentRelation getExamRoomStudentRelation(Integer basicId, String roomId, Integer studentId) {

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java

@@ -3,6 +3,7 @@ package com.keao.edu.user.dao;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
+import com.keao.edu.user.dto.RoomStudentListDto;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -92,4 +93,11 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @param examRegistrationId
      */
     void cleanSignInTime(Long examRegistrationId);
+
+    /**
+     * 获取房间学员队列
+     * @param roomId
+     * @return
+     */
+    List<RoomStudentListDto> queryStudentList(Long roomId);
 }

+ 73 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java

@@ -0,0 +1,73 @@
+package com.keao.edu.user.dto;
+
+public class RoomStudentListDto {
+    private Long examRoomStudentRelationId;
+
+    private Long examRegistrationId;
+
+    private String realName;
+
+    private String subjectName;
+
+    private Integer level;
+
+    private Long examRoomId;
+
+    private Integer studentId;
+
+    public Long getExamRoomStudentRelationId() {
+        return examRoomStudentRelationId;
+    }
+
+    public void setExamRoomStudentRelationId(Long examRoomStudentRelationId) {
+        this.examRoomStudentRelationId = examRoomStudentRelationId;
+    }
+
+    public Long getExamRegistrationId() {
+        return examRegistrationId;
+    }
+
+    public void setExamRegistrationId(Long examRegistrationId) {
+        this.examRegistrationId = examRegistrationId;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getLevel() {
+        return level;
+    }
+
+    public void setLevel(Integer level) {
+        this.level = level;
+    }
+
+    public Long getExamRoomId() {
+        return examRoomId;
+    }
+
+    public void setExamRoomId(Long examRoomId) {
+        this.examRoomId = examRoomId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+}

+ 10 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -4,8 +4,11 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
+import com.keao.edu.user.dto.RoomStudentListDto;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 
+import java.util.List;
+
 public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRoomStudentRelation> {
 
     /**
@@ -71,4 +74,11 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
      * @param examStatus 是否完成考试1是0否
      */
     void nextBit(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Integer examStatus);
+
+    /**
+     * 获取房间学员队列
+     * @param roomId
+     * @return
+     */
+    List<RoomStudentListDto> queryStudentList(Long roomId);
 }

+ 13 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -13,8 +13,10 @@ import com.keao.edu.im.api.entity.ReqUserData;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.api.enums.ExamModeEnum;
+import com.keao.edu.user.controller.WebSocketServer;
 import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
+import com.keao.edu.user.dto.RoomStudentListDto;
 import com.keao.edu.user.entity.*;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
 import com.keao.edu.user.service.ExamRoomStudentRelationService;
@@ -28,6 +30,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
+import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -275,5 +278,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			//推送消息
 
 		}
+		try {
+			WebSocketServer.sendInfo(null,null);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	public List<RoomStudentListDto> queryStudentList(Long roomId) {
+		return examRoomStudentRelationDao.queryStudentList(roomId);
 	}
 }

+ 3 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -116,6 +116,9 @@
 			<if test="tenantId != null and tenantId != 0">
 				AND e.tenant_id_ = #{tenantId}
 			</if>
+			<if test="organId != null">
+				AND e.organ_id_ = #{organId}
+			</if>
 			<if test="organIds != null">
 				AND e.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">

+ 17 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -190,4 +190,21 @@
 		SELECT ersr.* FROM exam_room_student_relation ersr
 		WHERE ersr.exam_room_id_ = #{roomId} AND ersr.student_id_ = #{currentUserId} LIMIT 1
 	</select>
+	<resultMap id="RoomStudentListDtoMap" type="com.keao.edu.user.dto.RoomStudentListDto">
+		<result property="subjectName" column="subject_name_"/>
+		<result property="examRegistrationId" column="exam_registration_id_"/>
+		<result property="studentId" column="student_id_"/>
+		<result property="level" column="level_"/>
+		<result property="realName" column="real_name_"/>
+		<result property="examRoomId" column="exam_room_id_"/>
+		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
+	</resultMap>
+	<select id="queryStudentList" resultType="com.keao.edu.user.dto.RoomStudentListDto">
+		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,
+		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_ FROM exam_room_student_relation ersr
+		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = ersr.exam_registration_id_
+		LEFT JOIN `subject` s ON s.id_ = ec.subject_id_
+		LEFT JOIN sys_user su ON ersr.student_id_ = su.id_
+		WHERE ersr.exam_room_id_ = #{roomId}
+	</select>
 </mapper>