考试周、考试定时设置

This commit is contained in:
wuchunlei
2024-09-05 13:38:37 +08:00
parent a316090e81
commit 56cc4ea95b
3 changed files with 3 additions and 7 deletions

View File

@@ -314,10 +314,7 @@ public class ClassEntityServiceImpl extends ServiceImpl<ClassEntityDao, ClassEnt
DelayQueueConfig.COMMON_EXCHANGE,
DelayQueueConfig.COMMON_ROUTING_KEY,
"examDays"+","+classEntity.getId(),
messagePostProcessor(DateUtils.addDateDays(
DateUtil.parseDate(LocalDate.now().toString()),
classModel.getDays()-classModel.getExamDays())
.getTime())
messagePostProcessor((classModel.getDays()-classModel.getExamDays())*24*60*60*1000)
);
}
}else {

View File

@@ -220,12 +220,11 @@ public class ClassExamServiceImpl extends ServiceImpl<ClassExamDao, ClassExam> i
classExamUser.setStartTime(startTime);
classExamUserDao.insert(classExamUser);
//在考试结束时检查是否提交,未完成者自动提交
//时间为2小时再队列执行中也有设置修改时要同步修改
rabbitTemplate.convertAndSend(
DelayQueueConfig.COMMON_EXCHANGE,
DelayQueueConfig.COMMON_ROUTING_KEY,
"examSubmit"+","+classExamUser.getId(),
messagePostProcessor(DateUtils.addDateHours(startTime,2).getTime())
messagePostProcessor(60*60*1000)
);
return R.ok().put("examPaper",resultList).put("id",classExamUser.getId()).put("startTime",classExamUser.getStartTime());

View File

@@ -27,7 +27,7 @@ public class CommonConsumer {
@Autowired
private ClassExamService classexamService;
@RabbitListener(queues = DelayQueueConfig.USERVIP_QUEUE)
@RabbitListener(queues = DelayQueueConfig.COMMON_QUEUE)
public void commonConsumer(String typeAndParam) {
//参数为 业务模块 + , + 参数
String[] typeAndParams = typeAndParam.split(",");