|
@@ -4,15 +4,18 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
+import com.keao.edu.common.enums.MessageTypeEnum;
|
|
|
import com.keao.edu.common.exception.BizException;
|
|
|
import com.keao.edu.common.page.PageInfo;
|
|
|
-import com.keao.edu.common.service.IdGeneratorService;
|
|
|
+import com.keao.edu.common.service.SysMessageService;
|
|
|
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.thirdparty.message.MessageSenderPlugin;
|
|
|
+import com.keao.edu.thirdparty.message.provider.JiguangPushPlugin;
|
|
|
import com.keao.edu.user.api.entity.ExamRoom;
|
|
|
import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
|
|
|
import com.keao.edu.user.api.enums.ExamModeEnum;
|
|
@@ -52,8 +55,6 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
@Autowired
|
|
|
private ExamLocationDao examLocationDao;
|
|
|
@Autowired
|
|
|
- private IdGeneratorService idGeneratorService;
|
|
|
- @Autowired
|
|
|
private ExamRegistrationDao examRegistrationDao;
|
|
|
@Autowired
|
|
|
private ExamTeacherSalaryService examTeacherSalaryService;
|
|
@@ -62,9 +63,11 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
@Autowired
|
|
|
- private SysConfigService sysConfigService;
|
|
|
+ private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
private ExamOrganizationRelationDao examOrganizationRelationDao;
|
|
|
+ @Autowired
|
|
|
+ private SysMessageService sysMessageService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
|
|
@@ -373,7 +376,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
|
|
|
|
|
|
StuRecordDetailDto stuRecordDetailDto = examRegistrationDao.getStuRecordDetail(examRegistrationId);
|
|
|
- int recordMinutes = Integer.parseInt(sysConfigService.findByParamName("record_minutes").getParanValue());
|
|
|
+ int recordMinutes = Integer.parseInt(sysConfigDao.findConfigValue("record_minutes"));
|
|
|
Date date = DateUtil.addMinutes(stuRecordDetailDto.getRecordStartTime(),recordMinutes);
|
|
|
stuRecordDetailDto.setExamEndTime(date);
|
|
|
int secondsBetween = DateUtil.secondsBetween(new Date(),date);
|
|
@@ -384,7 +387,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
stuRecordDetailDto.setRecordTime(recordMinutes);
|
|
|
stuRecordDetailDto.setExamRegistrationId(examRegistrationId);
|
|
|
stuRecordDetailDto.setSongJson(stuRecordDetailDto.getSongJson());
|
|
|
- stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigService.findByParamName("single_song_record_minutes").getParanValue()));
|
|
|
+ stuRecordDetailDto.setSingleSongRecordMinutes(Integer.parseInt(sysConfigDao.findConfigValue("single_song_record_minutes")));
|
|
|
return stuRecordDetailDto;
|
|
|
}
|
|
|
|
|
@@ -447,6 +450,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
}else {
|
|
|
throw new BizException("操作失败:没有待考学员");
|
|
|
}
|
|
|
+ //当等待人数到指定数值时,推送准备考试消息
|
|
|
+ int actionExamPush = Integer.parseInt(sysConfigDao.findConfigValue("action_exam_push"));
|
|
|
+ if(roomStudentListDtos.size() > actionExamPush){
|
|
|
+ RoomStudentListDto studentListDto = roomStudentListDtos.get(actionExamPush - 1);
|
|
|
+ HashMap<Integer, String> map = new HashMap<>();
|
|
|
+ map.put(studentListDto.getStudentId(),studentListDto.getStudentId().toString());
|
|
|
+ String url = "3?examRegistrationId=" + studentListDto.getExamRegistrationId();
|
|
|
+ sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_WILL_START_PUSH,map,null,null,url, JiguangPushPlugin.PLUGIN_NAME);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -459,6 +471,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
|
|
|
examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
|
|
|
examRoomStudentRelation.setSignInTime(null);
|
|
|
studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),3);
|
|
|
+ publishMessage(examRoomStudentRelation,MemberChangedMessage.Not_Finish,isPush,operator);
|
|
|
+ isPush = false;
|
|
|
}else {
|
|
|
//结束考试
|
|
|
studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),5);
|