|
@@ -1,5 +1,8 @@
|
|
package com.keao.edu.user.service.impl;
|
|
package com.keao.edu.user.service.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.keao.edu.auth.api.client.SysMessageFeignService;
|
|
|
|
+import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
import com.keao.edu.common.enums.YesOrNoEnum;
|
|
import com.keao.edu.common.enums.YesOrNoEnum;
|
|
@@ -57,6 +60,10 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
private ExamTeacherSalaryService examTeacherSalaryService;
|
|
private ExamTeacherSalaryService examTeacherSalaryService;
|
|
@Autowired
|
|
@Autowired
|
|
private ImFeignService imFeignService;
|
|
private ImFeignService imFeignService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysMessageFeignService sysMessageFeignService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
@@ -265,7 +272,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus) {
|
|
|
|
|
|
+ public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
|
|
|
|
+
|
|
if(currentExamRoomStudentRelationId != null){
|
|
if(currentExamRoomStudentRelationId != null){
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
|
|
ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
|
|
Long roomId = examRoomStudentRelation.getExamRoomId();
|
|
Long roomId = examRoomStudentRelation.getExamRoomId();
|
|
@@ -291,7 +299,9 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
- WebSocketServer.sendInfo(null,null);
|
|
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
|
|
|
|
+ WebSocketServer.sendInfo(message,sysUser.getId().toString());
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -315,8 +325,11 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public void signIn(Long examRegistrationId) {
|
|
|
|
|
|
+ public synchronized void signIn(Long examRegistrationId) {
|
|
ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationDao.getStudentExamRoom(examRegistrationId);
|
|
ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationDao.getStudentExamRoom(examRegistrationId);
|
|
|
|
+ if(studentExamRoom.getSignInTime() != null){
|
|
|
|
+ throw new BizException("您已签到,请勿重复操作!");
|
|
|
|
+ }
|
|
studentExamRoom.setSignInTime(new Date());
|
|
studentExamRoom.setSignInTime(new Date());
|
|
examRoomStudentRelationDao.update(studentExamRoom);
|
|
examRoomStudentRelationDao.update(studentExamRoom);
|
|
}
|
|
}
|