|
@@ -14,6 +14,7 @@ import com.keao.edu.common.service.IdGeneratorService;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.common.tenant.TenantContextHolder;
|
|
|
import com.keao.edu.im.api.client.ImFeignService;
|
|
|
+import com.keao.edu.im.api.entity.MemberChangedMessage;
|
|
|
import com.keao.edu.im.api.entity.PublishMessageDto;
|
|
|
import com.keao.edu.im.api.entity.ReqUserData;
|
|
|
import com.keao.edu.user.api.entity.ExamRoom;
|
|
@@ -25,6 +26,7 @@ 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.ExamCertificationService;
|
|
|
import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
|
import com.keao.edu.user.service.ExamTeacherSalaryService;
|
|
|
import com.keao.edu.user.service.OrganizationService;
|
|
@@ -52,7 +54,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
@Autowired
|
|
|
private StudentExamResultDao studentExamResultDao;
|
|
|
@Autowired
|
|
|
- private ExamCertificationDao examCertificationDao;
|
|
|
+ private ExamCertificationService examCertificationService;
|
|
|
@Autowired
|
|
|
private ExamLocationDao examLocationDao;
|
|
|
@Autowired
|
|
@@ -165,7 +167,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
studentExamResultDao.batchInsert(studentExamResults);
|
|
|
}
|
|
|
if(!CollectionUtils.isEmpty(examCertifications)){
|
|
|
- examCertificationDao.batchInsert(examCertifications);
|
|
|
+ examCertificationService.batchInsert(examCertifications);
|
|
|
}
|
|
|
if(!CollectionUtils.isEmpty(updateRegistrations)){
|
|
|
examRegistrationDao.batchUpdate(updateRegistrations);
|
|
@@ -263,7 +265,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
List<Long> registIds = Arrays.asList(registIdsStr.split(",")).stream().map(e -> Long.valueOf(e)).collect(Collectors.toList());
|
|
|
examRoomStudentRelationDao.deleteStudentsFromExamRoom(examRoomId, registIds);
|
|
|
studentExamResultDao.deleteWithRegists(registIds);
|
|
|
- int deleteNum = examCertificationDao.deleteWithRegist(registIds);
|
|
|
+ int deleteNum = examCertificationService.deleteWithRegist(registIds);
|
|
|
examRoom.setExamRoomStudentNum(examRoom.getExamRoomStudentNum()-deleteNum);
|
|
|
examRoomDao.update(examRoom);
|
|
|
examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
|
|
@@ -275,10 +277,22 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Integer examStatus, Long roomId) {
|
|
|
- PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
-// publishMessageDto.setUserId();
|
|
|
-// imFeignService.publishMessage();
|
|
|
+ public void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId) {
|
|
|
+ if(examRoomStudentRelationId != null){
|
|
|
+ ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
|
|
|
+ //将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
|
|
|
+ //关闭学员房间入口
|
|
|
+ examRoomStudentRelation.setClassroomSwitch(YesOrNoEnum.NO);
|
|
|
+ examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
+ PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
+ String userId = examRoomStudentRelation.getStudentId().toString();
|
|
|
+ publishMessageDto.setUserId(userId);
|
|
|
+ publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Recorded, userId,3);
|
|
|
+ publishMessageDto.setMemberChangedMessage(msg);
|
|
|
+ imFeignService.publishMessage(publishMessageDto);
|
|
|
+ }
|
|
|
+ nextStudent(nextExamRoomStudentRelationId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -292,10 +306,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
|
public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
|
|
|
-
|
|
|
if(currentExamRoomStudentRelationId != null){
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
|
|
|
-// Long roomId = examRoomStudentRelation.getExamRoomId();
|
|
|
//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
|
|
|
imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
|
|
|
if(examStatus == 0){
|
|
@@ -309,6 +321,18 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
examRoomStudentRelation.setClassroomSwitch(YesOrNoEnum.NO);
|
|
|
examRoomStudentRelationDao.update(examRoomStudentRelation);
|
|
|
}
|
|
|
+ nextStudent(nextExamRoomStudentRelationId);
|
|
|
+
|
|
|
+ try {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
|
|
|
+ WebSocketServer.sendInfo(message,sysUser.getId().toString());
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void nextStudent(Long nextExamRoomStudentRelationId){
|
|
|
if(nextExamRoomStudentRelationId != null){
|
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(nextExamRoomStudentRelationId);
|
|
|
//开启学员房间入口
|
|
@@ -322,13 +346,6 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
userPhoneMap, null, 0, null, null);
|
|
|
sysMessageFeignService.batchSendMessage(sysMessageParams);
|
|
|
}
|
|
|
- try {
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
|
|
|
- WebSocketServer.sendInfo(message,sysUser.getId().toString());
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -356,5 +373,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}
|
|
|
studentExamRoom.setSignInTime(new Date());
|
|
|
examRoomStudentRelationDao.update(studentExamRoom);
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
+ String userId = sysUser.getId().toString();
|
|
|
+ publishMessageDto.setUserId(userId);
|
|
|
+ publishMessageDto.setRoomId(studentExamRoom.getExamRoomId().toString());
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, userId,3);
|
|
|
+ String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRegistrationId));
|
|
|
+ msg.setParamJson(jsonString);
|
|
|
+ publishMessageDto.setMemberChangedMessage(msg);
|
|
|
+ imFeignService.publishMessage(publishMessageDto);
|
|
|
}
|
|
|
}
|