|
@@ -6,11 +6,14 @@ import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
|
import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
+import com.qmth.themis.business.dto.MqDto;
|
|
|
import com.qmth.themis.business.entity.TOeExamRecord;
|
|
|
import com.qmth.themis.business.enums.ExamRecordStatusEnum;
|
|
|
import com.qmth.themis.business.enums.FinishTypeEnum;
|
|
|
+import com.qmth.themis.business.enums.MqTagEnum;
|
|
|
import com.qmth.themis.business.enums.WebsocketStatusEnum;
|
|
|
import com.qmth.themis.business.service.*;
|
|
|
+import com.qmth.themis.business.util.MqUtil;
|
|
|
import com.qmth.themis.task.quartz.service.QuartzLogicService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -19,9 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @Description: quartz逻辑 impl
|
|
@@ -49,6 +50,12 @@ public class QuartzLogicServiceImpl implements QuartzLogicService {
|
|
|
@Resource
|
|
|
CommonService commonService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ MqUtil mqUtil;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ MqDtoService mqDtoService;
|
|
|
+
|
|
|
/**
|
|
|
* 考试场次quartz逻辑
|
|
|
*
|
|
@@ -202,6 +209,32 @@ public class QuartzLogicServiceImpl implements QuartzLogicService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 考试最后开考时间quartz逻辑
|
|
|
+ *
|
|
|
+ * @param key
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void execExamActivityFinalPrepareTimeJobLogic(String key) {
|
|
|
+ String[] strings = key.split("\\.");
|
|
|
+ String[] exams = strings[1].split("-");
|
|
|
+ ExamActivityCacheBean examActivityCacheBean = teExamActivityService.getExamActivityCacheBean(Long.parseLong(exams[0]));
|
|
|
+ ExamCacheBean examCacheBean = teExamService.getExamCacheBean(Long.parseLong(exams[1]));
|
|
|
+ List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.list(new QueryWrapper<TOeExamRecord>().lambda()
|
|
|
+ .eq(TOeExamRecord::getExamId, examCacheBean.getId())
|
|
|
+ .eq(TOeExamRecord::getExamActivityId, examActivityCacheBean.getId())
|
|
|
+ .eq(TOeExamRecord::getStatus, ExamRecordStatusEnum.FIRST_PREPARE)
|
|
|
+ .eq(TOeExamRecord::getClientWebsocketStatus, WebsocketStatusEnum.ON_LINE));
|
|
|
+ if (!CollectionUtils.isEmpty(tOeExamRecordList)) {
|
|
|
+ for (TOeExamRecord t : tOeExamRecordList) {
|
|
|
+ Map<String, Object> properties = new HashMap<>();
|
|
|
+ properties.put(SystemConstant.RECORD_ID, t.getId());
|
|
|
+ MqDto clientMqDto = new MqDto(mqUtil.getTopic(), MqTagEnum.EXAM_EXIT.name(), t.getId(), MqTagEnum.EXAM_EXIT, String.valueOf(t.getId()), properties, String.valueOf(t.getId()));
|
|
|
+ mqDtoService.assembleSendAsyncOrderMsg(clientMqDto);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// /**
|
|
|
// * 考试语音quartz逻辑
|
|
|
// *
|