|
@@ -1,16 +1,19 @@
|
|
package com.qmth.themis.business.service.impl;
|
|
package com.qmth.themis.business.service.impl;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
|
|
import com.qmth.themis.business.dao.TEExamActivityMapper;
|
|
import com.qmth.themis.business.dao.TEExamActivityMapper;
|
|
import com.qmth.themis.business.entity.TEExamActivity;
|
|
import com.qmth.themis.business.entity.TEExamActivity;
|
|
import com.qmth.themis.business.service.TEExamActivityService;
|
|
import com.qmth.themis.business.service.TEExamActivityService;
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 考试场次 服务实现类
|
|
* @Description: 考试场次 服务实现类
|
|
@@ -107,4 +110,27 @@ public class TEExamActivityServiceImpl extends ServiceImpl<TEExamActivityMapper,
|
|
public List<Map> getWaitingExam(Long studentId, Long examId, Long examActivityId) {
|
|
public List<Map> getWaitingExam(Long studentId, Long examId, Long examActivityId) {
|
|
return teExamActivityMapper.getWaitingExam(studentId, examId, examActivityId);
|
|
return teExamActivityMapper.getWaitingExam(studentId, examId, examActivityId);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Cacheable(value = "exam_activity", key = "#examActivityId",unless = "#result == null")
|
|
|
|
+ @Override
|
|
|
|
+ public ExamActivityCacheBean getExamActivityCacheBean(Long examActivityId) {
|
|
|
|
+ ExamActivityCacheBean ret=null;
|
|
|
|
+ TEExamActivity ac=getById(examActivityId);
|
|
|
|
+ if(ac==null) {
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ if(ac.getEnable()!=null&&ac.getEnable().intValue()==0) {
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ ret=new ExamActivityCacheBean();
|
|
|
|
+ ret.setId(ac.getId());
|
|
|
|
+ ret.setCode(ac.getCode());
|
|
|
|
+ ret.setExamId(ac.getExamId());
|
|
|
|
+ ret.setPrepareSeconds(ac.getPrepareSeconds());
|
|
|
|
+ ret.setMaxDurationSeconds(ac.getMaxDurationSeconds());
|
|
|
|
+ ret.setOpeningSeconds(ac.getOpeningSeconds());
|
|
|
|
+ ret.setStartTime(ac.getStartTime());
|
|
|
|
+ ret.setFinishTime(ac.getFinishTime());
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
}
|
|
}
|